@semiont/cli 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +27 -12
- package/dist/frontend/dist/assets/{CookiePreferences-CMgprW9V.js → CookiePreferences-Vt05bBY7.js} +2 -2
- package/dist/frontend/dist/assets/{CookiePreferences-CMgprW9V.js.map → CookiePreferences-Vt05bBY7.js.map} +1 -1
- package/dist/frontend/dist/assets/{KeyboardShortcutsContext-BRLeqQUj.js → KeyboardShortcutsContext-CK7NFEft.js} +2 -2
- package/dist/frontend/dist/assets/{KeyboardShortcutsContext-BRLeqQUj.js.map → KeyboardShortcutsContext-CK7NFEft.js.map} +1 -1
- package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-CN3C3S55-DsCya3j0.js → PdfAnnotationCanvas.client-CN3C3S55-DZ2osbg-.js} +2 -2
- package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-CN3C3S55-DsCya3j0.js.map → PdfAnnotationCanvas.client-CN3C3S55-DZ2osbg-.js.map} +1 -1
- package/dist/frontend/dist/assets/{ToolbarPanels-CRGQDX-L.js → ToolbarPanels-wzZqAqCQ.js} +2 -2
- package/dist/frontend/dist/assets/{ToolbarPanels-CRGQDX-L.js.map → ToolbarPanels-wzZqAqCQ.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-DvALJ3DL.js → client-C54EWgTc.js} +2 -2
- package/dist/frontend/dist/assets/{client-DvALJ3DL.js.map → client-C54EWgTc.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-uEoQ8iJO.js → client-D5yyxFbt.js} +2 -2
- package/dist/frontend/dist/assets/{client-uEoQ8iJO.js.map → client-D5yyxFbt.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-DkMJxPA7.js → client-DgzjF497.js} +2 -2
- package/dist/frontend/dist/assets/{client-DkMJxPA7.js.map → client-DgzjF497.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-DxlEW_QJ.js → client-myF3ozNf.js} +2 -2
- package/dist/frontend/dist/assets/{client-DxlEW_QJ.js.map → client-myF3ozNf.js.map} +1 -1
- package/dist/frontend/dist/assets/{index-DjtRDlfn.js → index-DojEUBpq.js} +6 -6
- package/dist/frontend/dist/assets/index-DojEUBpq.js.map +1 -0
- package/dist/frontend/dist/assets/{layout-xDEqzpvE.js → layout-CpxxVgZl.js} +2 -2
- package/dist/frontend/dist/assets/{layout-xDEqzpvE.js.map → layout-CpxxVgZl.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-BhnmJA6O.js → layout-DGddEk2F.js} +2 -2
- package/dist/frontend/dist/assets/{layout-BhnmJA6O.js.map → layout-DGddEk2F.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-e6QyrD0Y.js → layout-WUjhuEFR.js} +2 -2
- package/dist/frontend/dist/assets/{layout-e6QyrD0Y.js.map → layout-WUjhuEFR.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-DolG9tOf.js → layout-osn4jTJF.js} +2 -2
- package/dist/frontend/dist/assets/{layout-DolG9tOf.js.map → layout-osn4jTJF.js.map} +1 -1
- package/dist/frontend/dist/assets/{not-found-4iuCkpA7.js → not-found-CXjr3aHk.js} +2 -2
- package/dist/frontend/dist/assets/{not-found-4iuCkpA7.js.map → not-found-CXjr3aHk.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DVCVvH_S.js → page-3_orURnj.js} +2 -2
- package/dist/frontend/dist/assets/{page-DVCVvH_S.js.map → page-3_orURnj.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CXhfUrZM.js → page-A0bP7R9_.js} +2 -2
- package/dist/frontend/dist/assets/{page-CXhfUrZM.js.map → page-A0bP7R9_.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BrSlkHj9.js → page-BXDwcCLI.js} +2 -2
- package/dist/frontend/dist/assets/{page-BrSlkHj9.js.map → page-BXDwcCLI.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D0bYoQZI.js → page-CR97hIaP.js} +2 -2
- package/dist/frontend/dist/assets/{page-D0bYoQZI.js.map → page-CR97hIaP.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-C5gTlI4M.js → page-ClOO6d4L.js} +2 -2
- package/dist/frontend/dist/assets/{page-C5gTlI4M.js.map → page-ClOO6d4L.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-8sXDEos5.js → page-CoU19X7P.js} +2 -2
- package/dist/frontend/dist/assets/{page-8sXDEos5.js.map → page-CoU19X7P.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CXVPWK3i.js → page-Crea7MLa.js} +2 -2
- package/dist/frontend/dist/assets/{page-CXVPWK3i.js.map → page-Crea7MLa.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-7cCGgkUd.js → page-D3vt40lt.js} +2 -2
- package/dist/frontend/dist/assets/{page-7cCGgkUd.js.map → page-D3vt40lt.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-6YupxiP8.js → page-D74-p81B.js} +2 -2
- package/dist/frontend/dist/assets/{page-6YupxiP8.js.map → page-D74-p81B.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CkHE2rPM.js → page-D9VjQ4Ci.js} +2 -2
- package/dist/frontend/dist/assets/{page-CkHE2rPM.js.map → page-D9VjQ4Ci.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BioSV21A.js → page-DAaiG0_S.js} +2 -2
- package/dist/frontend/dist/assets/{page-BioSV21A.js.map → page-DAaiG0_S.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BOhOKDMk.js → page-DGGXDS8h.js} +2 -2
- package/dist/frontend/dist/assets/{page-BOhOKDMk.js.map → page-DGGXDS8h.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-A6_MoyUb2.js → page-DWTT4pP82.js} +2 -2
- package/dist/frontend/dist/assets/{page-A6_MoyUb2.js.map → page-DWTT4pP82.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D1veR3Kp.js → page-Db8QDovL.js} +2 -2
- package/dist/frontend/dist/assets/{page-D1veR3Kp.js.map → page-Db8QDovL.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DbwiMF1N.js → page-V3GB89Xa.js} +2 -2
- package/dist/frontend/dist/assets/{page-DbwiMF1N.js.map → page-V3GB89Xa.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Bl8sZu8k.js → page-pid5J2JR.js} +2 -2
- package/dist/frontend/dist/assets/{page-Bl8sZu8k.js.map → page-pid5J2JR.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D6oe9LkY.js → page-vxSCIznX.js} +2 -2
- package/dist/frontend/dist/assets/{page-D6oe9LkY.js.map → page-vxSCIznX.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-B9EYfbrY.js → page-yaV9evoV.js} +2 -2
- package/dist/frontend/dist/assets/{page-B9EYfbrY.js.map → page-yaV9evoV.js.map} +1 -1
- package/dist/frontend/dist/assets/{routing-DW1ehi64.js → routing-CcetIVef.js} +2 -2
- package/dist/frontend/dist/assets/{routing-DW1ehi64.js.map → routing-CcetIVef.js.map} +1 -1
- package/dist/frontend/dist/assets/{routing-Bcj1FhkC.js → routing-Dqgz2rV4.js} +2 -2
- package/dist/frontend/dist/assets/{routing-Bcj1FhkC.js.map → routing-Dqgz2rV4.js.map} +1 -1
- package/dist/frontend/dist/assets/{web-Dr6mdA1A.js → web-DAgGdiC_.js} +2 -2
- package/dist/frontend/dist/assets/{web-Dr6mdA1A.js.map → web-DAgGdiC_.js.map} +1 -1
- package/dist/frontend/dist/index.html +1 -1
- package/dist/frontend/package.json +1 -1
- package/package.json +8 -8
- package/dist/frontend/dist/assets/index-DjtRDlfn.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/en-L45VK7BS-C9ArL-E1.js","assets/chunk-GERSK2DY-D2Q8aVeK.js","assets/PdfAnnotationCanvas.client-CN3C3S55-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/en-L45VK7BS-C9ArL-E1.js","assets/chunk-GERSK2DY-D2Q8aVeK.js","assets/PdfAnnotationCanvas.client-CN3C3S55-DZ2osbg-.js","assets/rolldown-runtime-jpDsebLB.js","assets/i18n-B53Yefbh.js","assets/vendor-0HjOURbh.js","assets/layout-osn4jTJF.js","assets/KeyboardShortcutsContext-CK7NFEft.js","assets/routing-Dqgz2rV4.js","assets/page-vxSCIznX.js","assets/page-D74-p81B.js","assets/CookiePreferences-Vt05bBY7.js","assets/XMarkIcon-CddZGiiz.js","assets/routing-CcetIVef.js","assets/page-Crea7MLa.js","assets/page-DWTT4pP82.js","assets/page-V3GB89Xa.js","assets/page-BXDwcCLI.js","assets/page-ClOO6d4L.js","assets/page-pid5J2JR.js","assets/layout-CpxxVgZl.js","assets/ToolbarPanels-wzZqAqCQ.js","assets/ChevronLeftIcon-QLs1eT1j.js","assets/page-D3vt40lt.js","assets/page-yaV9evoV.js","assets/page-DAaiG0_S.js","assets/page-3_orURnj.js","assets/layout-DGddEk2F.js","assets/ArrowsRightLeftIcon-eQUXtsyS.js","assets/CommandLineIcon-BEeeWFhQ.js","assets/page-DGGXDS8h.js","assets/client-D5yyxFbt.js","assets/client-DgzjF497.js","assets/client-C54EWgTc.js","assets/page-CR97hIaP.js","assets/layout-WUjhuEFR.js","assets/page-Db8QDovL.js","assets/page-CoU19X7P.js","assets/page-D9VjQ4Ci.js","assets/page-A0bP7R9_.js","assets/client-myF3ozNf.js","assets/not-found-CXjr3aHk.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,t}from"./rolldown-runtime-jpDsebLB.js";import{i as n,n as r,r as i,t as a}from"./i18n-B53Yefbh.js";import{n as o,r as s,t as c}from"./vendor-0HjOURbh.js";import{y as l}from"./chunk-GERSK2DY-D2Q8aVeK.js";import{i as u,n as d,r as f,t as p}from"./chunk-K6BJDL2I-CcwOtHVB.js";(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var m=e(n(),1),h=e(s(),1),g=e(o()),_=`modulepreload`,v=function(e){return`/`+e},y={},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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}))))}r=o(t.map(t=>{if(t=v(t,n),t in y)return;y[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}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)})},x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return ee(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||E(),unstable_mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ee(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return te(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function te(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),w(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:k(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function j(e,t,n=`/`){return ne(e,t,n,!1)}function ne(e,t,n,r){let i=ve((typeof t==`string`?A(t):t).pathname||`/`,n);if(i==null)return null;let a=ie(e);M(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=_e(i);o=me(a[e],t,r)}return o}function re(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ie(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ee([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ie(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:fe(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ae(e.path))a(e,t,!0,n)}),t}function ae(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ae(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function M(e){e.sort((e,t)=>e.score===t.score?pe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,N=-2,de=e=>e===`*`;function fe(e,t){let n=e.split(`/`),r=n.length;return n.some(de)&&(r+=N),t&&(r+=ce),n.filter(e=>!de(e)).reduce((e,t)=>e+(oe.test(t)?se:t===``?le:ue),r)}function pe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function me(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=he({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=he({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Ee([a,u.pathname]),pathnameBase:De(Ee([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Ee([a,u.pathnameBase]))}return o}function he(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ge(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ge(e,t=!1,n=!0){T(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function _e(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ve(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function be(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?xe(n.substring(1),`/`):xe(n,t)):a=t,{pathname:a,search:Oe(r),hash:ke(i)}}function xe(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Se(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ce(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function we(e){let t=Ce(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Te(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Se(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Se(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Se(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=be(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ee=e=>e.join(`/`).replace(/\/\/+/g,`/`),De=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Oe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ke=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ae=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Me(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var Ne=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Pe(e,t){let n=e;if(typeof n!=`string`||!ye.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ne)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ve(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Fe=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Fe);var Ie=[`GET`,...Fe];new Set(Ie);var Le=m.createContext(null);Le.displayName=`DataRouter`;var Re=m.createContext(null);Re.displayName=`DataRouterState`;var ze=m.createContext(!1),Be=m.createContext({isTransitioning:!1});Be.displayName=`ViewTransition`;var Ve=m.createContext(new Map);Ve.displayName=`Fetchers`;var He=m.createContext(null);He.displayName=`Await`;var Ue=m.createContext(null);Ue.displayName=`Navigation`;var We=m.createContext(null);We.displayName=`Location`;var Ge=m.createContext({outlet:null,matches:[],isDataRoute:!1});Ge.displayName=`Route`;var Ke=m.createContext(null);Ke.displayName=`RouteError`;var qe=`REACT_ROUTER_ERROR`,Je=`REDIRECT`,Ye=`ROUTE_ERROR_RESPONSE`;function Xe(e){if(e.startsWith(`${qe}:${Je}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ze(e){if(e.startsWith(`${qe}:${Ye}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ae(t.status,t.statusText,t.data)}catch{}}function Qe(e,{relative:t}={}){w($e(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=m.useContext(Ue),{hash:i,pathname:a,search:o}=ct(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ee([n,a])),r.createHref({pathname:s,search:o,hash:i})}function $e(){return m.useContext(We)!=null}function et(){return w($e(),`useLocation() may be used only in the context of a <Router> component.`),m.useContext(We).location}var tt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function nt(e){m.useContext(Ue).static||m.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=m.useContext(Ge);return e?Dt():it()}function it(){w($e(),`useNavigate() may be used only in the context of a <Router> component.`);let e=m.useContext(Le),{basename:t,navigator:n}=m.useContext(Ue),{matches:r}=m.useContext(Ge),{pathname:i}=et(),a=JSON.stringify(we(r)),o=m.useRef(!1);return nt(()=>{o.current=!0}),m.useCallback((r,s={})=>{if(T(o.current,tt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Te(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ee([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var at=m.createContext(null);function ot(e){let t=m.useContext(Ge).outlet;return m.useMemo(()=>t&&m.createElement(at.Provider,{value:e},t),[t,e])}function st(){let{matches:e}=m.useContext(Ge),t=e[e.length-1];return t?t.params:{}}function ct(e,{relative:t}={}){let{matches:n}=m.useContext(Ge),{pathname:r}=et(),i=JSON.stringify(we(n));return m.useMemo(()=>Te(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function lt(e,t){return ut(e,t)}function ut(e,t,n){w($e(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=m.useContext(Ue),{matches:i}=m.useContext(Ge),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;kt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
3
|
|
|
4
4
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=et(),d;if(t){let e=typeof t==`string`?A(t):t;w(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=j(e,{pathname:p});T(l||h!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),T(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=_t(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ee([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ee([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?m.createElement(We.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},g):g}function dt(){let e=Et(),t=je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=m.createElement(m.Fragment,null,m.createElement(`p`,null,`💿 Hey developer 👋`),m.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,m.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,m.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),m.createElement(m.Fragment,null,m.createElement(`h2`,null,`Unexpected Application Error!`),m.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?m.createElement(`pre`,{style:i},n):null,o)}var ft=m.createElement(dt,null),pt=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ze(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:m.createElement(Ge.Provider,{value:this.props.routeContext},m.createElement(Ke.Provider,{value:e,children:this.props.component}));return this.context?m.createElement(ht,{error:e},t):t}};pt.contextType=ze;var mt=new WeakMap;function ht({children:e,error:t}){let{basename:n}=m.useContext(Ue);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Xe(t.digest);if(e){let r=mt.get(t);if(r)throw r;let i=Pe(e.location,n);if(Ne&&!mt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw mt.set(t,n),n}return m.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function gt({routeContext:e,match:t,children:n}){let r=m.useContext(Le);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Ge.Provider,{value:e},n)}function _t(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Me(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ft,o&&(s<0&&c===0?(kt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?p:n.route.Component?m.createElement(n.route.Component,null):n.route.element?n.route.element:e,m.createElement(gt,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?m.createElement(pt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function vt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yt(e){let t=m.useContext(Le);return w(t,vt(e)),t}function bt(e){let t=m.useContext(Re);return w(t,vt(e)),t}function xt(e){let t=m.useContext(Ge);return w(t,vt(e)),t}function St(e){let t=xt(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ct(){return St(`useRouteId`)}function wt(){return bt(`useNavigation`).navigation}function Tt(){let{matches:e,loaderData:t}=bt(`useMatches`);return m.useMemo(()=>e.map(e=>re(e,t)),[e,t])}function Et(){let e=m.useContext(Ke),t=bt(`useRouteError`),n=St(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Dt(){let{router:e}=yt(`useNavigate`),t=St(`useNavigate`),n=m.useRef(!1);return nt(()=>{n.current=!0}),m.useCallback(async(r,i={})=>{T(n.current,tt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ot={};function kt(e,t,n){!t&&!Ot[e]&&(Ot[e]=!0,T(!1,n))}m.memo(At);function At({routes:e,future:t,state:n,isStatic:r,onError:i}){return ut(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function jt({to:e,replace:t,state:n,relative:r}){w($e(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=m.useContext(Ue);T(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=m.useContext(Ge),{pathname:o}=et(),s=rt(),c=Te(e,we(a),o,r===`path`),l=JSON.stringify(c);return m.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Mt(e){return ot(e.context)}function Nt(e){w(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Pt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){w(!$e(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=m.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:h}=n,g=m.useMemo(()=>{let e=ve(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:h},navigationType:r}},[s,l,u,d,f,p,r,h]);return T(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:m.createElement(Ue.Provider,{value:c},m.createElement(We.Provider,{children:t,value:g}))}function Ft({children:e,location:t}){return lt(It(e),t)}m.Component;function It(e,t=[]){let n=[];return m.Children.forEach(e,(e,r)=>{if(!m.isValidElement(e))return;let i=[...t,r];if(e.type===m.Fragment){n.push.apply(n,It(e.props.children,i));return}w(e.type===Nt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),w(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=It(e.props.children,i)),n.push(a)}),n}var Lt=`get`,Rt=`application/x-www-form-urlencoded`;function zt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Bt(e){return zt(e)&&e.tagName.toLowerCase()===`button`}function Vt(e){return zt(e)&&e.tagName.toLowerCase()===`form`}function Ht(e){return zt(e)&&e.tagName.toLowerCase()===`input`}function Ut(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wt(e,t){return e.button===0&&(!t||t===`_self`)&&!Ut(e)}function Gt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Kt(e,t){let n=Gt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var qt=null;function Jt(){if(qt===null)try{new FormData(document.createElement(`form`),0),qt=!1}catch{qt=!0}return qt}var Yt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Xt(e){return e!=null&&!Yt.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rt}"`),null):e}function Zt(e,t){let n,r,i,a,o;if(Vt(e)){let o=e.getAttribute(`action`);r=o?ve(o,t):null,n=e.getAttribute(`method`)||Lt,i=Xt(e.getAttribute(`enctype`))||Rt,a=new FormData(e)}else if(Bt(e)||Ht(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ve(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Lt,i=Xt(e.getAttribute(`formenctype`))||Xt(o.getAttribute(`enctype`))||Rt,a=new FormData(o,e),!Jt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(zt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Lt,r=null,i=Rt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Qt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},$t=/[&><\u2028\u2029]/g;function en(e){return e.replace($t,e=>Qt[e])}function tn(e,t){if(e===!1||e==null)throw Error(t)}function nn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ve(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function rn(e,t){if(e.id in t)return t[e.id];try{let n=await b(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function an(e){return e!=null&&typeof e.page==`string`}function on(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sn(e,t,n){return fn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(on).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ln(e,t,{includeHydrateFallback:n}={}){return un(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function un(e){return[...new Set(e)]}function dn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!an(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pn(){let e=m.useContext(Le);return tn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mn(){let e=m.useContext(Re);return tn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var hn=m.createContext(void 0);hn.displayName=`FrameworkContext`;function gn(){let e=m.useContext(hn);return tn(e,`You must render this element inside a <HydratedRouter> element`),e}function _n(e,t){let n=m.useContext(hn),[r,i]=m.useState(!1),[a,o]=m.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=m.useRef(null);m.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),m.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:vn(s,p),onBlur:vn(c,h),onMouseEnter:vn(l,p),onMouseLeave:vn(u,h),onTouchStart:vn(d,p)}]:[a,f,{}]:[!1,f,{}]}function vn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yn({page:e,...t}){let{router:n}=pn(),r=m.useMemo(()=>j(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(xn,{page:e,matches:r,...t}):null}function bn(e){let{manifest:t,routeModules:n}=gn(),[r,i]=m.useState([]);return m.useEffect(()=>{let r=!1;return sn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function xn({page:e,matches:t,...n}){let r=et(),{future:i,manifest:a,routeModules:o}=gn(),{basename:s}=pn(),{loaderData:c,matches:l}=mn(),u=m.useMemo(()=>cn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=m.useMemo(()=>cn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=nn(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=m.useMemo(()=>ln(d,a),[d,a]),h=bn(d);return m.createElement(m.Fragment,null,f.map(e=>m.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>m.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>m.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Sn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}m.Component;var Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Cn&&(window.__reactRouterVersion=`7.13.2`)}catch{}function wn({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=m.useRef();i.current??=C({window:r,v5Compat:!0});let a=i.current,[o,s]=m.useState({action:a.action,location:a.location}),c=m.useCallback(e=>{n===!1?s(e):m.startTransition(()=>s(e))},[n]);return m.useLayoutEffect(()=>a.listen(c),[a,c]),m.createElement(Pt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Tn({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=m.useState({action:n.action,location:n.location}),o=m.useCallback(e=>{r===!1?a(e):m.startTransition(()=>a(e))},[r]);return m.useLayoutEffect(()=>n.listen(o),[n,o]),m.createElement(Pt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Tn.displayName=`unstable_HistoryRouter`;var En=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn=m.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},h){let{basename:g,navigator:_,unstable_useTransitions:v}=m.useContext(Ue),y=typeof l==`string`&&En.test(l),b=Pe(l,g);l=b.to;let x=Qe(l,{relative:r}),S=et(),C=null;if(o){let e=Te(o,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:Ee([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=_n(n,p),D=Pn(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=m.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Sn(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?m.createElement(m.Fragment,null,A,m.createElement(yn,{page:x})):A});Dn.displayName=`Link`;var On=m.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ct(a,{relative:c.relative}),d=et(),f=m.useContext(Re),{navigator:p,basename:h}=m.useContext(Ue),g=f!=null&&Gn(u)&&o===!0,_=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=ve(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return m.createElement(Dn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});On.displayName=`NavLink`;var kn=m.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Lt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},h)=>{let{unstable_useTransitions:g}=m.useContext(Ue),_=Rn(),v=zn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&En.test(s);return m.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});g&&n!==!1?m.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});kn.displayName=`Form`;function An({getKey:e,storageKey:t,...n}){let r=m.useContext(hn),{basename:i}=m.useContext(Ue),a=et(),o=Tt();Un({getKey:e,storageKey:t});let s=m.useMemo(()=>{if(!r||!e)return null;let t=Hn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return m.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${en(JSON.stringify(t||Bn))}, ${en(JSON.stringify(s))})`}})}An.displayName=`ScrollRestoration`;function jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mn(e){let t=m.useContext(Le);return w(t,jn(e)),t}function Nn(e){let t=m.useContext(Re);return w(t,jn(e)),t}function Pn(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=rt(),d=et(),f=ct(e,{relative:o});return m.useCallback(p=>{if(Wt(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,h=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?m.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Fn(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(Gt(e)),n=m.useRef(!1),r=et(),i=m.useMemo(()=>Kt(r.search,n.current?null:t.current),[r.search]),a=rt();return[i,m.useCallback((e,t)=>{let r=Gt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var In=0,Ln=()=>`__${String(++In)}__`;function Rn(){let{router:e}=Mn(`useSubmit`),{basename:t}=m.useContext(Ue),n=Ct(),r=e.fetch,i=e.navigate;return m.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Zt(e,t);a.navigate===!1?await r(a.fetcherKey||Ln(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function zn(e,{relative:t}={}){let{basename:n}=m.useContext(Ue),r=m.useContext(Ge);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ct(e||`.`,{relative:t})},o=et();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ee([n,a.pathname])),k(a)}var Bn=`react-router-scroll-positions`,Vn={};function Hn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ve(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Un({getKey:e,storageKey:t}={}){let{router:n}=Mn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Nn(`useScrollRestoration`),{basename:a}=m.useContext(Ue),o=et(),s=Tt(),c=wt();m.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Wn(m.useCallback(()=>{if(c.state===`idle`){let t=Hn(o,s,a,e);Vn[t]=window.scrollY}try{sessionStorage.setItem(t||Bn,JSON.stringify(Vn))}catch(e){T(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(m.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Bn);e&&(Vn=JSON.parse(e))}catch{}},[t]),m.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Vn,()=>window.scrollY,e?(t,n)=>Hn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),m.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{T(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Wn(e,t){let{capture:n}=t||{};m.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Gn(e,{relative:t}={}){let n=m.useContext(Be);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Mn(`useViewTransitionState`),i=ct(e,{relative:t});if(!n.isTransitioning)return!1;let a=ve(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ve(n.nextLocation.pathname,r)||n.nextLocation.pathname;return he(i.pathname,o)!=null||he(i.pathname,a)!=null}var Kn=[];Kn.forEach,Kn.slice;var qn=[`__proto__`,`constructor`,`prototype`];function Jn(e){return!(typeof e!=`string`||e.length===0||e.length>128||qn.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function Yn(e){return!(!Jn(e)||e.indexOf(`/`)>-1)}function Xn(e){return Jn(e)}var Zn={lng:Yn,ns:Xn};function Qn(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function $n(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function er(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function tr(e){return!!e&&typeof e.then==`function`}function nr(e){return tr(e)?e:Promise.resolve(e)}var rr=/\{\{(.+?)\}\}/g;function ir(e,t){let n=!1,r=e.replace(rr,(e,r)=>{let i=r.trim();if(qn.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=Zn[i]||Yn,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var ar=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,or;typeof fetch==`function`?or=fetch:ar&&typeof ar.fetch==`function`&&(or=ar.fetch);var sr=er()&&ar?ar.XMLHttpRequest:void 0,cr=typeof ActiveXObject==`function`&&ar?ar.ActiveXObject:void 0,lr=[`__proto__`,`constructor`,`prototype`],ur=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))lr.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},dr=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):or(e,t).then(i).catch(n)},fr=(e,t,n,r)=>{e.queryStringParams&&(t=ur(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{dr(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),dr(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},pr=(e,t,n,r)=>{n&&typeof n==`object`&&(n=ur(``,n).slice(1)),e.queryStringParams&&(t=ur(t,e.queryStringParams));try{let i=sr?new sr:new cr(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))lr.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},mr=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),or&&t.indexOf(`file:`)!==0)return fr(e,t,n,r);if(er()||typeof ActiveXObject==`function`)return pr(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},hr=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:mr,reloadInterval:typeof window<`u`?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),gr=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...hr(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=nr(a),a.then(a=>{if(!a)return i(null,{});let o=ir(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(Qn).join(`, `),r=n.map(Qn).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=Qn($n(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+Qn(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=ir(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};gr.type=`backend`;var _r=`ar.bn.cs.da.de.el.en.es.fa.fi.fr.he.hi.id.it.ja.ko.ms.nl.no.pl.pt.ro.sv.th.tr.uk.vi.zh`.split(`.`);function vr(e){return _r.includes(e)}a.use(gr).use(i).init({ns:[`translation`],defaultNS:`translation`,fallbackLng:`en`,supportedLngs:[..._r],backend:{loadPath:`/messages/{{lng}}.json`},interpolation:{escapeValue:!1},initImmediate:!1});var yr=function(e,t){return yr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},yr(e,t)};function br(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);yr(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function xr(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Sr(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Cr(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function wr(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Tr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Er(e){return this instanceof Er?(this.v=e,this):new Er(e)}function Dr(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Er?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Or(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Cr==`function`?Cr(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function kr(e){return typeof e==`function`}function Ar(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var jr=Ar(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
5
5
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
6
6
|
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function Mr(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Nr=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Cr(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(kr(c))try{c()}catch(e){i=e instanceof jr?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Cr(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Ir(f)}catch(e){i??=[],e instanceof jr?i=Tr(Tr([],wr(i)),wr(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new jr(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)Ir(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Mr(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Mr(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),Pr=Nr.EMPTY;function Fr(e){return e instanceof Nr||e&&`closed`in e&&kr(e.remove)&&kr(e.add)&&kr(e.unsubscribe)}function Ir(e){kr(e)?e():e.unsubscribe()}var Lr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Rr={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Rr.delegate;return r?.setTimeout?r.setTimeout.apply(r,Tr([e,t],wr(n))):setTimeout.apply(void 0,Tr([e,t],wr(n)))},clearTimeout:function(e){return(Rr.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zr(e){Rr.setTimeout(function(){var t=Lr.onUnhandledError;if(t)t(e);else throw e})}function Br(){}var Vr=(function(){return Wr(`C`,void 0,void 0)})();function Hr(e){return Wr(`E`,void 0,e)}function Ur(e){return Wr(`N`,e,void 0)}function Wr(e,t,n){return{kind:e,value:t,error:n}}var Gr=null;function Kr(e){if(Lr.useDeprecatedSynchronousErrorHandling){var t=!Gr;if(t&&(Gr={errorThrown:!1,error:null}),e(),t){var n=Gr,r=n.errorThrown,i=n.error;if(Gr=null,r)throw i}}else e()}function qr(e){Lr.useDeprecatedSynchronousErrorHandling&&Gr&&(Gr.errorThrown=!0,Gr.error=e)}var Jr=function(e){br(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Fr(t)&&t.add(n)):n.destination=ni,n}return t.create=function(e,t,n){return new Qr(e,t,n)},t.prototype.next=function(e){this.isStopped?ti(Ur(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ti(Hr(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ti(Vr,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Nr),Yr=Function.prototype.bind;function Xr(e,t){return Yr.call(e,t)}var Zr=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){$r(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){$r(e)}else $r(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){$r(e)}},e}(),Qr=function(e){br(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(kr(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Lr.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Xr(t.next,o),error:t.error&&Xr(t.error,o),complete:t.complete&&Xr(t.complete,o)}):a=t}return i.destination=new Zr(a),i}return t}(Jr);function $r(e){Lr.useDeprecatedSynchronousErrorHandling?qr(e):zr(e)}function ei(e){throw e}function ti(e,t){var n=Lr.onStoppedNotification;n&&Rr.setTimeout(function(){return n(e,t)})}var ni={closed:!0,next:Br,error:ei,complete:Br},ri=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function ii(e){return e}function ai(e){return e.length===0?ii:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var oi=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=li(e)?e:new Qr(e,t,n);return Kr(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=si(t),new t(function(t,r){var i=new Qr({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[ri]=function(){return this},e.prototype.pipe=function(){return ai([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=si(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function si(e){return e??Lr.Promise??Promise}function ci(e){return e&&kr(e.next)&&kr(e.error)&&kr(e.complete)}function li(e){return e&&e instanceof Jr||ci(e)&&Fr(e)}function ui(e){return kr(e?.lift)}function di(e){return function(t){if(ui(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function fi(e,t,n,r,i){return new pi(e,t,n,r,i)}var pi=function(e){br(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Jr),mi=Ar(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),hi=function(e){br(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new gi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new mi},t.prototype.next=function(e){var t=this;Kr(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Cr(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Kr(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Kr(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,`observed`,{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?Pr:(this.currentObservers=null,a.push(e),new Nr(function(){t.currentObservers=null,Mr(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new oi;return e.source=this,e},t.create=function(e,t){return new gi(e,t)},t}(oi),gi=function(e){br(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??Pr},t}(hi),_i=function(e){br(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,`value`,{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(hi),vi={now:function(){return(vi.delegate||Date).now()},delegate:void 0},yi=function(e){br(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(Nr),bi={setInterval:function(e,t){var n=[...arguments].slice(2),r=bi.delegate;return r?.setInterval?r.setInterval.apply(r,Tr([e,t],wr(n))):setInterval.apply(void 0,Tr([e,t],wr(n)))},clearInterval:function(e){return(bi.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},xi=function(e){br(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),bi.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&bi.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Mr(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(yi),Si=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=vi.now,e}(),Ci=new(function(e){br(t,e);function t(t,n){n===void 0&&(n=Si.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(Si))(xi),wi=new oi(function(e){return e.complete()});function Ti(e){return e&&kr(e.schedule)}function Ei(e){return e[e.length-1]}function Di(e){return Ti(Ei(e))?e.pop():void 0}function Oi(e,t){return typeof Ei(e)==`number`?e.pop():t}var ki=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Ai(e){return kr(e?.then)}function ji(e){return kr(e[ri])}function Mi(e){return Symbol.asyncIterator&&kr(e?.[Symbol.asyncIterator])}function Ni(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Pi(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Fi=Pi();function Ii(e){return kr(e?.[Fi])}function Li(e){return Dr(this,arguments,function(){var t,n,r,i;return Sr(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Er(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,Er(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Er(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Ri(e){return kr(e?.getReader)}function zi(e){if(e instanceof oi)return e;if(e!=null){if(ji(e))return Bi(e);if(ki(e))return Vi(e);if(Ai(e))return Hi(e);if(Mi(e))return Wi(e);if(Ii(e))return Ui(e);if(Ri(e))return Gi(e)}throw Ni(e)}function Bi(e){return new oi(function(t){var n=e[ri]();if(kr(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Vi(e){return new oi(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Hi(e){return new oi(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,zr)})}function Ui(e){return new oi(function(t){var n,r;try{for(var i=Cr(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Wi(e){return new oi(function(t){Ki(e,t).catch(function(e){return t.error(e)})})}function Gi(e){return Wi(Li(e))}function Ki(e,t){var n,r,i,a;return xr(this,void 0,void 0,function(){var o,s;return Sr(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Or(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function qi(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function Ji(e,t){return t===void 0&&(t=0),di(function(n,r){n.subscribe(fi(r,function(n){return qi(r,e,function(){return r.next(n)},t)},function(){return qi(r,e,function(){return r.complete()},t)},function(n){return qi(r,e,function(){return r.error(n)},t)}))})}function Yi(e,t){return t===void 0&&(t=0),di(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Xi(e,t){return zi(e).pipe(Yi(t),Ji(t))}function Zi(e,t){return zi(e).pipe(Yi(t),Ji(t))}function Qi(e,t){return new oi(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function $i(e,t){return new oi(function(n){var r;return qi(n,t,function(){r=e[Fi](),qi(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return kr(r?.return)&&r.return()}})}function ea(e,t){if(!e)throw Error(`Iterable cannot be null`);return new oi(function(n){qi(n,t,function(){var r=e[Symbol.asyncIterator]();qi(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function ta(e,t){return ea(Li(e),t)}function na(e,t){if(e!=null){if(ji(e))return Xi(e,t);if(ki(e))return Qi(e,t);if(Ai(e))return Zi(e,t);if(Mi(e))return ea(e,t);if(Ii(e))return $i(e,t);if(Ri(e))return ta(e,t)}throw Ni(e)}function ra(e,t){return t?na(e,t):zi(e)}function ia(){var e=[...arguments];return ra(e,Di(e))}function aa(e,t){var n=kr(e)?e:function(){return e},r=function(e){return e.error(n())};return new oi(t?function(e){return t.schedule(r,0,e)}:r)}var oa=Ar(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function sa(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=!1,o;e.subscribe({next:function(e){o=e,a=!0},error:i,complete:function(){a?r(o):n?r(t.defaultValue):i(new oa)}})})}function ca(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new Qr({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new oa)}});e.subscribe(a)})}function la(e){return e instanceof Date&&!isNaN(e)}var ua=Ar(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function da(e,t){var n=la(e)?{first:e}:typeof e==`number`?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?fa:a,s=n.scheduler,c=s===void 0?t??Ci:s,l=n.meta,u=l===void 0?null:l;if(r==null&&i==null)throw TypeError(`No timeout provided.`);return di(function(e,t){var n,a,s=null,l=0,d=function(e){a=qi(t,c,function(){try{n.unsubscribe(),zi(o({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(fi(t,function(e){a?.unsubscribe(),l++,t.next(s=e),i>0&&d(i)},void 0,void 0,function(){a?.closed||a?.unsubscribe(),s=null})),!l&&d(r==null?i:typeof r==`number`?r:+r-c.now())})}function fa(e){throw new ua(e)}function pa(e,t){return di(function(n,r){var i=0;n.subscribe(fi(r,function(n){r.next(e.call(t,n,i++))}))})}function ma(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;zi(n(e,u++)).subscribe(fi(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?qi(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(fi(t,p,function(){d=!0,f()})),function(){s?.()}}function ha(e,t,n){return n===void 0&&(n=1/0),kr(t)?ha(function(n,r){return pa(function(e,i){return t(n,e,r,i)})(zi(e(n,r)))},n):(typeof t==`number`&&(n=t),di(function(t,r){return ma(t,r,e,n)}))}function ga(e){return e===void 0&&(e=1/0),ha(ii,e)}function _a(){return ga(1)}function va(){var e=[...arguments];return _a()(ra(e,Di(e)))}function ya(){var e=[...arguments],t=Di(e),n=Oi(e,1/0),r=e;return r.length?r.length===1?zi(r[0]):ga(n)(ra(r,t)):wi}function ba(e,t){return di(function(n,r){var i=0;n.subscribe(fi(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function xa(e){return di(function(t,n){var r=null,i=!1,a;r=t.subscribe(fi(n,void 0,void 0,function(o){a=zi(e(o,xa(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Sa(e,t){return t===void 0&&(t=Ci),di(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(fi(r,function(n){a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function Ca(e){return e<=0?function(){return wi}:di(function(t,n){var r=0;t.subscribe(fi(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function wa(e,t){return t===void 0&&(t=ii),e??=Ta,di(function(n,r){var i,a=!0;n.subscribe(fi(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function Ta(e,t){return e===t}function Ea(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new hi}:t,r=e.resetOnError,i=r===void 0?!0:r,a=e.resetOnComplete,o=a===void 0?!0:a,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(e){var t,r,a,s=0,l=!1,u=!1,d=function(){r?.unsubscribe(),r=void 0},f=function(){d(),t=a=void 0,l=u=!1},p=function(){var e=t;f(),e?.unsubscribe()};return di(function(e,m){s++,!u&&!l&&d();var h=a??=n();m.add(function(){s--,s===0&&!u&&!l&&(r=Da(p,c))}),h.subscribe(m),!t&&s>0&&(t=new Qr({next:function(e){return h.next(e)},error:function(e){u=!0,d(),r=Da(f,i,e),h.error(e)},complete:function(){l=!0,d(),r=Da(f,o),h.complete()}}),zi(e).subscribe(t))})(e)}}function Da(e,t){var n=[...arguments].slice(2);if(t===!0){e();return}if(t!==!1){var r=new Qr({next:function(){r.unsubscribe(),e()}});return zi(t.apply(void 0,Tr([],wr(n)))).subscribe(r)}}function Oa(){var e=[...arguments],t=Di(e);return di(function(n,r){(t?va(e,n,t):va(e,n)).subscribe(r)})}function ka(e,t){return di(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(fi(r,function(n){i?.unsubscribe();var o=0,c=a++;zi(e(n,c)).subscribe(i=fi(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Aa(e){return di(function(t,n){zi(e).subscribe(fi(n,function(){return n.complete()},Br)),!n.closed&&t.subscribe(n)})}var P=c();function ja(e){return e}function Ma(e){return e}function Na(e){return e}function Pa(e){return e}function Fa(e){return e}function Ia(e){return e}function La(e){return e}function Ra(e){if(e.includes(`/`))throw TypeError(`Expected ResourceId, got URI: ${e}`);return e}function za(e){if(e.includes(`/`))throw TypeError(`Expected AnnotationId, got URI: ${e}`);return e}var Ba=[`yield:created`,`yield:cloned`,`yield:updated`,`yield:moved`,`yield:representation-added`,`yield:representation-removed`,`mark:added`,`mark:removed`,`mark:body-updated`,`mark:archived`,`mark:unarchived`,`mark:entity-tag-added`,`mark:entity-tag-removed`,`frame:entity-type-added`,`frame:tag-schema-added`,`job:started`,`job:progress`,`job:completed`,`job:failed`],Va=[`job:complete`,`job:fail`];function Ha(e){let t=e.payload;if(e.type===`mark:added`)return t?.annotation?.id||null;if((e.type===`mark:removed`||e.type===`mark:body-updated`)&&t?.annotationId&&e.resourceId)try{let n=e.resourceId;return`${n.substring(0,n.lastIndexOf(`/resources/`))}/annotations/${t.annotationId}`}catch{return null}return null}var Ua=typeof process<`u`&&!!{}?.SEMIONT_BUS_LOG;function Wa(){return globalThis.__SEMIONT_BUS_LOG__?!0:Ua}var Ga;function Ka(e){Ga=e}function qa(e,t,n,r){if(!Wa())return;let i=n?.correlationId,a=typeof i==`string`?i.slice(0,8):void 0,o;if(Ga)try{o=Ga()}catch{}let s=`[bus ${e}] ${t}`+(r?` scope=${r}`:``)+(a?` cid=${a}`:``)+(o?` trace=${o.slice(0,8)}`:``);console.debug(s,n)}var Ja=class{subjects;isDestroyed;constructor(){this.subjects=new Map,this.isDestroyed=!1}get(e){if(this.isDestroyed)throw Error(`Cannot access event '${String(e)}' on destroyed bus`);if(!this.subjects.has(e)){let t=new hi;if(Wa()){let n=t.next.bind(t);t.next=t=>{qa(`EMIT`,String(e),t),n(t)}}this.subjects.set(e,t)}return this.subjects.get(e)}getDomainEvent(e){return this.get(e)}destroy(){if(!this.isDestroyed){for(let e of this.subjects.values())e.complete();this.subjects.clear(),this.isDestroyed=!0}}get destroyed(){return this.isDestroyed}scope(e){return new Ya(this,e)}},Ya=class e{constructor(e,t){this.parent=e,this.scopePrefix=t}get(e){let t=`${this.scopePrefix}:${e}`,n=this.parent.subjects;return n.has(t)||n.set(t,new hi),n.get(t)}getDomainEvent(e){return this.get(e)}scope(t){return new e(this.parent,`${this.scopePrefix}:${t}`)}};function Xa(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextPositionSelector`);return t&&t.type===`TextPositionSelector`?t:null}function Za(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`SvgSelector`);return t&&t.type===`SvgSelector`?t:null}function Qa(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`FragmentSelector`);return t&&t.type===`FragmentSelector`?t:null}function $a(e){if(Array.isArray(e)){for(let t of e)if(typeof t==`object`&&t&&`type`in t&&`source`in t){let e=t.type,n=t.source;if(e===`SpecificResource`&&typeof n==`string`)return n}return null}if(typeof e==`object`&&e&&`type`in e&&`source`in e){let t=e.type,n=e.source;if(t===`SpecificResource`&&typeof n==`string`)return n}return null}function eo(e){return $a(e)!==null}function to(e){if(typeof e!=`string`)return e.selector}function no(e){return e.motivation===`highlighting`}function ro(e){return e.motivation===`linking`}function io(e){return e.motivation===`assessing`}function ao(e){return e.motivation===`commenting`}function oo(e){return e.motivation===`tagging`}function so(e){if(!ao(e))return;let t=Array.isArray(e.body)?e.body[0]:e.body;if(t&&`value`in t)return t.value}function co(e){return ro(e)&&eo(e.body)}function lo(e){if(!e)return``;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t?t.exact:``}function uo(e){return lo(to(e.target))}function fo(e){let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t&&t.type===`TextQuoteSelector`?t:null}function po(e){if(e)return e[`@id`]||void 0}function mo(e){if(e?.representations)return(Array.isArray(e.representations)?e.representations:[e.representations])[0]}function ho(e){return mo(e)?.mediaType}function go(e){return mo(e)?.language}var _o=`browse:resources-result.browse:resources-failed.browse:resource-result.browse:resource-failed.browse:annotations-result.browse:annotations-failed.browse:annotation-result.browse:annotation-failed.browse:annotation-history-result.browse:annotation-history-failed.browse:events-result.browse:events-failed.browse:referenced-by-result.browse:referenced-by-failed.browse:entity-types-result.browse:entity-types-failed.browse:tag-schemas-result.browse:tag-schemas-failed.browse:directory-result.browse:directory-failed.browse:annotation-context-result.browse:annotation-context-failed.mark:delete-ok.mark:delete-failed.mark:create-ok.mark:create-failed.match:search-results.match:search-failed.gather:complete.gather:failed.gather:annotation-progress.gather:annotation-finished.gather:summary-result.gather:summary-failed.bind:body-updated.bind:body-update-failed.job:report-progress.job:complete.job:fail.job:status-result.job:status-failed.job:created.job:create-failed.job:claimed.job:claim-failed.yield:create-ok.yield:create-failed.yield:update-ok.yield:update-failed.yield:clone-token-generated.yield:clone-token-failed.yield:clone-resource-result.yield:clone-resource-failed.yield:clone-created.yield:clone-create-failed.frame:entity-type-added.frame:tag-schema-added.beckon:focus.beckon:sparkle.bus:resume-gap`.split(`.`);function vo(e){return e.replace(/\s+/g,` `).replace(/[\u2018\u2019]/g,`'`).replace(/[\u201C\u201D]/g,`"`).replace(/\u2014/g,`--`).replace(/\u2013/g,`-`).trim()}function yo(e,t){let n=e.length,r=t.length,i=[];for(let e=0;e<=n;e++)i[e]=[e];for(let e=0;e<=r;e++)i[0][e]=e;for(let a=1;a<=n;a++)for(let n=1;n<=r;n++){let r=e[a-1]===t[n-1]?0:1,o=i[a-1][n]+1,s=i[a][n-1]+1,c=i[a-1][n-1]+r;i[a][n]=Math.min(o,s,c)}return i[n][r]}function bo(e){return{normalizedContent:vo(e),lowerContent:e.toLowerCase()}}function xo(e,t,n,r){let i=Math.max(5,Math.floor(t.length*.05)),a=e.indexOf(t);if(a!==-1)return{start:a,end:a+t.length,matchQuality:`exact`};let o=vo(t),s=r.normalizedContent.indexOf(o);if(s!==-1){let n=0,r=0;for(;r<s&&n<e.length;){let t=e[n],i=vo(t);i&&(r+=i.length),n++}return{start:n,end:n+t.length,matchQuality:`normalized`}}let c=t.toLowerCase(),l=r.lowerContent.indexOf(c);if(l!==-1)return{start:l,end:l+t.length,matchQuality:`case-insensitive`};let u=t.length,d=Math.min(500,e.length),f=n===void 0?0:Math.max(0,n-d),p=n===void 0?e.length:Math.min(e.length,n+d),m=null;for(let n=f;n<=p-u;n++){let r=yo(t,e.substring(n,n+u));r<=i&&(!m||r<m.distance)&&(m={start:n,distance:r})}return m?{start:m.start,end:m.start+u,matchQuality:`fuzzy`}:null}function So(e,t,n,r,i,a){if(!t)return null;if(i!==void 0&&i>=0&&i+t.length<=e.length&&e.substring(i,i+t.length)===t)return{start:i,end:i+t.length};let o=[],s=e.indexOf(t);for(;s!==-1;)o.push(s),s=e.indexOf(t,s+1);if(o.length===0){let n=xo(e,t,i,a);return n?{start:n.start,end:n.end}:null}if(o.length===1){let e=o[0];return{start:e,end:e+t.length}}if(n||r){for(let i of o){let a=Math.max(0,i-(n?.length||0)),o=e.substring(a,i),s=Math.min(e.length,i+t.length+(r?.length||0)),c=e.substring(i+t.length,s),l=!n||o.endsWith(n),u=!r||c.startsWith(r);if(l&&u)return{start:i,end:i+t.length}}for(let i of o){let a=e.substring(Math.max(0,i-(n?.length||0)),i),o=e.substring(i+t.length,i+t.length+(r?.length||0)),s=!n||a.includes(n.trim()),c=!r||o.includes(r.trim());if(s&&c)return{start:i,end:i+t.length}}}let c=o[0];return{start:c,end:c+t.length}}var Co=[{code:`ar`,nativeName:`العربية`,englishName:`Arabic`},{code:`bn`,nativeName:`বাংলা`,englishName:`Bengali`},{code:`cs`,nativeName:`Čeština`,englishName:`Czech`},{code:`da`,nativeName:`Dansk`,englishName:`Danish`},{code:`de`,nativeName:`Deutsch`,englishName:`German`},{code:`el`,nativeName:`Ελληνικά`,englishName:`Greek`},{code:`en`,nativeName:`English`,englishName:`English`},{code:`es`,nativeName:`Español`,englishName:`Spanish`},{code:`fa`,nativeName:`فارسی`,englishName:`Persian`},{code:`fi`,nativeName:`Suomi`,englishName:`Finnish`},{code:`fr`,nativeName:`Français`,englishName:`French`},{code:`he`,nativeName:`עברית`,englishName:`Hebrew`},{code:`hi`,nativeName:`हिन्दी`,englishName:`Hindi`},{code:`id`,nativeName:`Bahasa Indonesia`,englishName:`Indonesian`},{code:`it`,nativeName:`Italiano`,englishName:`Italian`},{code:`ja`,nativeName:`日本語`,englishName:`Japanese`},{code:`ko`,nativeName:`한국어`,englishName:`Korean`},{code:`ms`,nativeName:`Bahasa Melayu`,englishName:`Malay`},{code:`nl`,nativeName:`Nederlands`,englishName:`Dutch`},{code:`no`,nativeName:`Norsk`,englishName:`Norwegian`},{code:`pl`,nativeName:`Polski`,englishName:`Polish`},{code:`pt`,nativeName:`Português`,englishName:`Portuguese`},{code:`ro`,nativeName:`Română`,englishName:`Romanian`},{code:`sv`,nativeName:`Svenska`,englishName:`Swedish`},{code:`th`,nativeName:`ไทย`,englishName:`Thai`},{code:`tr`,nativeName:`Türkçe`,englishName:`Turkish`},{code:`uk`,nativeName:`Українська`,englishName:`Ukrainian`},{code:`vi`,nativeName:`Tiếng Việt`,englishName:`Vietnamese`},{code:`zh`,nativeName:`中文`,englishName:`Chinese`}],wo=new Map(Co.map(e=>[e.code.toLowerCase(),e]));function To(e){if(e)return wo.get(e.toLowerCase())}function Eo(e){if(!e)return;let t=To(e);return t?`${t.nativeName} (${e.toLowerCase()})`:e}function Do(e,t){return`<svg xmlns="http://www.w3.org/2000/svg"><rect x="${Math.min(e.x,t.x)}" y="${Math.min(e.y,t.y)}" width="${Math.abs(t.x-e.x)}" height="${Math.abs(t.y-e.y)}"/></svg>`}function Oo(e){if(e.length<3)throw Error(`Polygon requires at least 3 points`);return`<svg xmlns="http://www.w3.org/2000/svg"><polygon points="${e.map(e=>`${e.x},${e.y}`).join(` `)}"/></svg>`}function ko(e,t){if(t<=0)throw Error(`Circle radius must be positive`);return`<svg xmlns="http://www.w3.org/2000/svg"><circle cx="${e.x}" cy="${e.y}" r="${t}"/></svg>`}function Ao(e){let t=e.match(/<rect\s+([^>]+)\/>/);if(t&&t[1]){let e=t[1];return{type:`rect`,data:{x:parseFloat(e.match(/x="([^"]+)"/)?.[1]||`0`),y:parseFloat(e.match(/y="([^"]+)"/)?.[1]||`0`),width:parseFloat(e.match(/width="([^"]+)"/)?.[1]||`0`),height:parseFloat(e.match(/height="([^"]+)"/)?.[1]||`0`)}}}let n=e.match(/<polygon\s+points="([^"]+)"/);if(n&&n[1])return{type:`polygon`,data:{points:n[1].split(/\s+/).map(e=>{let[t,n]=e.split(`,`).map(parseFloat);return{x:t,y:n}})}};let r=e.match(/<circle\s+([^>]+)\/>/);if(r&&r[1]){let e=r[1];return{type:`circle`,data:{cx:parseFloat(e.match(/cx="([^"]+)"/)?.[1]||`0`),cy:parseFloat(e.match(/cy="([^"]+)"/)?.[1]||`0`),r:parseFloat(e.match(/r="([^"]+)"/)?.[1]||`0`)}}}return null}function jo(e,t,n,r,i){let a=Ao(e);if(!a)return e;let o=r/t,s=i/n;switch(a.type){case`rect`:{let{x:e,y:t,width:n,height:r}=a.data;return Do({x:e*o,y:t*s},{x:(e+n)*o,y:(t+r)*s})}case`circle`:{let{cx:e,cy:t,r:n}=a.data;return ko({x:e*o,y:t*s},n*Math.min(o,s))}case`polygon`:return Oo(a.data.points.map(e=>({x:e.x*o,y:e.y*s})))}return e}function Mo(e,t,n){let r;if(t>0){let n=Math.max(0,t-64),i=0;for(;n>0&&i<32;){let t=e[n-1];if(!t||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(t))break;n--,i++}r=e.substring(n,t)}let i;if(n<e.length){let t=Math.min(e.length,n+64),r=0;for(;t<e.length&&r<32;){let n=e[t];if(!n||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(n))break;t++,r++}i=e.substring(n,t)}return{prefix:r,suffix:i}}function No(e){return(e.match(/charset=([^\s;]+)/i)?.[1]||`utf-8`).toLowerCase()}function Po(e,t){let n=No(t);return new TextDecoder(n).decode(e)}function Fo(e){return e===`image/png`||e===`image/jpeg`}function Io(e){return e===`text/plain`||e===`text/markdown`}function Lo(e){return e===`application/pdf`}function Ro(e){return Io(e)?`text`:Fo(e)||Lo(e)?`image`:`unsupported`}var zo=class extends Error{constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`SemiontError`,Error.captureStackTrace(this,this.constructor)}},Bo=class extends Error{response;request;options;constructor(e,t,n){let r=`${e.status||e.status===0?e.status:``} ${e.statusText??``}`.trim(),i=r?`status code ${r}`:`an unknown error`;super(`Request failed with ${i}: ${t.method} ${t.url}`),this.name=`HTTPError`,this.response=e,this.request=t,this.options=n}},Vo=class extends Error{name=`NonError`;value;constructor(e){let t=`Non-error value was thrown`;try{typeof e==`string`?t=e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&(t=e.message)}catch{}super(t),this.value=e}},Ho=class extends Error{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new Vo(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:`Forced retry`,t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},Uo=(()=>{let e=!1,t=!1,n=typeof globalThis.ReadableStream==`function`,r=typeof globalThis.Request==`function`;if(n&&r)try{t=new globalThis.Request(`https://empty.invalid`,{body:new globalThis.ReadableStream,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`)}catch(e){if(e instanceof Error&&e.message===`unsupported BodyInit type`)return!1;throw e}return e&&!t})(),Wo=typeof globalThis.AbortController==`function`,Go=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,Ko=typeof globalThis.ReadableStream==`function`,qo=typeof globalThis.FormData==`function`,Jo=[`get`,`post`,`put`,`patch`,`head`,`delete`],Yo={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},Xo=2147483647,Zo=new TextEncoder().encode(`------WebKitFormBoundaryaxpyiPgbbPti10Rw`).length,Qo=Symbol(`stop`),$o=class{options;constructor(e){this.options=e}},es=e=>new $o(e),ts={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ns={next:!0},rs={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},is=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=Zo,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,t+=typeof r==`string`?new TextEncoder().encode(r).length:r.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e==`string`)return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if(`byteLength`in e)return e.byteLength;if(typeof e==`object`&&e)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},as=(e,t,n)=>{let r,i=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),r){i+=r.byteLength;let e=t===0?0:i/t;e>=1&&(e=1-2**-52),n?.({percent:e,totalBytes:Math.max(t,i),transferredBytes:i},r)}r=e},flush(){r&&(i+=r.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},r))}}))},os=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let n=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(as(e.body,n,t),{status:e.status,statusText:e.statusText,headers:e.headers})},ss=(e,t,n)=>{if(!e.body)return e;let r=is(n??e.body);return new Request(e,{duplex:`half`,body:as(e.body,r,t)})},cs=e=>typeof e==`object`&&!!e,ls=(...e)=>{for(let t of e)if((!cs(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return ms({},...e)},us=(e={},t={})=>{let n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[e,t]of i.entries())r&&t===`undefined`||t===void 0?n.delete(e):n.set(e,t);return n};function ds(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:ms(e[n]??[],t[n]??[])}var fs=(e={},t={})=>({beforeRequest:ds(e,t,`beforeRequest`),beforeRetry:ds(e,t,`beforeRetry`),afterResponse:ds(e,t,`afterResponse`),beforeError:ds(e,t,`beforeError`)}),ps=(e,t)=>{let n=new URLSearchParams;for(let r of[e,t])if(r!==void 0)if(r instanceof URLSearchParams)for(let[e,t]of r.entries())n.append(e,t);else if(Array.isArray(r))for(let e of r){if(!Array.isArray(e)||e.length!==2)throw TypeError(`Array search parameters must be provided in [[key, value], ...] format`);n.append(String(e[0]),String(e[1]))}else if(cs(r))for(let[e,t]of Object.entries(r))t!==void 0&&n.append(e,String(t));else{let e=new URLSearchParams(r);for(let[t,r]of e.entries())n.append(t,r)}return n},ms=(...e)=>{let t={},n={},r={},i,a=[];for(let o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(cs(o)){for(let[e,n]of Object.entries(o)){if(e===`signal`&&n instanceof globalThis.AbortSignal){a.push(n);continue}if(e===`context`){if(n!=null&&(!cs(n)||Array.isArray(n)))throw TypeError("The `context` option must be an object");t={...t,context:n==null?{}:{...t.context,...n}};continue}if(e===`searchParams`){i=n==null?void 0:i===void 0?n:ps(i,n);continue}cs(n)&&e in t&&(n=ms(t[e],n)),t={...t,[e]:n}}cs(o.hooks)&&(r=fs(r,o.hooks),t.hooks=r),cs(o.headers)&&(n=us(n,o.headers),t.headers=n)}return i!==void 0&&(t.searchParams=i),a.length>0&&(a.length===1?t.signal=a[0]:Go?t.signal=AbortSignal.any(a):t.signal=a.at(-1)),t},hs=e=>Jo.includes(e)?e.toUpperCase():e,gs={limit:2,methods:[`get`,`put`,`head`,`delete`,`options`,`trace`],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},_s=(e={})=>{if(typeof e==`number`)return{...gs,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error(`retry.methods must be an array`);if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw Error(`retry.statusCodes must be an array`);let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));return{...gs,...t}},vs=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name=`TimeoutError`,this.request=e}};async function ys(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new vs(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function bs(e,{signal:t}){return new Promise((n,r)=>{t&&(t.throwIfAborted(),t.addEventListener(`abort`,i,{once:!0}));function i(){clearTimeout(a),r(t.reason)}let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e)})}var xs=(e,t)=>{let n={};for(let r in t)Object.hasOwn(t,r)&&!(r in rs)&&!(r in ts)&&(!(r in e)||r in ns)&&(n[r]=t[r]);return n},Ss=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e;function Cs(e){return e instanceof Bo||e?.name===Bo.name}function ws(e){return e instanceof vs||e?.name===vs.name}var Ts=class e{static create(t,n){let r=new e(t,n),i=r.#p(async()=>{if(typeof r.#i.timeout==`number`&&r.#i.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${Xo}`);await Promise.resolve();let e=await r.#m();for(let t of r.#i.hooks.afterResponse){let n=r.#u(e.clone()),i;try{i=await t(r.request,r.#h(),n,{retryCount:r.#n})}catch(t){throw r.#f(n),r.#f(e),t}if(i instanceof $o)throw r.#f(n),r.#f(e),new Ho(i.options);let a=i instanceof globalThis.Response?i:e;n!==a&&r.#f(n),e!==a&&r.#f(e),e=a}if(r.#u(e),!e.ok&&(typeof r.#i.throwHttpErrors==`function`?r.#i.throwHttpErrors(e.status):r.#i.throwHttpErrors)){let t=new Bo(e,r.request,r.#h());for(let e of r.#i.hooks.beforeError)t=await e(t,{retryCount:r.#n});throw t}if(r.#i.onDownloadProgress){if(typeof r.#i.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!Ko)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let t=e.clone();return r.#f(e),os(t,r.#i.onDownloadProgress)}return e}).finally(()=>{let e=r.#a;r.#d(e?.body??void 0),r.#d(r.request.body??void 0)});for(let[e,t]of Object.entries(Yo))e===`bytes`&&typeof globalThis.Response?.prototype?.bytes!=`function`||(i[e]=async()=>{r.request.headers.set(`accept`,r.request.headers.get(`accept`)||t);let a=await i;if(e===`json`){if(a.status===204)return``;let e=await a.text();return e===``?``:n.parseJson?n.parseJson(e):JSON.parse(e)}return a[e]()});return i}static#e(e){return e&&typeof e==`object`&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)):e}request;#t;#n=0;#r;#i;#a;#o;#s;constructor(t,n={}){if(this.#r=t,this.#i={...n,headers:us(this.#r.headers,n.headers),hooks:fs({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:hs(n.method??this.#r.method??`GET`),prefixUrl:String(n.prefixUrl||``),retry:_s(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#r!=`string`&&!(this.#r instanceof URL||this.#r instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this.#i.prefixUrl&&typeof this.#r==`string`){if(this.#r.startsWith(`/`))throw Error("`input` must not begin with a slash when using `prefixUrl`");this.#i.prefixUrl.endsWith(`/`)||(this.#i.prefixUrl+=`/`),this.#r=this.#i.prefixUrl+this.#r}Wo&&Go&&(this.#o=this.#i.signal??this.#r.signal,this.#t=new globalThis.AbortController,this.#i.signal=this.#o?AbortSignal.any([this.#o,this.#t.signal]):this.#t.signal),Uo&&(this.#i.duplex=`half`),this.#i.json!==void 0&&(this.#i.body=this.#i.stringifyJson?.(this.#i.json)??JSON.stringify(this.#i.json),this.#i.headers.set(`content-type`,this.#i.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#r instanceof globalThis.Request&&(qo&&this.#i.body instanceof globalThis.FormData||this.#i.body instanceof URLSearchParams)&&!r&&this.#i.headers.delete(`content-type`),this.request=new globalThis.Request(this.#r,this.#i),Ss(this.#i.searchParams)){let t=`?`+(typeof this.#i.searchParams==`string`?this.#i.searchParams.replace(/^\?/,``):new URLSearchParams(e.#e(this.#i.searchParams)).toString()),n=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(n,this.#i)}if(this.#i.onUploadProgress){if(typeof this.#i.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");if(!Uo)throw Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#_(this.request,this.#i.body??void 0)}}#c(){let e=this.#i.retry.delay(this.#n),t=e;this.#i.retry.jitter===!0?t=Math.random()*e:typeof this.#i.retry.jitter==`function`&&(t=this.#i.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));let n=this.#i.retry.backoffLimit??1/0;return Math.min(n,t)}async#l(e){if(this.#n++,this.#n>this.#i.retry.limit)throw e;let t=e instanceof Error?e:new Vo(e);if(t instanceof Ho)return t.customDelay??this.#c();if(!this.#i.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#i.retry.shouldRetry!==void 0){let n=await this.#i.retry.shouldRetry({error:t,retryCount:this.#n});if(n===!1)throw e;if(n===!0)return this.#c()}if(ws(e)&&!this.#i.retry.retryOnTimeout)throw e;if(Cs(e)){if(!this.#i.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get(`Retry-After`)??e.response.headers.get(`RateLimit-Reset`)??e.response.headers.get(`X-RateLimit-Retry-After`)??e.response.headers.get(`X-RateLimit-Reset`)??e.response.headers.get(`X-Rate-Limit-Reset`);if(t&&this.#i.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t)*1e3;Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse(`2024-01-01`)&&(e-=Date.now());let n=this.#i.retry.maxRetryAfter??e;return e<n?e:n}if(e.response.status===413)throw e}return this.#c()}#u(e){return this.#i.parseJson&&(e.json=async()=>this.#i.parseJson(await e.text())),e}#d(e){e&&e.cancel().catch(()=>void 0)}#f(e){this.#d(e.body??void 0)}async#p(e){try{return await e()}catch(t){let n=Math.min(await this.#l(t),Xo);if(this.#n<1)throw t;if(await bs(n,this.#o?{signal:this.#o}:{}),t instanceof Ho&&t.customRequest){let e=this.#i.signal?new globalThis.Request(t.customRequest,{signal:this.#i.signal}):new globalThis.Request(t.customRequest);this.#g(e)}for(let e of this.#i.hooks.beforeRetry){let n=await e({request:this.request,options:this.#h(),error:t,retryCount:this.#n});if(n instanceof globalThis.Request){this.#g(n);break}if(n instanceof globalThis.Response)return n;if(n===Qo)return}return this.#p(e)}}async#m(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#i.signal=this.#o?AbortSignal.any([this.#o,this.#t.signal]):this.#t.signal,this.request=new globalThis.Request(this.request,{signal:this.#i.signal}));for(let e of this.#i.hooks.beforeRequest){let t=await e(this.request,this.#h(),{retryCount:this.#n});if(t instanceof Response)return t;if(t instanceof globalThis.Request){this.#g(t);break}}let e=xs(this.request,this.#i);return this.#a=this.request,this.request=this.#a.clone(),this.#i.timeout===!1?this.#i.fetch(this.#a,e):ys(this.#a,e,this.#t,this.#i)}#h(){if(!this.#s){let{hooks:e,...t}=this.#i;this.#s=Object.freeze(t)}return this.#s}#g(e){this.#s=void 0,this.request=this.#_(e)}#_(e,t){return!this.#i.onUploadProgress||!e.body?e:ss(e,this.#i.onUploadProgress,t??this.#i.body??void 0)}},Es=e=>{let t=(t,n)=>Ts.create(t,ls(e,n));for(let n of Jo)t[n]=(t,r)=>Ts.create(t,ls(e,r,{method:n}));return t.create=e=>Es(ls(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),Es(ls(e,t))),t.stop=Qo,t.retry=es,t},Ds=Es(),Os=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},ks=`1.9.0`,As=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function js(e){var t=new Set([e]),n=new Set,r=e.match(As);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(As);if(!r)return a(e);var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var Ms=js(ks),Ns=ks.split(`.`)[0],Ps=Symbol.for(`opentelemetry.js.api.`+Ns),Fs=Os;function Is(e,t,n,r){r===void 0&&(r=!1);var i=Fs[Ps]=Fs[Ps]??{version:ks};if(!r&&i[e]){var a=Error(`@opentelemetry/api: Attempted duplicate registration of API: `+e);return n.error(a.stack||a.message),!1}if(i.version!==`1.9.0`){var a=Error(`@opentelemetry/api: Registration of version v`+i.version+` for `+e+` does not match previously registered API v`+ks);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for `+e+` v`+ks+`.`),!0}function Ls(e){var t=Fs[Ps]?.version;if(!(!t||!Ms(t)))return Fs[Ps]?.[e]}function Rs(e,t){t.debug(`@opentelemetry/api: Unregistering a global for `+e+` v`+ks+`.`);var n=Fs[Ps];n&&delete n[e]}var zs=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Bs=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Vs=function(){function e(e){this._namespace=e.namespace||`DiagComponentLogger`}return e.prototype.debug=function(){var e=[...arguments];return Hs(`debug`,this._namespace,e)},e.prototype.error=function(){var e=[...arguments];return Hs(`error`,this._namespace,e)},e.prototype.info=function(){var e=[...arguments];return Hs(`info`,this._namespace,e)},e.prototype.warn=function(){var e=[...arguments];return Hs(`warn`,this._namespace,e)},e.prototype.verbose=function(){var e=[...arguments];return Hs(`verbose`,this._namespace,e)},e}();function Hs(e,t,n){var r=Ls(`diag`);if(r)return n.unshift(t),r[e].apply(r,Bs([],zs(n),!1))}var Us;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(Us||={});function Ws(e,t){e<Us.NONE?e=Us.NONE:e>Us.ALL&&(e=Us.ALL),t||={};function n(n,r){var i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Us.ERROR),warn:n(`warn`,Us.WARN),info:n(`info`,Us.INFO),debug:n(`debug`,Us.DEBUG),verbose:n(`verbose`,Us.VERBOSE)}}var Gs=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ks=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},qs=`diag`,Js=function(){function e(){function e(e){return function(){var t=[...arguments],n=Ls(`diag`);if(n)return n[e].apply(n,Ks([],Gs(t),!1))}}var t=this;t.setLogger=function(e,n){if(n===void 0&&(n={logLevel:Us.INFO}),e===t){var r=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(r.stack??r.message),!1}typeof n==`number`&&(n={logLevel:n});var i=Ls(`diag`),a=Ws(n.logLevel??Us.INFO,e);if(i&&!n.suppressOverrideMessage){var o=Error().stack??`<failed to generate stacktrace>`;i.warn(`Current logger will be overwritten from `+o),a.warn(`Current logger will overwrite one already registered from `+o)}return Is(`diag`,a,t,!0)},t.disable=function(){Rs(qs,t)},t.createComponentLogger=function(e){return new Vs(e)},t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}return e.instance=function(){return this._instance||=new e,this._instance},e}(),Ys=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Xs=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Zs=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Ys(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=Xs(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}(),Qs=Symbol(`BaggageEntryMetadata`),$s=Js.instance();function ec(e){return e===void 0&&(e={}),new Zs(new Map(Object.entries(e)))}function tc(e){return typeof e!=`string`&&($s.error(`Cannot create baggage metadata from unknown type: `+typeof e),e=``),{__TYPE__:Qs,toString:function(){return e}}}function nc(e){return Symbol.for(e)}var rc=new(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}}return e}()),ic=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ac=function(){function e(){}return e.prototype.createGauge=function(e,t){return _c},e.prototype.createHistogram=function(e,t){return vc},e.prototype.createCounter=function(e,t){return gc},e.prototype.createUpDownCounter=function(e,t){return yc},e.prototype.createObservableGauge=function(e,t){return xc},e.prototype.createObservableCounter=function(e,t){return bc},e.prototype.createObservableUpDownCounter=function(e,t){return Sc},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),oc=function(){function e(){}return e}(),sc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(oc),cc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(oc),lc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(oc),uc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(oc),dc=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),fc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(dc),pc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(dc),mc=function(e){ic(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(dc),hc=new ac,gc=new sc,_c=new lc,vc=new uc,yc=new cc,bc=new fc,xc=new pc,Sc=new mc;function Cc(){return hc}var wc={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},Tc={set:function(e,t,n){e!=null&&(e[t]=n)}},Ec=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Dc=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Oc=function(){function e(){}return e.prototype.active=function(){return rc},e.prototype.with=function(e,t,n){var r=[...arguments].slice(3);return t.call.apply(t,Dc([n],Ec(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),kc=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ac=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},jc=`context`,Mc=new Oc,Nc=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalContextManager=function(e){return Is(jc,e,Js.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,Ac([e,t,n],kc(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Ls(jc)||Mc},e.prototype.disable=function(){this._getContextManager().disable(),Rs(jc,Js.instance())},e}(),Pc;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Pc||={});var Fc={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Pc.NONE},Ic=function(){function e(e){e===void 0&&(e=Fc),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),Lc=nc(`OpenTelemetry Context Key SPAN`);function Rc(e){return e.getValue(Lc)||void 0}function zc(){return Rc(Nc.getInstance().active())}function Bc(e,t){return e.setValue(Lc,t)}function Vc(e){return e.deleteValue(Lc)}function Hc(e,t){return Bc(e,new Ic(t))}function Uc(e){return Rc(e)?.spanContext()}var Wc=/^([0-9a-f]{32})$/i,Gc=/^[0-9a-f]{16}$/i;function Kc(e){return Wc.test(e)&&e!==`00000000000000000000000000000000`}function qc(e){return Gc.test(e)&&e!==`0000000000000000`}function Jc(e){return Kc(e.traceId)&&qc(e.spanId)}function Yc(e){return new Ic(e)}var Xc=Nc.getInstance(),Zc=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(n===void 0&&(n=Xc.active()),t?.root)return new Ic;var r=n&&Uc(n);return Qc(r)&&Jc(r)?new Ic(r):new Ic},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);var s=a??Xc.active(),c=this.startSpan(e,i,s),l=Bc(s,c);return Xc.with(l,o,void 0,c)}},e}();function Qc(e){return typeof e==`object`&&typeof e.spanId==`string`&&typeof e.traceId==`string`&&typeof e.traceFlags==`number`}var $c=new Zc,el=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):$c},e}(),tl=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new Zc},e}()),nl=function(){function e(){}return e.prototype.getTracer=function(e,t,n){return this.getDelegateTracer(e,t,n)??new el(this,e,t,n)},e.prototype.getDelegate=function(){return this._delegate??tl},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){return this._delegate?.getTracer(e,t,n)},e}(),rl;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(rl||={});var il;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(il||={});var al=Nc.getInstance(),ol=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return hc},e}()),sl=`metrics`,cl=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalMeterProvider=function(e){return Is(sl,e,Js.instance())},e.prototype.getMeterProvider=function(){return Ls(sl)||ol},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){Rs(sl,Js.instance())},e}().getInstance(),ll=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),ul=nc(`OpenTelemetry Baggage Key`);function dl(e){return e.getValue(ul)||void 0}function fl(){return dl(Nc.getInstance().active())}function pl(e,t){return e.setValue(ul,t)}function ml(e){return e.deleteValue(ul)}var hl=`propagation`,gl=new ll,_l=function(){function e(){this.createBaggage=ec,this.getBaggage=dl,this.getActiveBaggage=fl,this.setBaggage=pl,this.deleteBaggage=ml}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalPropagator=function(e){return Is(hl,e,Js.instance())},e.prototype.inject=function(e,t,n){return n===void 0&&(n=Tc),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return n===void 0&&(n=wc),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Rs(hl,Js.instance())},e.prototype._getGlobalPropagator=function(){return Ls(hl)||gl},e}().getInstance(),vl=`trace`,yl=function(){function e(){this._proxyTracerProvider=new nl,this.wrapSpanContext=Yc,this.isSpanContextValid=Jc,this.deleteSpan=Vc,this.getSpan=Rc,this.getActiveSpan=zc,this.getSpanContext=Uc,this.setSpan=Bc,this.setSpanContext=Hc}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=Is(vl,this._proxyTracerProvider,Js.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Ls(vl)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Rs(vl,Js.instance()),this._proxyTracerProvider=new nl},e}().getInstance();Ka(()=>{let e=yl.getActiveSpan();if(!e)return;let t=e.spanContext();if(Jc(t))return t.traceId});var bl=`semiont`,xl=()=>yl.getTracer(bl);async function Sl(e,t,n){let r=xl().startSpan(e,{kind:n?.kind??rl.INTERNAL,...n?.attrs?{attributes:n.attrs}:{}});try{return await al.with(yl.setSpan(al.active(),r),()=>t(r))}catch(e){throw r.recordException(e),r.setStatus({code:il.ERROR,message:e instanceof Error?e.message:String(e)}),e}finally{r.end()}}var Cl=`_trace`;function wl(){let e={};_l.inject(al.active(),e);let t=e.traceparent;if(t)return e.tracestate?{traceparent:t,tracestate:e.tracestate}:{traceparent:t}}function Tl(e){let t=e[Cl];if(t!==void 0&&delete e[Cl],!(!t||typeof t.traceparent!=`string`))return t}function El(e,t){if(!e)return t();let n={traceparent:e.traceparent};e.tracestate&&(n.tracestate=e.tracestate);let r=_l.extract(al.active(),n);return al.with(r,t)}var Dl=`semiont`,Ol=()=>cl.getMeter(Dl),kl;function Al(){return kl||=Ol().createCounter(`semiont.bus.emit`,{description:`Bus emits by channel and scope`}),kl}function jl(e,t){Al().add(1,{"bus.channel":e,...t?{"bus.scope":t}:{}})}var Ml=3e3,Nl={initial:[`connecting`,`closed`],connecting:[`open`,`reconnecting`,`closed`],open:[`reconnecting`,`closed`],reconnecting:[`connecting`,`degraded`,`closed`],degraded:[`connecting`,`closed`],closed:[]};function Pl(e){let{baseUrl:t,token:n,channels:r,scope:i,reconnectMs:a=5e3}=e,o=typeof n==`function`?n:()=>n,s=new Set(r),c=new Set,l=i,u=new hi,d=new _i(`initial`),f=`initial`,p=null,m=e=>{if(f===e)return;if(!Nl[f].includes(e))throw Error(`Invalid connection state transition: ${f} \u2192 ${e}`);let t=f;f=e,e===`reconnecting`&&t!==`reconnecting`&&(p&&clearTimeout(p),p=setTimeout(()=>{f===`reconnecting`&&m(`degraded`)},Ml)),t===`reconnecting`&&e!==`reconnecting`&&(p&&=(clearTimeout(p),null)),d.next(e)},h=!1,g=new Set,_=null,v=null,y=u.pipe(Ea()),b=()=>{for(let e of g)try{e.abort()}catch{}g.clear(),_&&=(clearTimeout(_),null)},x=async()=>{m(`connecting`);for(let e of g)try{e.abort()}catch{}g.clear();let e=new URLSearchParams;for(let t of s)e.append(`channel`,t);if(l&&c.size>0){e.append(`scope`,l);for(let t of c)e.append(`scoped`,t)}let n=`${t}/bus/subscribe?${e.toString()}`,r=new AbortController;g.add(r);try{let e={Authorization:`Bearer ${o()}`};v&&(e[`Last-Event-ID`]=v);let t=await fetch(n,{headers:e,signal:r.signal});if(!t.ok||!t.body)throw Error(`SSE connect failed: ${t.status}`);m(`open`);let i=t.body.getReader(),a=new TextDecoder,s=``,c=``,l=``,d;for(;h&&g.has(r);){let{done:e,value:t}=await i.read();if(e)break;s+=a.decode(t,{stream:!0});let n=s.split(`
|
|
7
7
|
`);s=n.pop()??``;for(let e of n)if(e.startsWith(`event: `))c=e.slice(7);else if(e.startsWith(`data: `))l=e.slice(6);else if(e.startsWith(`id: `))d=e.slice(4);else if(e===``){if(c===`bus-event`&&l){d!==void 0&&(v=d);let e=JSON.parse(l);qa(`RECV`,e.channel,e.payload,e.scope),await El(Tl(e.payload),()=>Sl(`bus.recv:${e.channel}`,()=>{u.next(e)},{kind:rl.CONSUMER,attrs:{"bus.channel":e.channel,...e.scope?{"bus.scope":e.scope}:{}}}))}c=``,l=``,d=void 0}}}catch(e){if(e.name===`AbortError`)return}finally{g.delete(r)}h&&(m(`reconnecting`),_=setTimeout(()=>{h&&x()},a))},S=()=>{h&&((f===`open`||f===`connecting`||f===`degraded`)&&m(`reconnecting`),b(),x())},C=null,w=()=>{C&&clearTimeout(C),C=setTimeout(()=>{C=null,S()},100)};return{on$(e){return y.pipe(ba(t=>t.channel===e),pa(e=>e.payload))},emit:async(e,n,r)=>{let i={channel:e,payload:n};r&&(i.scope=r);let a={"Content-Type":`application/json`,Authorization:`Bearer ${o()}`},s=wl();s&&(a.traceparent=s.traceparent,s.tracestate&&(a.tracestate=s.tracestate)),await fetch(`${t}/bus/emit`,{method:`POST`,headers:a,body:JSON.stringify(i)})},state$:d.asObservable(),addChannels:(e,t)=>{let n=!1;if(t!==void 0){for(let t of e)c.has(t)||(c.add(t),n=!0);t!==l&&(l=t,n=!0)}else for(let t of e)s.has(t)||(s.add(t),n=!0);n&&w()},removeChannels:e=>{let t=!1;for(let n of e)c.delete(n)&&(t=!0),s.delete(n)&&(t=!0);c.size===0&&(l=void 0),t&&w()},start:()=>{h||(h=!0,x())},stop:()=>{h=!1,f!==`closed`&&m(`closed`),C&&=(clearTimeout(C),null),p&&=(clearTimeout(p),null),b()},dispose:()=>{h=!1,f!==`closed`&&m(`closed`),C&&=(clearTimeout(C),null),p&&=(clearTimeout(p),null),b(),u.complete(),d.complete()}}}var Fl=[...Ba.filter(e=>e!==`frame:entity-type-added`),...Va];function Il(e){let t=e.headers.get(`Content-Type`)??`application/octet-stream`,n=e.headers.get(`Content-Disposition`)?.match(/filename="(.+?)"/)?.[1];return{stream:e.body,contentType:t,...n?{filename:n}:{}}}function Ll(e){return e===400?`bad-request`:e===401?`unauthorized`:e===403?`forbidden`:e===404?`not-found`:e===409?`conflict`:e>=500?`unavailable`:`error`}var Rl=class extends zo{status;statusText;constructor(e,t,n,r){super(e,Ll(t),{status:t,statusText:n,body:r}),this.name=`APIError`,this.status=t,this.statusText=n}},zl=class{baseUrl;http;token$;logger;errorsSubject=new hi;errors$=this.errorsSubject.asObservable();_actor=null;_actorStarted=!1;disposed=!1;activeResource=null;bridges=[];constructor(e){let{baseUrl:t,timeout:n=3e4,retry:r=2,logger:i,tokenRefresher:a}=e;this.baseUrl=t.endsWith(`/`)?t.slice(0,-1):t,this.token$=e.token$??new _i(null),this.logger=i;let o=a?{limit:1,methods:[`get`,`post`,`put`,`patch`,`delete`,`head`,`options`],statusCodes:[401,408,413,429,500,502,503,504]}:r;this.http=Ds.create({timeout:n,retry:o,credentials:`include`,hooks:{beforeRequest:[e=>{this.logger&&this.logger.debug(`HTTP Request`,{type:`http_request`,url:e.url,method:e.method,timestamp:Date.now(),hasAuth:e.headers.has(`Authorization`)})}],beforeRetry:a?[async({request:e,error:t})=>{if(!(!(t instanceof Bo)||t.response.status!==401))try{let t=await a();if(!t)return Ds.stop;e.headers.set(`Authorization`,`Bearer ${t}`);return}catch{return Ds.stop}}]:[],afterResponse:[(e,t,n)=>(this.logger&&this.logger.debug(`HTTP Response`,{type:`http_response`,url:e.url,method:e.method,status:n.status,statusText:n.statusText}),n)],beforeError:[async e=>{let{response:t,request:n}=e;if(t){let e=await t.json().catch(()=>({}));this.logger&&this.logger.error(`HTTP Request Failed`,{type:`http_error`,url:n.url,method:n.method,status:t.status,statusText:t.statusText,error:e.message||`HTTP ${t.status}: ${t.statusText}`});let r=new Rl(e.message||`HTTP ${t.status}: ${t.statusText}`,t.status,t.statusText,e);throw this.errorsSubject.next(r),r}return e}]}}),this.token$.subscribe(e=>{e&&!this._actorStarted&&!this.disposed&&(this._actorStarted=!0,this.actor.start())})}get actor(){if(!this._actor){this._actor=Pl({baseUrl:this.baseUrl,token:()=>this.token$.getValue()??``,channels:[..._o]});for(let e of _o)this._actor.on$(e).subscribe(t=>{for(let n of this.bridges)n.get(e).next(t)})}return this._actor}async emit(e,t,n){qa(`EMIT`,e,t,n),jl(e,n),await Sl(`bus.emit:${e}`,async()=>{n===void 0?await this.actor.emit(e,t):await this.actor.emit(e,t,n)},{kind:rl.PRODUCER,attrs:{"bus.channel":e,...n?{"bus.scope":n}:{}}})}on(e,t){let n=this.actor.on$(e).subscribe(t);return()=>n.unsubscribe()}stream(e){return this.actor.on$(e)}bridgeInto(e){this.bridges.push(e)}subscribeToResource(e){if(this.activeResource){if(this.activeResource.resourceId!==e)throw Error(`HttpTransport already subscribed to resource ${this.activeResource.resourceId}; call the unsubscribe returned from the previous subscribeToResource before subscribing to ${e}.`);return this.activeResource.refCount++,this.makeUnsubscriber()}this.actor.addChannels([...Fl],e);let t=[];for(let e of Fl)t.push(this.actor.on$(e).subscribe(t=>{for(let n of this.bridges)n.get(e).next(t)}));return this.activeResource={resourceId:e,refCount:1,bridgeSubs:t},this.makeUnsubscriber()}makeUnsubscriber(){let e=!1;return()=>{if(!e&&(e=!0,this.activeResource&&(this.activeResource.refCount--,!(this.activeResource.refCount>0)))){for(let e of this.activeResource.bridgeSubs)e.unsubscribe();this.actor.removeChannels([...Fl]),this.activeResource=null}}}get state$(){return this.actor.state$}dispose(){if(!this.disposed){if(this.disposed=!0,this.activeResource){for(let e of this.activeResource.bridgeSubs)e.unsubscribe();this.activeResource=null}this._actor&&=(this._actor.dispose(),null),this.errorsSubject.complete()}}pushError(e){this.disposed||this.errorsSubject.next(e)}authHeaders(){let e=this.token$.getValue()??void 0;return e?{Authorization:`Bearer ${e}`}:{}}async authenticatePassword(e,t){return this.http.post(`${this.baseUrl}/api/tokens/password`,{json:{email:e,password:t},headers:this.authHeaders()}).json()}async authenticateGoogle(e){return this.http.post(`${this.baseUrl}/api/tokens/google`,{json:{credential:e},headers:this.authHeaders()}).json()}async refreshAccessToken(e){return this.http.post(`${this.baseUrl}/api/tokens/refresh`,{json:{refreshToken:e},headers:this.authHeaders()}).json()}async logout(){await this.http.post(`${this.baseUrl}/api/users/logout`,{headers:this.authHeaders()}).json()}async acceptTerms(){await this.http.post(`${this.baseUrl}/api/users/accept-terms`,{headers:this.authHeaders()}).json()}async getCurrentUser(){return this.http.get(`${this.baseUrl}/api/users/me`,{headers:this.authHeaders()}).json()}async generateMcpToken(){return this.http.post(`${this.baseUrl}/api/tokens/mcp-generate`,{headers:this.authHeaders()}).json()}async getMediaToken(e){return this.http.post(`${this.baseUrl}/api/tokens/media`,{json:{resourceId:e},headers:this.authHeaders()}).json()}async listUsers(){return this.http.get(`${this.baseUrl}/api/admin/users`,{headers:this.authHeaders()}).json()}async getUserStats(){return this.http.get(`${this.baseUrl}/api/admin/users/stats`,{headers:this.authHeaders()}).json()}async updateUser(e,t){return this.http.patch(`${this.baseUrl}/api/admin/users/${e}`,{json:t,headers:this.authHeaders()}).json()}async getOAuthConfig(){return this.http.get(`${this.baseUrl}/api/admin/oauth/config`,{headers:this.authHeaders()}).json()}async backupKnowledgeBase(){return Il(await this.http.post(`${this.baseUrl}/api/admin/exchange/backup`,{headers:this.authHeaders()}))}restoreKnowledgeBase(e){return this.sseProgressStream(`${this.baseUrl}/api/admin/exchange/restore`,e)}async exportKnowledgeBase(e){let t=e?.includeArchived?new URLSearchParams({includeArchived:`true`}):void 0;return Il(await this.http.post(`${this.baseUrl}/api/moderate/exchange/export`,{headers:this.authHeaders(),...t?{searchParams:t}:{}}))}importKnowledgeBase(e){return this.sseProgressStream(`${this.baseUrl}/api/moderate/exchange/import`,e)}sseProgressStream(e,t){return new oi(n=>{let r=new AbortController,i=new FormData;return i.append(`file`,t),(async()=>{try{let t=(await this.http.post(e,{body:i,headers:this.authHeaders(),signal:r.signal})).body.getReader(),a=new TextDecoder,o=``;for(;!n.closed;){let{done:e,value:r}=await t.read();if(e)break;o+=a.decode(r,{stream:!0});let i=o.split(`
|
|
8
|
-
`);o=i.pop();for(let e of i)if(e.startsWith(`data: `)){let t=JSON.parse(e.slice(6));n.next(t)}}n.complete()}catch(e){n.closed||n.error(e)}})(),()=>r.abort()})}async healthCheck(){return this.http.get(`${this.baseUrl}/api/health`,{headers:this.authHeaders()}).json()}async getStatus(){return this.http.get(`${this.baseUrl}/api/status`,{headers:this.authHeaders()}).json()}get rawHttp(){return this.http}getToken(){return this.token$.getValue()??void 0}},Bl=class{constructor(e){this.transport=e}async putBinary(e,t){let n=e.file instanceof File?e.file.size:e.file.length;return qa(`PUT`,`content`,{name:e.name,format:e.format,storageUri:e.storageUri,sizeBytes:n}),Sl(`content.put`,async()=>{let n=Vl(e),r=this.requestHeaders(t?.auth);return typeof XMLHttpRequest<`u`&&(t?.onProgress||t?.signal)?Hl({url:`${this.transport.baseUrl}/resources`,formData:n,headers:r,onProgress:t.onProgress,signal:t.signal,onApiError:e=>this.transport.pushError(e)}):{resourceId:(await this.transport.rawHttp.post(`${this.transport.baseUrl}/resources`,{body:n,headers:r}).json()).resourceId}},{kind:rl.CLIENT,attrs:{"content.format":e.format,"content.size_bytes":n}})}async getBinary(e,t){return qa(`GET`,`content`,{resourceId:e,accept:t?.accept}),Sl(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:{Accept:t?.accept??`text/plain`,...this.requestHeaders(t?.auth)}}),r=n.headers.get(`content-type`)||`application/octet-stream`;return{data:await n.arrayBuffer(),contentType:r}},{kind:rl.CLIENT,attrs:{"resource.id":e}})}async getBinaryStream(e,t){return qa(`GET`,`content`,{resourceId:e,accept:t?.accept,stream:!0}),Sl(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:{Accept:t?.accept??`text/plain`,...this.requestHeaders(t?.auth)}}),r=n.headers.get(`content-type`)||`application/octet-stream`;if(!n.body)throw Error(`Response body is null - cannot create stream`);return{stream:n.body,contentType:r}},{kind:rl.CLIENT,attrs:{"resource.id":e,"content.stream":!0}})}dispose(){}requestHeaders(e){let t=e??this.transport.getToken(),n=t?{Authorization:`Bearer ${t}`}:{},r=wl();return r&&(n.traceparent=r.traceparent,r.tracestate&&(n.tracestate=r.tracestate)),n}};function Vl(e){let t=new FormData;if(t.append(`name`,e.name),t.append(`format`,e.format),t.append(`storageUri`,e.storageUri),e.file instanceof File)t.append(`file`,e.file);else if(typeof Buffer<`u`&&Buffer.isBuffer(e.file)){let n=new Blob([new Uint8Array(e.file)],{type:e.format});t.append(`file`,n,e.name)}else throw Error(`file must be a File or Buffer`);return e.entityTypes&&e.entityTypes.length>0&&t.append(`entityTypes`,JSON.stringify(e.entityTypes)),e.language&&t.append(`language`,e.language),e.sourceAnnotationId&&t.append(`sourceAnnotationId`,String(e.sourceAnnotationId)),e.sourceResourceId&&t.append(`sourceResourceId`,String(e.sourceResourceId)),e.generationPrompt&&t.append(`generationPrompt`,e.generationPrompt),e.generator&&t.append(`generator`,JSON.stringify(e.generator)),e.isDraft!==void 0&&t.append(`isDraft`,String(e.isDraft)),t}function Hl(e){let{url:t,formData:n,headers:r,onProgress:i,signal:a,onApiError:o}=e;return new Promise((e,s)=>{let c=new XMLHttpRequest;if(a?.aborted){let e=new Rl(`Upload aborted`,0,`aborted`);o(e),s(e);return}c.open(`POST`,t);for(let[e,t]of Object.entries(r))c.setRequestHeader(e,t);i&&(c.upload.onprogress=e=>{let t=e.lengthComputable?e.total:0;i({bytesUploaded:e.loaded,totalBytes:t})}),c.onload=()=>{if(c.status>=200&&c.status<300){try{e({resourceId:JSON.parse(c.responseText).resourceId})}catch(e){let t=new Rl(`Upload succeeded but response was not valid JSON: ${e.message}`,c.status,c.statusText,c.responseText);o(t),s(t)}return}let t=c.responseText;try{t=JSON.parse(c.responseText)}catch{}let n=new Rl(t&&typeof t==`object`&&`message`in t&&typeof t.message==`string`?t.message:`HTTP ${c.status}: ${c.statusText}`,c.status,c.statusText,t);o(n),s(n)},c.onerror=()=>{let e=new Rl(`Network error during upload`,0,`network-error`);o(e),s(e)},c.ontimeout=()=>{let e=new Rl(`Upload timed out`,0,`timeout`);o(e),s(e)},c.onabort=()=>{let e=new Rl(`Upload aborted`,0,`aborted`);o(e),s(e)},a&&a.addEventListener(`abort`,()=>c.abort(),{once:!0}),c.send(n)})}var Ul=class e extends oi{then(e,t){return sa(this).then(e,t)}static from(t){return new e(e=>t.subscribe(e))}},Wl=class e extends oi{then(e,t){return ca(this.pipe(ba(e=>e!==void 0))).then(e,t)}static from(t){let n=Gl.get(t);return n||(n=new e(e=>t.subscribe(e)),Gl.set(t,n)),n}},Gl=new WeakMap,Kl=class extends oi{then(e,t){return sa(this).then(t=>{if(t.phase!==`finished`)throw Error(`UploadObservable resolved on a non-finished event: ${t.phase}`);let n={resourceId:t.resourceId};return e?e(n):n},t)}},ql=class extends zo{constructor(e,t,n){super(e,t,n),this.name=`BusRequestError`}};async function Jl(e,t,n,r,i,a=3e4){let o=crypto.randomUUID(),s={...n,correlationId:o},c=ca(ya(e.stream(r).pipe(ba(e=>e.correlationId===o),pa(e=>({ok:!0,response:e.response}))),e.stream(i).pipe(ba(e=>e.correlationId===o),pa(e=>({ok:!1,error:new ql(e.message??`Bus request rejected`,`bus.rejected`,{channel:i,correlationId:o,payload:e})})))).pipe(Ca(1),da(a),xa(e=>e instanceof ua?aa(()=>new ql(`Bus request timed out after ${a}ms on ${r}`,`bus.timeout`,{channel:t,resultChannel:r,correlationId:o,timeoutMs:a})):aa(()=>e))));await e.emit(t,s);let l=await c;if(!l.ok)throw l.error;return l.response}function Yl(e){let t=new _i(new Map),n=new Set,r=new Map,i=async r=>{if(!n.has(r)){n.add(r);try{let n=await e(r),i=new Map(t.value);i.set(r,n),t.next(i)}catch{}finally{n.delete(r)}}};return{observe(e){!t.value.has(e)&&!n.has(e)&&i(e);let a=r.get(e);return a||(a=t.pipe(pa(t=>t.get(e)),wa()),r.set(e,a)),a},get(e){return t.value.get(e)},keys(){return[...t.value.keys()]},invalidate(e){n.delete(e),i(e)},remove(e){let r=new Map(t.value);r.delete(e),t.next(r),n.delete(e)},set(e,n){let r=new Map(t.value);r.set(e,n),t.next(r)},invalidateAll(){for(let e of t.value.keys())n.delete(e),i(e)},dispose(){t.complete(),r.clear(),n.clear()}}}var Xl=`_`,Zl=`_`,Ql=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n,this.resourceCache=Yl(async e=>(await Jl(this.transport,`browse:resource-requested`,{resourceId:e},`browse:resource-result`,`browse:resource-failed`)).resource),this.resourceListCache=Yl(async e=>{let t=this.resourceListFilters.get(e)??{},n=t.search?Ia(t.search):void 0;return(await Jl(this.transport,`browse:resources-requested`,{search:n,archived:t.archived,limit:t.limit??100,offset:0},`browse:resources-result`,`browse:resources-failed`)).resources}),this.annotationListCache=Yl(async e=>Jl(this.transport,`browse:annotations-requested`,{resourceId:e},`browse:annotations-result`,`browse:annotations-failed`)),this.annotationDetailCache=Yl(async e=>{let t=this.annotationResources.get(e);if(!t)throw Error(`Cannot fetch annotation ${e}: no resourceId known`);return(await Jl(this.transport,`browse:annotation-requested`,{resourceId:t,annotationId:e},`browse:annotation-result`,`browse:annotation-failed`)).annotation}),this.entityTypesCache=Yl(async()=>(await Jl(this.transport,`browse:entity-types-requested`,{},`browse:entity-types-result`,`browse:entity-types-failed`)).entityTypes),this.tagSchemasCache=Yl(async()=>(await Jl(this.transport,`browse:tag-schemas-requested`,{},`browse:tag-schemas-result`,`browse:tag-schemas-failed`)).tagSchemas),this.referencedByCache=Yl(async e=>(await Jl(this.transport,`browse:referenced-by-requested`,{resourceId:e},`browse:referenced-by-result`,`browse:referenced-by-failed`)).referencedBy),this.resourceEventsCache=Yl(async e=>(await Jl(this.transport,`browse:events-requested`,{resourceId:e},`browse:events-result`,`browse:events-failed`)).events),this.subscribeToEvents()}resourceCache;resourceListCache;annotationListCache;annotationDetailCache;annotationResources=new Map;entityTypesCache;tagSchemasCache;referencedByCache;resourceEventsCache;resourceListFilters=new Map;annotationListObs=new Map;resource(e){return Wl.from(this.resourceCache.observe(e))}resources(e){let t=JSON.stringify(e??{});return this.resourceListFilters.set(t,e??{}),Wl.from(this.resourceListCache.observe(t))}annotations(e){let t=this.annotationListObs.get(e);return t||(t=this.annotationListCache.observe(e).pipe(pa(e=>e?.annotations)),this.annotationListObs.set(e,t)),Wl.from(t)}annotation(e,t){return this.annotationResources.set(t,e),Wl.from(this.annotationDetailCache.observe(t))}entityTypes(){return Wl.from(this.entityTypesCache.observe(Xl))}tagSchemas(){return Wl.from(this.tagSchemasCache.observe(Zl))}referencedBy(e){return Wl.from(this.referencedByCache.observe(e))}events(e){return Wl.from(this.resourceEventsCache.observe(e))}async resourceContent(e){let t=await this.content.getBinary(e,{accept:`text/plain`});return new TextDecoder().decode(t.data)}async resourceRepresentation(e,t){return this.content.getBinary(e,t?.accept?{accept:t.accept}:void 0)}async resourceRepresentationStream(e,t){return this.content.getBinaryStream(e,t?.accept?{accept:t.accept}:void 0)}async resourceEvents(e){return(await Jl(this.transport,`browse:events-requested`,{resourceId:e},`browse:events-result`,`browse:events-failed`)).events}async annotationHistory(e,t){return Jl(this.transport,`browse:annotation-history-requested`,{resourceId:e,annotationId:t},`browse:annotation-history-result`,`browse:annotation-history-failed`)}async connections(e){throw Error(`Not implemented: connections endpoint does not exist yet`)}async backlinks(e){throw Error(`Not implemented: backlinks endpoint does not exist yet`)}async resourcesByName(e,t){throw Error(`Not implemented: resourcesByName endpoint does not exist yet`)}async files(e,t){return Jl(this.transport,`browse:directory-requested`,{path:e??`.`,sort:t??`name`},`browse:directory-result`,`browse:directory-failed`)}click(e,t){this.bus.get(`browse:click`).next({annotationId:e,motivation:t})}navigateReference(e){this.bus.get(`browse:reference-navigate`).next({resourceId:e})}invalidateAnnotationList(e){this.annotationListCache.invalidate(e)}removeAnnotationDetail(e){this.annotationDetailCache.remove(e),this.annotationResources.delete(e)}invalidateResourceDetail(e){this.resourceCache.invalidate(e)}invalidateResourceLists(){this.resourceListCache.invalidateAll()}invalidateEntityTypes(){this.entityTypesCache.invalidate(Xl)}invalidateTagSchemas(){this.tagSchemasCache.invalidate(Zl)}invalidateReferencedBy(e){this.referencedByCache.invalidate(e)}invalidateResourceEvents(e){this.resourceEventsCache.invalidate(e)}updateAnnotationInPlace(e,t){let n=this.annotationListCache.get(e);if(n){let r=n.annotations.findIndex(e=>e.id===t.id),i=r>=0?n.annotations.map((e,n)=>n===r?t:e):[...n.annotations,t];this.annotationListCache.set(e,{...n,annotations:i})}let r=za(t.id);this.annotationResources.set(r,e),this.annotationDetailCache.set(r,t)}on(e,t){this.bus.get(e).subscribe(t)}onEntityTagChanged=e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceDetail(e.resourceId),this.invalidateResourceEvents(e.resourceId))};onArchiveToggled=e=>{e.resourceId&&(this.invalidateResourceDetail(e.resourceId),this.invalidateResourceLists())};onYieldResourceMutated=e=>{let t=Ra(e.resourceId);this.invalidateResourceDetail(t),this.invalidateResourceLists()};subscribeToEvents(){this.on(`bus:resume-gap`,e=>{let t=e.scope;if(t){let e=t;this.invalidateAnnotationList(e),this.invalidateResourceDetail(e),this.invalidateResourceEvents(e),this.invalidateReferencedBy(e)}else{this.invalidateResourceLists();for(let e of this.annotationListCache.keys())this.invalidateAnnotationList(e);for(let e of this.resourceCache.keys())this.invalidateResourceDetail(e);for(let e of this.resourceEventsCache.keys())this.invalidateResourceEvents(e);for(let e of this.referencedByCache.keys())this.invalidateReferencedBy(e)}this.invalidateEntityTypes(),this.invalidateTagSchemas()}),this.on(`mark:delete-ok`,e=>{this.removeAnnotationDetail(za(e.annotationId))}),this.on(`mark:added`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId))}),this.on(`mark:removed`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId)),this.removeAnnotationDetail(za(e.payload.annotationId))}),this.on(`mark:body-updated`,e=>{let t=e;!t.resourceId||!t.annotation||(this.updateAnnotationInPlace(t.resourceId,t.annotation),this.invalidateResourceEvents(t.resourceId))}),this.on(`mark:entity-tag-added`,this.onEntityTagChanged),this.on(`mark:entity-tag-removed`,this.onEntityTagChanged),this.on(`replay-window-exceeded`,e=>{e.resourceId&&this.invalidateAnnotationList(e.resourceId)}),this.on(`yield:create-ok`,this.onYieldResourceMutated),this.on(`yield:update-ok`,this.onYieldResourceMutated),this.on(`mark:archived`,this.onArchiveToggled),this.on(`mark:unarchived`,this.onArchiveToggled),this.on(`frame:entity-type-added`,()=>this.invalidateEntityTypes()),this.on(`frame:tag-schema-added`,()=>this.invalidateTagSchemas())}},$l=class{constructor(e,t){this.transport=e,this.bus=t}async annotation(e){let t=Ra(e.target.source);return{annotationId:za((await Jl(this.transport,`mark:create-request`,{resourceId:t,request:e},`mark:create-ok`,`mark:create-failed`)).annotationId)}}async delete(e,t){await this.transport.emit(`mark:delete`,{annotationId:t,resourceId:e})}async archive(e){await this.transport.emit(`mark:archive`,{resourceId:e})}async unarchive(e){await this.transport.emit(`mark:unarchive`,{resourceId:e})}assist(e,t,n){return new Ul(r=>{let i=!1,a=null,o=null,s=this.transport.subscribeToResource(e),c=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null),s&&=(s(),null)},l=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||Jl(this.transport,`job:status-requested`,{jobId:t},`job:status-result`,`job:status-failed`).then(n=>{i||(n.status===`complete`?(c(),r.next({kind:`complete`,data:{jobId:t,jobType:n.jobType??`annotation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(c(),r.error(Error(n.error??`Job failed`))))}).catch(()=>{})},5e3))},1e4)},u=null,d=this.bus.get(`job:report-progress`).pipe(ba(e=>e.jobId===u)),f=this.bus.get(`job:complete`).pipe(ba(e=>e.jobId===u)),p=this.bus.get(`job:fail`).pipe(ba(e=>e.jobId===u)),m=d.pipe(Aa(ya(f,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),u&&l(u)}),h=f.subscribe(e=>{c(),r.next({kind:`complete`,data:e}),r.complete()}),g=p.subscribe(e=>{c(),r.error(Error(e.error))});return this.dispatchAssist(e,t,n).then(({jobId:e})=>{e&&!i&&(u=e,l(e))}).catch(e=>{c(),r.error(e)}),()=>{c(),m.unsubscribe(),h.unsubscribe(),g.unsubscribe()}})}request(e,t){this.bus.get(`mark:requested`).next({selector:e,motivation:t})}requestAssist(e,t,n){this.bus.get(`mark:assist-request`).next({motivation:e,options:t,...n?{correlationId:n}:{}})}submit(e){this.bus.get(`mark:submit`).next(e)}cancelPending(){this.bus.get(`mark:cancel-pending`).next(void 0)}dismissProgress(){this.bus.get(`mark:progress-dismiss`).next(void 0)}changeSelection(e){this.bus.get(`mark:selection-changed`).next({motivation:e})}changeClick(e){this.bus.get(`mark:click-changed`).next({action:e})}changeShape(e){this.bus.get(`mark:shape-changed`).next({shape:e})}toggleMode(){this.bus.get(`mark:mode-toggled`).next(void 0)}async dispatchAssist(e,t,n){let r={tagging:`tag-annotation`,linking:`reference-annotation`,highlighting:`highlight-annotation`,assessing:`assessment-annotation`,commenting:`comment-annotation`}[t];if(!r)throw Error(`Unsupported motivation: ${t}`);if(t===`tagging`){if(!n.schemaId||!n.categories?.length)throw Error(`Tag assist requires schemaId and categories`)}else if(t===`linking`&&!n.entityTypes?.length)throw Error(`Reference assist requires entityTypes`);let i={};return n.entityTypes&&(i.entityTypes=n.entityTypes),n.includeDescriptiveReferences!==void 0&&(i.includeDescriptiveReferences=n.includeDescriptiveReferences),n.instructions!==void 0&&(i.instructions=n.instructions),n.density!==void 0&&(i.density=n.density),n.tone!==void 0&&(i.tone=n.tone),n.language!==void 0&&(i.language=n.language),n.sourceLanguage!==void 0&&(i.sourceLanguage=n.sourceLanguage),n.schemaId!==void 0&&(i.schemaId=n.schemaId),n.categories!==void 0&&(i.categories=n.categories),Jl(this.transport,`job:create`,{jobType:r,resourceId:e,params:i},`job:created`,`job:create-failed`)}},eu=class{constructor(e,t){this.transport=e,this.bus=t}async body(e,t,n){await this.transport.emit(`bind:update-body`,{correlationId:crypto.randomUUID(),annotationId:t,resourceId:e,operations:n})}initiate(e){this.bus.get(`bind:initiate`).next(e)}},tu=class{constructor(e,t){this.transport=e,this.bus=t}annotation(e,t,n){return new Ul(r=>{let i=crypto.randomUUID(),a=this.bus.get(`gather:complete`).pipe(ba(e=>e.correlationId===i)),o=this.bus.get(`gather:failed`).pipe(ba(e=>e.correlationId===i)),s=ya(this.bus.get(`gather:annotation-progress`).pipe(ba(e=>e.annotationId===t),pa(e=>e)),a.pipe(pa(e=>e))).pipe(Aa(ya(a,o))).subscribe({next:e=>r.next(e),error:e=>r.error(e)}),c=a.subscribe(e=>{r.next(e),r.complete()}),l=o.subscribe(e=>{r.error(Error(e.message))});return this.transport.emit(`gather:requested`,{correlationId:i,annotationId:t,resourceId:e,options:{contextWindow:n?.contextWindow??2e3}}).catch(e=>{r.error(e)}),()=>{s.unsubscribe(),c.unsubscribe(),l.unsubscribe()}})}resource(e,t){throw Error(`Not implemented: gather.resource() — no backend route yet`)}},nu=class{constructor(e,t){this.transport=e,this.bus=t}requestSearch(e){this.bus.get(`match:search-requested`).next(e)}search(e,t,n,r){return new Ul(i=>{let a=crypto.randomUUID(),o=this.bus.get(`match:search-results`).pipe(ba(e=>e.correlationId===a)),s=this.bus.get(`match:search-failed`).pipe(ba(e=>e.correlationId===a)),c=o.subscribe(e=>{i.next(e),i.complete()}),l=s.subscribe(e=>{i.error(Error(e.error))});return this.transport.emit(`match:search-requested`,{correlationId:a,resourceId:e,referenceId:t,context:n,limit:r?.limit??10,useSemanticScoring:r?.useSemanticScoring??!0}).catch(e=>{i.error(e)}),()=>{c.unsubscribe(),l.unsubscribe()}})}},ru=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n}resource(e){let t=typeof Buffer<`u`&&e.file instanceof Buffer?e.file.length:e.file.size;return new Kl(n=>{n.next({phase:`started`,totalBytes:t});let r=!1,i=new AbortController;return this.content.putBinary({name:e.name,file:e.file,format:e.format,storageUri:e.storageUri,...e.entityTypes?{entityTypes:e.entityTypes}:{},...e.language?{language:e.language}:{},...e.sourceAnnotationId?{sourceAnnotationId:e.sourceAnnotationId}:{},...e.sourceResourceId?{sourceResourceId:e.sourceResourceId}:{},...e.generationPrompt?{generationPrompt:e.generationPrompt}:{},...e.generator?{generator:e.generator}:{},...e.isDraft===void 0?{}:{isDraft:e.isDraft}},{onProgress:({bytesUploaded:e,totalBytes:i})=>{if(r)return;let a=i>0?i:t;n.next({phase:`progress`,bytesUploaded:e,totalBytes:a})},signal:i.signal}).then(e=>{r||(n.next({phase:`finished`,resourceId:Ra(e.resourceId)}),n.complete())}).catch(e=>{r||n.error(e)}),()=>{r=!0,i.abort()}})}fromAnnotation(e,t,n){return new Ul(r=>{let i=!1,a=null,o=null,s=this.transport.subscribeToResource(e),c=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null),s&&=(s(),null)},l=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||Jl(this.transport,`job:status-requested`,{jobId:t},`job:status-result`,`job:status-failed`).then(n=>{i||(n.status===`complete`?(c(),r.next({kind:`complete`,data:{jobId:t,jobType:n.jobType??`generation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(c(),r.error(Error(n.error??`Generation failed`))))}).catch(()=>{})},5e3))},1e4)},u=null,d=this.bus.get(`job:report-progress`).pipe(ba(e=>e.jobId===u)),f=this.bus.get(`job:complete`).pipe(ba(e=>e.jobId===u)),p=this.bus.get(`job:fail`).pipe(ba(e=>e.jobId===u)),m=d.pipe(Aa(ya(f,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),u&&l(u)}),h=f.subscribe(e=>{c(),r.next({kind:`complete`,data:e}),r.complete()}),g=p.subscribe(e=>{c(),r.error(Error(e.error))});return Jl(this.transport,`job:create`,{jobType:`generation`,resourceId:e,params:{referenceId:t,title:n.title,prompt:n.prompt,entityTypes:n.entityTypes,language:n.language,sourceLanguage:n.sourceLanguage,temperature:n.temperature,maxTokens:n.maxTokens,storageUri:n.storageUri,context:n.context}},`job:created`,`job:create-failed`).then(({jobId:e})=>{e&&!i&&(u=e,l(e))}).catch(e=>{c(),r.error(e)}),()=>{c(),m.unsubscribe(),h.unsubscribe(),g.unsubscribe()}})}async cloneToken(e){return Jl(this.transport,`yield:clone-token-requested`,{resourceId:e},`yield:clone-token-generated`,`yield:clone-token-failed`)}async fromToken(e){return(await Jl(this.transport,`yield:clone-resource-requested`,{token:e},`yield:clone-resource-result`,`yield:clone-resource-failed`)).sourceResource}async createFromToken(e){return{resourceId:Ra((await Jl(this.transport,`yield:clone-create`,e,`yield:clone-created`,`yield:clone-create-failed`)).resourceId)}}clone(){this.bus.get(`yield:clone`).next(void 0)}},iu=class{constructor(e,t){this.transport=e,this.bus=t}attention(e,t){this.transport.emit(`beckon:focus`,{annotationId:t,resourceId:e})}hover(e){this.bus.get(`beckon:hover`).next({annotationId:e})}sparkle(e){this.bus.get(`beckon:sparkle`).next({annotationId:e})}},au=class{constructor(e){this.transport=e}async addEntityType(e){await this.transport.emit(`frame:add-entity-type`,{tag:e})}async addEntityTypes(e){for(let t of e)await this.transport.emit(`frame:add-entity-type`,{tag:t})}async addTagSchema(e){await this.transport.emit(`frame:add-tag-schema`,{schema:e})}},ou=class{constructor(e,t){this.transport=e,this.bus=t}get queued$(){return this.bus.get(`job:queued`)}get progress$(){return this.bus.get(`job:report-progress`)}get complete$(){return this.bus.get(`job:complete`)}get fail$(){return this.bus.get(`job:fail`)}async status(e){return Jl(this.transport,`job:status-requested`,{jobId:e},`job:status-result`,`job:status-failed`)}async pollUntilComplete(e,t){let n=t?.interval??1e3,r=t?.timeout??6e4,i=Date.now();for(;;){let a=await this.status(e);if(t?.onProgress&&t.onProgress(a),a.status===`complete`||a.status===`failed`||a.status===`cancelled`)return a;if(Date.now()-i>r)throw Error(`Job polling timeout after ${r}ms`);await new Promise(e=>setTimeout(e,n))}}async cancelByType(e){await this.transport.emit(`job:cancel-requested`,{jobType:e})}cancelRequest(e){this.bus.get(`job:cancel-requested`).next({jobType:e})}},su=class{constructor(e){this.backend=e}async password(e,t){return this.backend.authenticatePassword(ja(e),t)}async google(e){return this.backend.authenticateGoogle(Ma(e))}async refresh(e){return this.backend.refreshAccessToken(Pa(e))}async logout(){await this.backend.logout()}async me(){return this.backend.getCurrentUser()}async acceptTerms(){await this.backend.acceptTerms()}async mcpToken(){return this.backend.generateMcpToken()}async mediaToken(e){return this.backend.getMediaToken(e)}},cu=class{constructor(e){this.backend=e}async users(){return(await this.backend.listUsers()).users}async userStats(){return this.backend.getUserStats()}async updateUser(e,t){return(await this.backend.updateUser(e,t)).user}async oauthConfig(){return this.backend.getOAuthConfig()}async healthCheck(){return this.backend.healthCheck()}async status(){return this.backend.getStatus()}async backup(){return this.backend.backupKnowledgeBase()}restore(e){return lu(this.backend.restoreKnowledgeBase(e))}async exportKnowledgeBase(e){return this.backend.exportKnowledgeBase(e)}importKnowledgeBase(e){return lu(this.backend.importKnowledgeBase(e))}};function lu(e){return new Ul(t=>{let n=e.subscribe({next:e=>t.next(e),error:e=>t.error(e),complete:()=>t.complete()});return()=>n.unsubscribe()})}var uu=class e{transport;content;bus;baseUrl;frame;browse;mark;bind;gather;match;yield;beckon;job;auth;admin;constructor(e,t,n){this.transport=e,this.content=t,this.baseUrl=e.baseUrl,this.bus=new Ja,this.transport.bridgeInto(this.bus),this.frame=new au(this.transport),this.browse=new Ql(this.transport,this.bus,this.content),this.mark=new $l(this.transport,this.bus),this.bind=new eu(this.transport,this.bus),this.gather=new tu(this.transport,this.bus),this.match=new nu(this.transport,this.bus),this.yield=new ru(this.transport,this.bus,this.content),this.beckon=new iu(this.transport,this.bus),this.job=new ou(this.transport,this.bus),this.auth=n?new su(n):void 0,this.admin=n?new cu(n):void 0}get state$(){return this.transport.state$}subscribeToResource(e){return this.transport.subscribeToResource(e)}dispose(){this.transport.dispose(),this.content.dispose()}static fromHttp(t){let n=new zl({baseUrl:typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,token$:new _i(t.token==null?null:typeof t.token==`string`?Na(t.token):t.token)});return new e(n,new Bl(n),n)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(null),i=new zl({baseUrl:n,token$:r}),a=new e(i,new Bl(i),i);try{let e=await a.auth.password(t.email,t.password);return r.next(Na(e.token)),a}catch(e){throw a.dispose(),e}}},du=`semiont.session.`,fu=`semiont.knowledgeBases`,pu=`semiont.activeKnowledgeBaseId`,mu=300*1e3;function hu(e){return`${du}${e}`}function gu(e,t){let n=e.get(hu(t));if(!n)return null;try{let e=JSON.parse(n);if(e&&typeof e.access==`string`&&typeof e.refresh==`string`)return{access:e.access,refresh:e.refresh}}catch{}return null}function _u(e,t,n){e.set(hu(t),JSON.stringify(n))}function vu(e,t){e.delete(hu(t))}function yu(e){try{let t=e.split(`.`);if(t.length!==3||!t[1])return null;let n=JSON.parse(atob(t[1]));return n.exp?new Date(n.exp*1e3):null}catch{return null}}function bu(e){let t=yu(e);return t?t.getTime()<Date.now():!0}function xu(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||typeof t.label!=`string`||typeof t.email!=`string`)return!1;let n=t.endpoint;return!n||typeof n!=`object`?!1:n.kind===`http`?typeof n.host==`string`&&typeof n.port==`number`&&(n.protocol===`http`||n.protocol===`https`):n.kind===`local`?typeof n.kbId==`string`:!1}function Su(e){try{let t=e.get(fu);return t?JSON.parse(t).filter(xu):[]}catch{return[]}}function Cu(e,t){e.set(fu,JSON.stringify(t))}function wu(e){return e===`localhost`||e===`127.0.0.1`?`http`:`https`}var Tu=/^(([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?|localhost|\d{1,3}(\.\d{1,3}){3})$/;function Eu(e){return Tu.test(e)}function Du(e){if(!Eu(e.host))throw Error(`Invalid KB hostname: "${e.host}"`);let t=new URL(`http://x`);return t.protocol=e.protocol+`:`,t.hostname=e.host,t.port=String(e.port),`${e.protocol}://${t.hostname}:${e.port}`}function Ou(){return crypto.randomUUID()}var ku=class extends zo{kbId;constructor(e,t,n=null){super(t,e,{kbId:n}),this.name=`SemiontSessionError`,this.kbId=n}},Au=class e{kb;client;token$;user$;streamState$;errors$;ready;storage;doRefresh;doValidate;onAuthFailed;onError;refreshTimer=null;unsubscribeStorage=null;disposed=!1;constructor(e){this.kb=e.kb,this.storage=e.storage,this.doRefresh=e.refresh,this.doValidate=e.validate,this.onAuthFailed=e.onAuthFailed??(()=>{}),this.onError=e.onError??(()=>{}),this.client=e.client,this.token$=e.token$,this.user$=new _i(null),this.errors$=this.client.transport.errors$;let t=gu(this.storage,this.kb.id);t&&!bu(t.access)&&this.token$.getValue()===null&&this.token$.next(Na(t.access));let n=this.token$.getValue();this.streamState$=this.client.state$,n&&this.scheduleProactiveRefresh(n),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{this.handleStorageChange(e,t)})??null,this.ready=this.validate(t)}async validate(e){if(!e)return;let t=bu(e.access)?this.doRefresh?await this.doRefresh():null:e.access;if(!t){bu(e.access)&&vu(this.storage,this.kb.id);return}if(t!==e.access&&(this.token$.next(Na(t)),this.scheduleProactiveRefresh(t)),!this.doValidate)return;let n=async e=>{if(!this.disposed)try{let t=await this.doValidate(Na(e));if(this.disposed)return;this.user$.next(t)}catch(e){if(this.disposed)return;if(e instanceof Rl&&e.status===401){let e=this.doRefresh?await this.doRefresh():null;if(this.disposed)return;if(e){this.token$.next(Na(e)),this.scheduleProactiveRefresh(e),await n(e);return}vu(this.storage,this.kb.id),this.token$.next(null),this.onAuthFailed(`Your session has expired. Please sign in again.`)}else this.onError(new ku(`session.auth-failed`,e instanceof Error?e.message:String(e),this.kb.id))}};await n(t)}async refresh(){if(this.disposed||!this.doRefresh)return null;let e=await this.doRefresh();if(this.disposed)return null;if(e){let t=Na(e);return this.token$.next(t),this.scheduleProactiveRefresh(e),t}return this.token$.next(null),vu(this.storage,this.kb.id),this.onAuthFailed(`Your session has expired. Please sign in again.`),this.onError(new ku(`session.refresh-exhausted`,`Token refresh failed`,this.kb.id)),null}scheduleProactiveRefresh(e){this.clearRefreshTimer();let t=yu(e);if(!t)return;let n=t.getTime()-mu,r=Math.max(0,n-Date.now());this.refreshTimer=setTimeout(()=>{this.refreshTimer=null,this.disposed||this.refresh()},r)}clearRefreshTimer(){this.refreshTimer&&=(clearTimeout(this.refreshTimer),null)}handleStorageChange(e,t){if(!this.disposed&&e===hu(this.kb.id)){if(!t){this.token$.next(null),this.user$.next(null),this.clearRefreshTimer();return}try{let e=JSON.parse(t);typeof e.access==`string`&&(this.token$.next(Na(e.access)),this.scheduleProactiveRefresh(e.access))}catch{}}}get expiresAt(){let e=this.token$.getValue();return e?yu(e):null}subscribe(e,t){let n=this.client.bus.get(e).subscribe(t);return()=>n.unsubscribe()}async dispose(){this.disposed||(this.disposed=!0,this.clearRefreshTimer(),this.unsubscribeStorage&&=(this.unsubscribeStorage(),null),this.client.dispose(),this.token$.complete(),this.user$.complete())}static fromHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(t.token==null?null:typeof t.token==`string`?Na(t.token):t.token),i=new zl({baseUrl:n,token$:r}),a=new uu(i,new Bl(i),i),o={kb:t.kb,storage:t.storage,client:a,token$:r};return t.refresh&&(o.refresh=t.refresh),t.validate&&(o.validate=t.validate),t.onAuthFailed&&(o.onAuthFailed=t.onAuthFailed),t.onError&&(o.onError=t.onError),new e(o)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(null),i=new zl({baseUrl:n,token$:r}),a=new uu(i,new Bl(i),i),o;try{o=await a.auth.password(t.email,t.password)}catch(e){throw a.dispose(),e}_u(t.storage,t.kb.id,{access:o.token,refresh:o.refreshToken}),r.next(Na(o.token));let s={kb:t.kb,storage:t.storage,client:a,token$:r,refresh:async()=>{let e=gu(t.storage,t.kb.id);if(!e)return null;try{return(await a.auth.refresh(e.refresh)).access_token}catch{return null}}};t.validate&&(s.validate=t.validate),t.onAuthFailed&&(s.onAuthFailed=t.onAuthFailed),t.onError&&(s.onError=t.onError);let c=new e(s);return await c.ready,c}},ju=class{sessionExpiredAt$;sessionExpiredMessage$;permissionDeniedAt$;permissionDeniedMessage$;constructor(){this.sessionExpiredAt$=new _i(null),this.sessionExpiredMessage$=new _i(null),this.permissionDeniedAt$=new _i(null),this.permissionDeniedMessage$=new _i(null)}notifySessionExpired(e){this.sessionExpiredMessage$.next(e??`Your session has expired. Please sign in again.`),this.sessionExpiredAt$.next(Date.now())}notifyPermissionDenied(e){this.permissionDeniedMessage$.next(e??`You do not have permission to perform this action.`),this.permissionDeniedAt$.next(Date.now())}acknowledgeSessionExpired(){this.sessionExpiredAt$.next(null),this.sessionExpiredMessage$.next(null)}acknowledgePermissionDenied(){this.permissionDeniedAt$.next(null),this.permissionDeniedMessage$.next(null)}dispose(){this.sessionExpiredAt$.complete(),this.sessionExpiredMessage$.complete(),this.permissionDeniedAt$.complete(),this.permissionDeniedMessage$.complete()}},Mu=`openDocuments`;function Nu(e){return[...e].sort((e,t)=>e.order!==void 0&&t.order!==void 0?e.order-t.order:e.openedAt-t.openedAt)}function Pu(e){try{let t=e.get(Mu);if(t)return Nu(JSON.parse(t))}catch{}return[]}var Fu=class{kbs$;activeKbId$;activeSession$;activeSignals$;sessionActivating$;openResources$;error$;identityToken$;storage;sessionFactory;eventBus=new Ja;unsubscribeStorage=null;disposed=!1;activating=null;constructor(e){this.storage=e.storage,this.sessionFactory=e.sessionFactory;let t=Su(this.storage),n=this.storage.get(pu),r=n&&t.some(e=>e.id===n)?n:t[0]?.id??null;this.kbs$=new _i(t),this.activeKbId$=new _i(r),this.activeSession$=new _i(null),this.activeSignals$=new _i(null),this.sessionActivating$=new _i(!1),this.openResources$=new _i(Pu(this.storage)),this.error$=new hi,this.identityToken$=new _i(null),this.kbs$.subscribe(e=>Cu(this.storage,e)),this.activeKbId$.subscribe(e=>{e?this.storage.set(pu,e):this.storage.delete(pu)}),this.openResources$.subscribe(e=>{this.storage.set(Mu,JSON.stringify(e))}),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{if(!(e!==Mu||!t))try{this.openResources$.next(Nu(JSON.parse(t)))}catch{}})??null,r&&this.setActiveKb(r)}emit(e,t){this.disposed||this.eventBus.get(e).next(t)}on(e,t){let n=this.eventBus.get(e).subscribe(t);return()=>n.unsubscribe()}stream(e){return this.eventBus.get(e).asObservable()}setIdentityToken(e){this.disposed||this.identityToken$.next(e)}addKb(e,t,n){let r={id:Ou(),...e};return _u(this.storage,r.id,{access:t,refresh:n}),this.kbs$.next([...this.kbs$.getValue(),r]),this.setActiveKb(r.id),r}removeKb(e){vu(this.storage,e);let t=this.kbs$.getValue().filter(t=>t.id!==e);this.kbs$.next(t),this.activeKbId$.getValue()===e&&this.setActiveKb(t[0]?.id??null)}updateKb(e,t){this.kbs$.next(this.kbs$.getValue().map(n=>n.id===e?{...n,...t}:n))}getKbSessionStatus(e){let t=gu(this.storage,e);return t?bu(t.access)?`expired`:`authenticated`:`signed-out`}async setActiveKb(e){if(this.disposed)return;let t=this.activeKbId$.getValue(),n=this.activeSession$.getValue();if(e===t&&n)return;for(t!==e&&this.activeKbId$.next(e),n&&(this.activeSession$.next(null),this.activeSignals$.next(null));this.activating;)if(await this.activating,this.disposed||this.activeKbId$.getValue()!==e)return;let r=(async()=>{let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();if(t&&(this.activeSession$.next(null),this.activeSignals$.next(null),await t.dispose(),n?.dispose()),!e)return;let r=this.kbs$.getValue().find(t=>t.id===e);if(!r)return;let i=new ju,a;try{a=this.sessionFactory({kb:r,storage:this.storage,signals:i,onError:e=>this.error$.next(e)})}catch(t){this.error$.next(t instanceof ku?t:new ku(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),i.dispose();return}a.errors$.subscribe(e=>{e.code===`unauthorized`?i.notifySessionExpired(e.message):e.code===`forbidden`&&i.notifyPermissionDenied(e.message)});try{await a.ready}catch(t){this.error$.next(new ku(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),await a.dispose(),i.dispose();return}if(this.disposed||this.activeKbId$.getValue()!==e){await a.dispose(),i.dispose();return}this.activeSession$.next(a),this.activeSignals$.next(i)})();this.activating=r,this.sessionActivating$.next(!0);try{await r}finally{this.activating===r&&(this.activating=null,this.sessionActivating$.next(!1))}}async signIn(e,t,n){if(!this.disposed){if(_u(this.storage,e,{access:t,refresh:n}),this.activeKbId$.getValue()===e){let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),t&&await t.dispose(),n?.dispose(),await this.setActiveKb(e);return}await this.setActiveKb(e)}}async signOut(e){if(!this.disposed&&(vu(this.storage,e),this.kbs$.next([...this.kbs$.getValue()]),this.activeKbId$.getValue()===e)){let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose()}}addOpenResource(e,t,n,r){let i=this.openResources$.getValue(),a=i.findIndex(t=>t.id===e);if(a>=0){let e={...i[a],name:t,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}},o=[...i];o[a]=e,this.openResources$.next(o);return}let o={id:e,name:t,openedAt:Date.now(),order:i.length,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}};this.openResources$.next([...i,o])}removeOpenResource(e){this.openResources$.next(this.openResources$.getValue().filter(t=>t.id!==e))}updateOpenResourceName(e,t){this.openResources$.next(this.openResources$.getValue().map(n=>n.id===e?{...n,name:t}:n))}reorderOpenResources(e,t){let n=[...this.openResources$.getValue()];if(e<0||e>=n.length||t<0||t>=n.length)return;let[r]=n.splice(e,1);r&&n.splice(t,0,r),this.openResources$.next(n)}async dispose(){if(this.disposed)return;this.disposed=!0,this.unsubscribeStorage&&=(this.unsubscribeStorage(),null);let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose(),this.kbs$.complete(),this.activeKbId$.complete(),this.activeSession$.complete(),this.activeSignals$.complete(),this.openResources$.complete(),this.error$.complete(),this.identityToken$.complete(),this.eventBus.destroy()}};function Iu(){let e=new Map;return t=>{let{kb:n,storage:r,signals:i,onError:a}=t;if(n.endpoint.kind!==`http`)throw new ku(`session.construct-failed`,`HTTP session factory cannot construct a session for endpoint kind "${n.endpoint.kind}"`,n.id);let o=n.endpoint,s=async()=>{let t=e.get(n.id);if(t)return t;let i=(async()=>{let e=gu(r,n.id);if(!e)return null;let t=new zl({baseUrl:La(Du(o))}),i=new uu(t,new Bl(t),t);try{let t=(await i.auth.refresh(e.refresh)).access_token;return t?(_u(r,n.id,{access:t,refresh:e.refresh}),t):null}catch{return null}finally{i.dispose()}})();e.set(n.id,i);try{return await i}finally{e.delete(n.id)}},c=async e=>{let t=new _i(e),n=new zl({baseUrl:La(Du(o)),token$:t}),r=new uu(n,new Bl(n),n);try{return await r.auth.me()}finally{r.dispose(),t.complete()}},l=new _i(null),u,d=new zl({baseUrl:La(Du(o)),token$:l,tokenRefresher:()=>u.refresh().then(e=>e??null)});return u=new Au({kb:n,storage:r,client:new uu(d,new Bl(d),d),token$:l,refresh:s,validate:c,onAuthFailed:e=>i.notifySessionExpired(e),onError:a}),u}}var Lu=null;function Ru(e){return Lu||=new Fu({storage:e.storage,sessionFactory:e.sessionFactory}),Lu}function zu(){let e=new Nr;return{add:t=>e.add(typeof t==`function`?t:()=>t.dispose()),dispose:()=>e.unsubscribe()}}function Bu(e,t={}){let n=t.debounceMs??250,r=t.initialQuery??``,i=new hi;return{query$:i.pipe(Oa(r)),state$:i.pipe(Oa(r),Sa(n),wa(),ka(t=>{let n=t.trim();return n?e(n).pipe(pa(e=>({results:e??[],isSearching:e===void 0})),Oa({results:[],isSearching:!0})):ia({results:[],isSearching:!1})})),setQuery:e=>i.next(e),dispose:()=>i.complete()}}function Vu(e){let t=[],n=new _i(null);return t.push(e.bus.get(`beckon:hover`).subscribe(({annotationId:t})=>{n.next(t),t&&e.bus.get(`beckon:sparkle`).next({annotationId:t})})),t.push(e.bus.get(`browse:click`).subscribe(({annotationId:t})=>{e.bus.get(`beckon:focus`).next({annotationId:t})})),{hoveredAnnotationId$:n.asObservable(),hover:t=>e.bus.get(`beckon:hover`).next({annotationId:t}),focus:t=>e.bus.get(`beckon:focus`).next({annotationId:t}),sparkle:t=>e.bus.get(`beckon:sparkle`).next({annotationId:t}),dispose(){t.forEach(e=>e.unsubscribe()),n.complete()}}}function Hu(e,t){let n=null,r=null,i=()=>{r!==null&&(clearTimeout(r),r=null)};return{handleMouseEnter:a=>{n!==a&&(i(),r=setTimeout(()=>{r=null,n=a,e(a)},t))},handleMouseLeave:()=>{i(),n!==null&&(n=null,e(null))},cleanup:i}}function Uu(e,t){let n=[],r=new _i(null),i=new _i(!1),a=new _i(null),o=new _i(null);return n.push(e.bus.get(`gather:requested`).subscribe(s=>{i.next(!0),a.next(null),r.next(null),o.next(za(s.annotationId));let c=e.gather.annotation(t,za(s.annotationId),{contextWindow:s.options?.contextWindow??2e3}).pipe(da(6e4)).subscribe({next:e=>{`response`in e&&e.response&&(r.next(e.response.context??null),i.next(!1))},error:e=>{a.next(e instanceof Error?e:Error(String(e))),i.next(!1)},complete:()=>{i.next(!1)}});n.push(c)})),{context$:r.asObservable(),loading$:i.asObservable(),error$:a.asObservable(),annotationId$:o.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete(),o.complete()}}}function Wu(e,t){let n=[];return n.push(e.bus.get(`match:search-requested`).subscribe(t=>{let r=e.match.search(Ra(t.resourceId),za(t.referenceId),t.context,{limit:t.limit,useSemanticScoring:t.useSemanticScoring}).pipe(da(6e4)).subscribe({next:t=>e.bus.get(`match:search-results`).next(t),error:n=>e.bus.get(`match:search-failed`).next({correlationId:t.correlationId,referenceId:t.referenceId,error:n instanceof Error?n.message:String(n)})});n.push(r)})),{dispose(){n.forEach(e=>e.unsubscribe())}}}function Gu(e,t,n){let r=[],i=new _i(!1),a=new _i(null),o=null;return{isGenerating$:i.asObservable(),progress$:a.asObservable(),generate:(s,c)=>{let l=e.yield.fromAnnotation(Ra(t),za(s),{...c,language:c.language||n}).pipe(da({each:3e5})).subscribe({next:e=>{e.kind===`progress`&&(a.next(e.data),i.next(!0))},complete:()=>{i.next(!1),o&&clearTimeout(o),o=setTimeout(()=>{a.next(null),o=null},2e3)},error:()=>{a.next(null),i.next(!1)}});r.push(l)},dispose(){r.forEach(e=>e.unsubscribe()),o&&clearTimeout(o),i.complete(),a.complete()}}}function Ku(e){if(e.svgSelector)return{type:`SvgSelector`,value:e.svgSelector};if(e.fragmentSelector){let t=[{type:`FragmentSelector`,value:e.fragmentSelector,...e.conformsTo&&{conformsTo:e.conformsTo}}];return e.exact&&t.push({type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}),t}return{type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}}function qu(e,t){let n=[],r=new _i(null),i=new _i(null),a=new _i(null),o=null,s=()=>{o&&=(clearTimeout(o),null)},c=e=>{r.next(e)};return n.push(e.bus.get(`mark:requested`).subscribe(c)),n.push(e.bus.get(`mark:select-comment`).subscribe(e=>c({selector:Ku(e),motivation:`commenting`}))),n.push(e.bus.get(`mark:select-tag`).subscribe(e=>c({selector:Ku(e),motivation:`tagging`}))),n.push(e.bus.get(`mark:select-assessment`).subscribe(e=>c({selector:Ku(e),motivation:`assessing`}))),n.push(e.bus.get(`mark:select-reference`).subscribe(e=>c({selector:Ku(e),motivation:`linking`}))),n.push(e.bus.get(`mark:cancel-pending`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:create-ok`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:submit`).subscribe(async n=>{try{let r=await e.mark.annotation({motivation:n.motivation,target:{source:t,selector:n.selector},body:n.body});e.bus.get(`mark:create-ok`).next({annotationId:r.annotationId})}catch(t){e.bus.get(`mark:create-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:delete`).subscribe(async n=>{try{await e.mark.delete(t,n.annotationId),e.bus.get(`mark:delete-ok`).next({annotationId:n.annotationId})}catch(t){e.bus.get(`mark:delete-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:assist-request`).subscribe(r=>{s(),i.next(r.motivation),a.next(null);let c=e.mark.assist(t,r.motivation,r.options).pipe(da({each:18e4})).subscribe({next:e=>{e.kind===`progress`&&a.next(e.data)},complete:()=>{i.next(null),s(),o=setTimeout(()=>{a.next(null),o=null},5e3)},error:()=>{s(),i.next(null),a.next(null)}});n.push(c)})),n.push(e.bus.get(`mark:progress-dismiss`).subscribe(()=>{s(),a.next(null)})),{pendingAnnotation$:r.asObservable(),assistingMotivation$:i.asObservable(),progress$:a.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),s(),r.complete(),i.complete(),a.complete()}}}var Ju=p({"../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isFunction=void 0;function t(e){return typeof e==`function`}e.isFunction=t}}),Yu=p({"../../node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createErrorClass=void 0;function t(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}e.createErrorClass=t}}),Xu=p({"../../node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.UnsubscriptionError=void 0,e.UnsubscriptionError=Yu().createErrorClass(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
8
|
+
`);o=i.pop();for(let e of i)if(e.startsWith(`data: `)){let t=JSON.parse(e.slice(6));n.next(t)}}n.complete()}catch(e){n.closed||n.error(e)}})(),()=>r.abort()})}async healthCheck(){return this.http.get(`${this.baseUrl}/api/health`,{headers:this.authHeaders()}).json()}async getStatus(){return this.http.get(`${this.baseUrl}/api/status`,{headers:this.authHeaders()}).json()}get rawHttp(){return this.http}getToken(){return this.token$.getValue()??void 0}},Bl=class{constructor(e){this.transport=e}async putBinary(e,t){let n=e.file instanceof File?e.file.size:e.file.length;return qa(`PUT`,`content`,{name:e.name,format:e.format,storageUri:e.storageUri,sizeBytes:n}),Sl(`content.put`,async()=>{let n=Vl(e),r=this.requestHeaders(t?.auth);return typeof XMLHttpRequest<`u`&&(t?.onProgress||t?.signal)?Hl({url:`${this.transport.baseUrl}/resources`,formData:n,headers:r,onProgress:t.onProgress,signal:t.signal,onApiError:e=>this.transport.pushError(e)}):{resourceId:(await this.transport.rawHttp.post(`${this.transport.baseUrl}/resources`,{body:n,headers:r}).json()).resourceId}},{kind:rl.CLIENT,attrs:{"content.format":e.format,"content.size_bytes":n}})}async getBinary(e,t){return qa(`GET`,`content`,{resourceId:e,accept:t?.accept}),Sl(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:{Accept:t?.accept??`text/plain`,...this.requestHeaders(t?.auth)}}),r=n.headers.get(`content-type`)||`application/octet-stream`;return{data:await n.arrayBuffer(),contentType:r}},{kind:rl.CLIENT,attrs:{"resource.id":e}})}async getBinaryStream(e,t){return qa(`GET`,`content`,{resourceId:e,accept:t?.accept,stream:!0}),Sl(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:{Accept:t?.accept??`text/plain`,...this.requestHeaders(t?.auth)}}),r=n.headers.get(`content-type`)||`application/octet-stream`;if(!n.body)throw Error(`Response body is null - cannot create stream`);return{stream:n.body,contentType:r}},{kind:rl.CLIENT,attrs:{"resource.id":e,"content.stream":!0}})}dispose(){}requestHeaders(e){let t=e??this.transport.getToken(),n=t?{Authorization:`Bearer ${t}`}:{},r=wl();return r&&(n.traceparent=r.traceparent,r.tracestate&&(n.tracestate=r.tracestate)),n}};function Vl(e){let t=new FormData;if(t.append(`name`,e.name),t.append(`format`,e.format),t.append(`storageUri`,e.storageUri),e.file instanceof File)t.append(`file`,e.file);else if(typeof Buffer<`u`&&Buffer.isBuffer(e.file)){let n=new Blob([new Uint8Array(e.file)],{type:e.format});t.append(`file`,n,e.name)}else throw Error(`file must be a File or Buffer`);return e.entityTypes&&e.entityTypes.length>0&&t.append(`entityTypes`,JSON.stringify(e.entityTypes)),e.language&&t.append(`language`,e.language),e.sourceAnnotationId&&t.append(`sourceAnnotationId`,String(e.sourceAnnotationId)),e.sourceResourceId&&t.append(`sourceResourceId`,String(e.sourceResourceId)),e.generationPrompt&&t.append(`generationPrompt`,e.generationPrompt),e.generator&&t.append(`generator`,JSON.stringify(e.generator)),e.isDraft!==void 0&&t.append(`isDraft`,String(e.isDraft)),t}function Hl(e){let{url:t,formData:n,headers:r,onProgress:i,signal:a,onApiError:o}=e;return new Promise((e,s)=>{let c=new XMLHttpRequest;if(a?.aborted){let e=new Rl(`Upload aborted`,0,`aborted`);o(e),s(e);return}c.open(`POST`,t);for(let[e,t]of Object.entries(r))c.setRequestHeader(e,t);i&&(c.upload.onprogress=e=>{let t=e.lengthComputable?e.total:0;i({bytesUploaded:e.loaded,totalBytes:t})}),c.onload=()=>{if(c.status>=200&&c.status<300){try{e({resourceId:JSON.parse(c.responseText).resourceId})}catch(e){let t=new Rl(`Upload succeeded but response was not valid JSON: ${e.message}`,c.status,c.statusText,c.responseText);o(t),s(t)}return}let t=c.responseText;try{t=JSON.parse(c.responseText)}catch{}let n=new Rl(t&&typeof t==`object`&&`message`in t&&typeof t.message==`string`?t.message:`HTTP ${c.status}: ${c.statusText}`,c.status,c.statusText,t);o(n),s(n)},c.onerror=()=>{let e=new Rl(`Network error during upload`,0,`network-error`);o(e),s(e)},c.ontimeout=()=>{let e=new Rl(`Upload timed out`,0,`timeout`);o(e),s(e)},c.onabort=()=>{let e=new Rl(`Upload aborted`,0,`aborted`);o(e),s(e)},a&&a.addEventListener(`abort`,()=>c.abort(),{once:!0}),c.send(n)})}var Ul=class e extends oi{then(e,t){return sa(this).then(e,t)}static from(t){return new e(e=>t.subscribe(e))}},Wl=class e extends oi{then(e,t){return ca(this.pipe(ba(e=>e!==void 0))).then(e,t)}static from(t){let n=Gl.get(t);return n||(n=new e(e=>t.subscribe(e)),Gl.set(t,n)),n}},Gl=new WeakMap,Kl=class extends oi{then(e,t){return sa(this).then(t=>{if(t.phase!==`finished`)throw Error(`UploadObservable resolved on a non-finished event: ${t.phase}`);let n={resourceId:t.resourceId};return e?e(n):n},t)}},ql=class extends zo{constructor(e,t,n){super(e,t,n),this.name=`BusRequestError`}};async function Jl(e,t,n,r,i,a=3e4){let o=crypto.randomUUID(),s={...n,correlationId:o},c=ca(ya(e.stream(r).pipe(ba(e=>e.correlationId===o),pa(e=>({ok:!0,response:e.response}))),e.stream(i).pipe(ba(e=>e.correlationId===o),pa(e=>({ok:!1,error:new ql(e.message??`Bus request rejected`,`bus.rejected`,{channel:i,correlationId:o,payload:e})})))).pipe(Ca(1),da(a),xa(e=>e instanceof ua?aa(()=>new ql(`Bus request timed out after ${a}ms on ${r}`,`bus.timeout`,{channel:t,resultChannel:r,correlationId:o,timeoutMs:a})):aa(()=>e))));try{await e.emit(t,s)}catch(e){throw c.catch(()=>{}),e}let l=await c;if(!l.ok)throw l.error;return l.response}function Yl(e){let t=new _i(new Map),n=new Set,r=new Map,i=async r=>{if(!n.has(r)){n.add(r);try{let n=await e(r),i=new Map(t.value);i.set(r,n),t.next(i)}catch{}finally{n.delete(r)}}};return{observe(e){!t.value.has(e)&&!n.has(e)&&i(e);let a=r.get(e);return a||(a=t.pipe(pa(t=>t.get(e)),wa()),r.set(e,a)),a},get(e){return t.value.get(e)},keys(){return[...t.value.keys()]},invalidate(e){n.delete(e),i(e)},remove(e){let r=new Map(t.value);r.delete(e),t.next(r),n.delete(e)},set(e,n){let r=new Map(t.value);r.set(e,n),t.next(r)},invalidateAll(){for(let e of t.value.keys())n.delete(e),i(e)},dispose(){t.complete(),r.clear(),n.clear()}}}var Xl=`_`,Zl=`_`,Ql=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n,this.resourceCache=Yl(async e=>(await Jl(this.transport,`browse:resource-requested`,{resourceId:e},`browse:resource-result`,`browse:resource-failed`)).resource),this.resourceListCache=Yl(async e=>{let t=this.resourceListFilters.get(e)??{},n=t.search?Ia(t.search):void 0;return(await Jl(this.transport,`browse:resources-requested`,{search:n,archived:t.archived,limit:t.limit??100,offset:0},`browse:resources-result`,`browse:resources-failed`)).resources}),this.annotationListCache=Yl(async e=>Jl(this.transport,`browse:annotations-requested`,{resourceId:e},`browse:annotations-result`,`browse:annotations-failed`)),this.annotationDetailCache=Yl(async e=>{let t=this.annotationResources.get(e);if(!t)throw Error(`Cannot fetch annotation ${e}: no resourceId known`);return(await Jl(this.transport,`browse:annotation-requested`,{resourceId:t,annotationId:e},`browse:annotation-result`,`browse:annotation-failed`)).annotation}),this.entityTypesCache=Yl(async()=>(await Jl(this.transport,`browse:entity-types-requested`,{},`browse:entity-types-result`,`browse:entity-types-failed`)).entityTypes),this.tagSchemasCache=Yl(async()=>(await Jl(this.transport,`browse:tag-schemas-requested`,{},`browse:tag-schemas-result`,`browse:tag-schemas-failed`)).tagSchemas),this.referencedByCache=Yl(async e=>(await Jl(this.transport,`browse:referenced-by-requested`,{resourceId:e},`browse:referenced-by-result`,`browse:referenced-by-failed`)).referencedBy),this.resourceEventsCache=Yl(async e=>(await Jl(this.transport,`browse:events-requested`,{resourceId:e},`browse:events-result`,`browse:events-failed`)).events),this.subscribeToEvents()}resourceCache;resourceListCache;annotationListCache;annotationDetailCache;annotationResources=new Map;entityTypesCache;tagSchemasCache;referencedByCache;resourceEventsCache;resourceListFilters=new Map;annotationListObs=new Map;resource(e){return Wl.from(this.resourceCache.observe(e))}resources(e){let t=JSON.stringify(e??{});return this.resourceListFilters.set(t,e??{}),Wl.from(this.resourceListCache.observe(t))}annotations(e){let t=this.annotationListObs.get(e);return t||(t=this.annotationListCache.observe(e).pipe(pa(e=>e?.annotations)),this.annotationListObs.set(e,t)),Wl.from(t)}annotation(e,t){return this.annotationResources.set(t,e),Wl.from(this.annotationDetailCache.observe(t))}entityTypes(){return Wl.from(this.entityTypesCache.observe(Xl))}tagSchemas(){return Wl.from(this.tagSchemasCache.observe(Zl))}referencedBy(e){return Wl.from(this.referencedByCache.observe(e))}events(e){return Wl.from(this.resourceEventsCache.observe(e))}async resourceContent(e){let t=await this.content.getBinary(e,{accept:`text/plain`});return new TextDecoder().decode(t.data)}async resourceRepresentation(e,t){return this.content.getBinary(e,t?.accept?{accept:t.accept}:void 0)}async resourceRepresentationStream(e,t){return this.content.getBinaryStream(e,t?.accept?{accept:t.accept}:void 0)}async resourceEvents(e){return(await Jl(this.transport,`browse:events-requested`,{resourceId:e},`browse:events-result`,`browse:events-failed`)).events}async annotationHistory(e,t){return Jl(this.transport,`browse:annotation-history-requested`,{resourceId:e,annotationId:t},`browse:annotation-history-result`,`browse:annotation-history-failed`)}async connections(e){throw Error(`Not implemented: connections endpoint does not exist yet`)}async backlinks(e){throw Error(`Not implemented: backlinks endpoint does not exist yet`)}async resourcesByName(e,t){throw Error(`Not implemented: resourcesByName endpoint does not exist yet`)}async files(e,t){return Jl(this.transport,`browse:directory-requested`,{path:e??`.`,sort:t??`name`},`browse:directory-result`,`browse:directory-failed`)}click(e,t){this.bus.get(`browse:click`).next({annotationId:e,motivation:t})}navigateReference(e){this.bus.get(`browse:reference-navigate`).next({resourceId:e})}invalidateAnnotationList(e){this.annotationListCache.invalidate(e)}removeAnnotationDetail(e){this.annotationDetailCache.remove(e),this.annotationResources.delete(e)}invalidateResourceDetail(e){this.resourceCache.invalidate(e)}invalidateResourceLists(){this.resourceListCache.invalidateAll()}invalidateEntityTypes(){this.entityTypesCache.invalidate(Xl)}invalidateTagSchemas(){this.tagSchemasCache.invalidate(Zl)}invalidateReferencedBy(e){this.referencedByCache.invalidate(e)}invalidateResourceEvents(e){this.resourceEventsCache.invalidate(e)}updateAnnotationInPlace(e,t){let n=this.annotationListCache.get(e);if(n){let r=n.annotations.findIndex(e=>e.id===t.id),i=r>=0?n.annotations.map((e,n)=>n===r?t:e):[...n.annotations,t];this.annotationListCache.set(e,{...n,annotations:i})}let r=za(t.id);this.annotationResources.set(r,e),this.annotationDetailCache.set(r,t)}on(e,t){this.bus.get(e).subscribe(t)}onEntityTagChanged=e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceDetail(e.resourceId),this.invalidateResourceEvents(e.resourceId))};onArchiveToggled=e=>{e.resourceId&&(this.invalidateResourceDetail(e.resourceId),this.invalidateResourceLists())};onYieldResourceMutated=e=>{let t=Ra(e.resourceId);this.invalidateResourceDetail(t),this.invalidateResourceLists()};subscribeToEvents(){this.on(`bus:resume-gap`,e=>{let t=e.scope;if(t){let e=t;this.invalidateAnnotationList(e),this.invalidateResourceDetail(e),this.invalidateResourceEvents(e),this.invalidateReferencedBy(e)}else{this.invalidateResourceLists();for(let e of this.annotationListCache.keys())this.invalidateAnnotationList(e);for(let e of this.resourceCache.keys())this.invalidateResourceDetail(e);for(let e of this.resourceEventsCache.keys())this.invalidateResourceEvents(e);for(let e of this.referencedByCache.keys())this.invalidateReferencedBy(e)}this.invalidateEntityTypes(),this.invalidateTagSchemas()}),this.on(`mark:delete-ok`,e=>{this.removeAnnotationDetail(za(e.annotationId))}),this.on(`mark:added`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId))}),this.on(`mark:removed`,e=>{e.resourceId&&(this.invalidateAnnotationList(e.resourceId),this.invalidateResourceEvents(e.resourceId)),this.removeAnnotationDetail(za(e.payload.annotationId))}),this.on(`mark:body-updated`,e=>{let t=e;!t.resourceId||!t.annotation||(this.updateAnnotationInPlace(t.resourceId,t.annotation),this.invalidateResourceEvents(t.resourceId))}),this.on(`mark:entity-tag-added`,this.onEntityTagChanged),this.on(`mark:entity-tag-removed`,this.onEntityTagChanged),this.on(`replay-window-exceeded`,e=>{e.resourceId&&this.invalidateAnnotationList(e.resourceId)}),this.on(`yield:create-ok`,this.onYieldResourceMutated),this.on(`yield:update-ok`,this.onYieldResourceMutated),this.on(`mark:archived`,this.onArchiveToggled),this.on(`mark:unarchived`,this.onArchiveToggled),this.on(`frame:entity-type-added`,()=>this.invalidateEntityTypes()),this.on(`frame:tag-schema-added`,()=>this.invalidateTagSchemas())}},$l=class{constructor(e,t){this.transport=e,this.bus=t}async annotation(e){let t=Ra(e.target.source);return{annotationId:za((await Jl(this.transport,`mark:create-request`,{resourceId:t,request:e},`mark:create-ok`,`mark:create-failed`)).annotationId)}}async delete(e,t){await this.transport.emit(`mark:delete`,{annotationId:t,resourceId:e})}async archive(e){await this.transport.emit(`mark:archive`,{resourceId:e})}async unarchive(e){await this.transport.emit(`mark:unarchive`,{resourceId:e})}assist(e,t,n){return new Ul(r=>{let i=!1,a=null,o=null,s=this.transport.subscribeToResource(e),c=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null),s&&=(s(),null)},l=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||Jl(this.transport,`job:status-requested`,{jobId:t},`job:status-result`,`job:status-failed`).then(n=>{i||(n.status===`complete`?(c(),r.next({kind:`complete`,data:{jobId:t,jobType:n.jobType??`annotation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(c(),r.error(Error(n.error??`Job failed`))))}).catch(()=>{})},5e3))},1e4)},u=null,d=this.bus.get(`job:report-progress`).pipe(ba(e=>e.jobId===u)),f=this.bus.get(`job:complete`).pipe(ba(e=>e.jobId===u)),p=this.bus.get(`job:fail`).pipe(ba(e=>e.jobId===u)),m=d.pipe(Aa(ya(f,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),u&&l(u)}),h=f.subscribe(e=>{c(),r.next({kind:`complete`,data:e}),r.complete()}),g=p.subscribe(e=>{c(),r.error(Error(e.error))});return this.dispatchAssist(e,t,n).then(({jobId:e})=>{e&&!i&&(u=e,l(e))}).catch(e=>{i||(c(),r.error(e))}),()=>{c(),m.unsubscribe(),h.unsubscribe(),g.unsubscribe()}})}request(e,t){this.bus.get(`mark:requested`).next({selector:e,motivation:t})}requestAssist(e,t,n){this.bus.get(`mark:assist-request`).next({motivation:e,options:t,...n?{correlationId:n}:{}})}submit(e){this.bus.get(`mark:submit`).next(e)}cancelPending(){this.bus.get(`mark:cancel-pending`).next(void 0)}dismissProgress(){this.bus.get(`mark:progress-dismiss`).next(void 0)}changeSelection(e){this.bus.get(`mark:selection-changed`).next({motivation:e})}changeClick(e){this.bus.get(`mark:click-changed`).next({action:e})}changeShape(e){this.bus.get(`mark:shape-changed`).next({shape:e})}toggleMode(){this.bus.get(`mark:mode-toggled`).next(void 0)}async dispatchAssist(e,t,n){let r={tagging:`tag-annotation`,linking:`reference-annotation`,highlighting:`highlight-annotation`,assessing:`assessment-annotation`,commenting:`comment-annotation`}[t];if(!r)throw Error(`Unsupported motivation: ${t}`);if(t===`tagging`){if(!n.schemaId)throw Error(`mark.assist with motivation "tagging" requires options.schemaId`);if(!n.categories?.length)throw Error(`mark.assist with motivation "tagging" requires a non-empty options.categories array`)}else if(t===`linking`&&!n.entityTypes?.length)throw Error(`mark.assist with motivation "linking" requires a non-empty entityTypes array`);let i={};return n.entityTypes&&(i.entityTypes=n.entityTypes),n.includeDescriptiveReferences!==void 0&&(i.includeDescriptiveReferences=n.includeDescriptiveReferences),n.instructions!==void 0&&(i.instructions=n.instructions),n.density!==void 0&&(i.density=n.density),n.tone!==void 0&&(i.tone=n.tone),n.language!==void 0&&(i.language=n.language),n.sourceLanguage!==void 0&&(i.sourceLanguage=n.sourceLanguage),n.schemaId!==void 0&&(i.schemaId=n.schemaId),n.categories!==void 0&&(i.categories=n.categories),Jl(this.transport,`job:create`,{jobType:r,resourceId:e,params:i},`job:created`,`job:create-failed`)}},eu=class{constructor(e,t){this.transport=e,this.bus=t}async body(e,t,n){await this.transport.emit(`bind:update-body`,{correlationId:crypto.randomUUID(),annotationId:t,resourceId:e,operations:n})}initiate(e){this.bus.get(`bind:initiate`).next(e)}},tu=class{constructor(e,t){this.transport=e,this.bus=t}annotation(e,t,n){return new Ul(r=>{let i=crypto.randomUUID(),a=this.bus.get(`gather:complete`).pipe(ba(e=>e.correlationId===i)),o=this.bus.get(`gather:failed`).pipe(ba(e=>e.correlationId===i)),s=ya(this.bus.get(`gather:annotation-progress`).pipe(ba(e=>e.annotationId===t),pa(e=>e)),a.pipe(pa(e=>e))).pipe(Aa(ya(a,o))).subscribe({next:e=>r.next(e),error:e=>r.error(e)}),c=a.subscribe(e=>{r.next(e),r.complete()}),l=o.subscribe(e=>{r.error(Error(e.message))});return this.transport.emit(`gather:requested`,{correlationId:i,annotationId:t,resourceId:e,options:{contextWindow:n?.contextWindow??2e3}}).catch(e=>{r.closed||r.error(e)}),()=>{s.unsubscribe(),c.unsubscribe(),l.unsubscribe()}})}resource(e,t){throw Error(`Not implemented: gather.resource() — no backend route yet`)}},nu=class{constructor(e,t){this.transport=e,this.bus=t}requestSearch(e){this.bus.get(`match:search-requested`).next(e)}search(e,t,n,r){return new Ul(i=>{let a=crypto.randomUUID(),o=this.bus.get(`match:search-results`).pipe(ba(e=>e.correlationId===a)),s=this.bus.get(`match:search-failed`).pipe(ba(e=>e.correlationId===a)),c=o.subscribe(e=>{i.next(e),i.complete()}),l=s.subscribe(e=>{i.error(Error(e.error))});return this.transport.emit(`match:search-requested`,{correlationId:a,resourceId:e,referenceId:t,context:n,limit:r?.limit??10,useSemanticScoring:r?.useSemanticScoring??!0}).catch(e=>{i.closed||i.error(e)}),()=>{c.unsubscribe(),l.unsubscribe()}})}},ru=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n}resource(e){let t=typeof Buffer<`u`&&e.file instanceof Buffer?e.file.length:e.file.size;return new Kl(n=>{n.next({phase:`started`,totalBytes:t});let r=!1,i=new AbortController;return this.content.putBinary({name:e.name,file:e.file,format:e.format,storageUri:e.storageUri,...e.entityTypes?{entityTypes:e.entityTypes}:{},...e.language?{language:e.language}:{},...e.sourceAnnotationId?{sourceAnnotationId:e.sourceAnnotationId}:{},...e.sourceResourceId?{sourceResourceId:e.sourceResourceId}:{},...e.generationPrompt?{generationPrompt:e.generationPrompt}:{},...e.generator?{generator:e.generator}:{},...e.isDraft===void 0?{}:{isDraft:e.isDraft}},{onProgress:({bytesUploaded:e,totalBytes:i})=>{if(r)return;let a=i>0?i:t;n.next({phase:`progress`,bytesUploaded:e,totalBytes:a})},signal:i.signal}).then(e=>{r||(n.next({phase:`finished`,resourceId:Ra(e.resourceId)}),n.complete())}).catch(e=>{r||n.error(e)}),()=>{r=!0,i.abort()}})}fromAnnotation(e,t,n){return new Ul(r=>{let i=!1,a=null,o=null,s=this.transport.subscribeToResource(e),c=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null),s&&=(s(),null)},l=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||Jl(this.transport,`job:status-requested`,{jobId:t},`job:status-result`,`job:status-failed`).then(n=>{i||(n.status===`complete`?(c(),r.next({kind:`complete`,data:{jobId:t,jobType:n.jobType??`generation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(c(),r.error(Error(n.error??`Generation failed`))))}).catch(()=>{})},5e3))},1e4)},u=null,d=this.bus.get(`job:report-progress`).pipe(ba(e=>e.jobId===u)),f=this.bus.get(`job:complete`).pipe(ba(e=>e.jobId===u)),p=this.bus.get(`job:fail`).pipe(ba(e=>e.jobId===u)),m=d.pipe(Aa(ya(f,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),u&&l(u)}),h=f.subscribe(e=>{c(),r.next({kind:`complete`,data:e}),r.complete()}),g=p.subscribe(e=>{c(),r.error(Error(e.error))});return Jl(this.transport,`job:create`,{jobType:`generation`,resourceId:e,params:{referenceId:t,title:n.title,prompt:n.prompt,entityTypes:n.entityTypes,language:n.language,sourceLanguage:n.sourceLanguage,temperature:n.temperature,maxTokens:n.maxTokens,storageUri:n.storageUri,context:n.context}},`job:created`,`job:create-failed`).then(({jobId:e})=>{e&&!i&&(u=e,l(e))}).catch(e=>{i||(c(),r.error(e))}),()=>{c(),m.unsubscribe(),h.unsubscribe(),g.unsubscribe()}})}async cloneToken(e){return Jl(this.transport,`yield:clone-token-requested`,{resourceId:e},`yield:clone-token-generated`,`yield:clone-token-failed`)}async fromToken(e){return(await Jl(this.transport,`yield:clone-resource-requested`,{token:e},`yield:clone-resource-result`,`yield:clone-resource-failed`)).sourceResource}async createFromToken(e){return{resourceId:Ra((await Jl(this.transport,`yield:clone-create`,e,`yield:clone-created`,`yield:clone-create-failed`)).resourceId)}}clone(){this.bus.get(`yield:clone`).next(void 0)}},iu=class{constructor(e,t){this.transport=e,this.bus=t}attention(e,t){this.transport.emit(`beckon:focus`,{annotationId:t,resourceId:e})}hover(e){this.bus.get(`beckon:hover`).next({annotationId:e})}sparkle(e){this.bus.get(`beckon:sparkle`).next({annotationId:e})}},au=class{constructor(e){this.transport=e}async addEntityType(e){await this.transport.emit(`frame:add-entity-type`,{tag:e})}async addEntityTypes(e){for(let t of e)await this.transport.emit(`frame:add-entity-type`,{tag:t})}async addTagSchema(e){await this.transport.emit(`frame:add-tag-schema`,{schema:e})}},ou=class{constructor(e,t){this.transport=e,this.bus=t}get queued$(){return this.bus.get(`job:queued`)}get progress$(){return this.bus.get(`job:report-progress`)}get complete$(){return this.bus.get(`job:complete`)}get fail$(){return this.bus.get(`job:fail`)}async status(e){return Jl(this.transport,`job:status-requested`,{jobId:e},`job:status-result`,`job:status-failed`)}async pollUntilComplete(e,t){let n=t?.interval??1e3,r=t?.timeout??6e4,i=Date.now();for(;;){let a=await this.status(e);if(t?.onProgress&&t.onProgress(a),a.status===`complete`||a.status===`failed`||a.status===`cancelled`)return a;if(Date.now()-i>r)throw Error(`Job polling timeout after ${r}ms`);await new Promise(e=>setTimeout(e,n))}}async cancelByType(e){await this.transport.emit(`job:cancel-requested`,{jobType:e})}cancelRequest(e){this.bus.get(`job:cancel-requested`).next({jobType:e})}},su=class{constructor(e){this.backend=e}async password(e,t){return this.backend.authenticatePassword(ja(e),t)}async google(e){return this.backend.authenticateGoogle(Ma(e))}async refresh(e){return this.backend.refreshAccessToken(Pa(e))}async logout(){await this.backend.logout()}async me(){return this.backend.getCurrentUser()}async acceptTerms(){await this.backend.acceptTerms()}async mcpToken(){return this.backend.generateMcpToken()}async mediaToken(e){return this.backend.getMediaToken(e)}},cu=class{constructor(e){this.backend=e}async users(){return(await this.backend.listUsers()).users}async userStats(){return this.backend.getUserStats()}async updateUser(e,t){return(await this.backend.updateUser(e,t)).user}async oauthConfig(){return this.backend.getOAuthConfig()}async healthCheck(){return this.backend.healthCheck()}async status(){return this.backend.getStatus()}async backup(){return this.backend.backupKnowledgeBase()}restore(e){return lu(this.backend.restoreKnowledgeBase(e))}async exportKnowledgeBase(e){return this.backend.exportKnowledgeBase(e)}importKnowledgeBase(e){return lu(this.backend.importKnowledgeBase(e))}};function lu(e){return new Ul(t=>{let n=e.subscribe({next:e=>t.next(e),error:e=>t.error(e),complete:()=>t.complete()});return()=>n.unsubscribe()})}var uu=class e{transport;content;bus;baseUrl;frame;browse;mark;bind;gather;match;yield;beckon;job;auth;admin;constructor(e,t,n){this.transport=e,this.content=t,this.baseUrl=e.baseUrl,this.bus=new Ja,this.transport.bridgeInto(this.bus),this.frame=new au(this.transport),this.browse=new Ql(this.transport,this.bus,this.content),this.mark=new $l(this.transport,this.bus),this.bind=new eu(this.transport,this.bus),this.gather=new tu(this.transport,this.bus),this.match=new nu(this.transport,this.bus),this.yield=new ru(this.transport,this.bus,this.content),this.beckon=new iu(this.transport,this.bus),this.job=new ou(this.transport,this.bus),this.auth=n?new su(n):void 0,this.admin=n?new cu(n):void 0}get state$(){return this.transport.state$}subscribeToResource(e){return this.transport.subscribeToResource(e)}dispose(){this.transport.dispose(),this.content.dispose()}static fromHttp(t){let n=new zl({baseUrl:typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,token$:new _i(t.token==null?null:typeof t.token==`string`?Na(t.token):t.token)});return new e(n,new Bl(n),n)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(null),i=new zl({baseUrl:n,token$:r}),a=new e(i,new Bl(i),i);try{let e=await a.auth.password(t.email,t.password);return r.next(Na(e.token)),a}catch(e){throw a.dispose(),e}}},du=`semiont.session.`,fu=`semiont.knowledgeBases`,pu=`semiont.activeKnowledgeBaseId`,mu=300*1e3;function hu(e){return`${du}${e}`}function gu(e,t){let n=e.get(hu(t));if(!n)return null;try{let e=JSON.parse(n);if(e&&typeof e.access==`string`&&typeof e.refresh==`string`)return{access:e.access,refresh:e.refresh}}catch{}return null}function _u(e,t,n){e.set(hu(t),JSON.stringify(n))}function vu(e,t){e.delete(hu(t))}function yu(e){try{let t=e.split(`.`);if(t.length!==3||!t[1])return null;let n=JSON.parse(atob(t[1]));return n.exp?new Date(n.exp*1e3):null}catch{return null}}function bu(e){let t=yu(e);return t?t.getTime()<Date.now():!0}function xu(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||typeof t.label!=`string`||typeof t.email!=`string`)return!1;let n=t.endpoint;return!n||typeof n!=`object`?!1:n.kind===`http`?typeof n.host==`string`&&typeof n.port==`number`&&(n.protocol===`http`||n.protocol===`https`):n.kind===`local`?typeof n.kbId==`string`:!1}function Su(e){try{let t=e.get(fu);return t?JSON.parse(t).filter(xu):[]}catch{return[]}}function Cu(e,t){e.set(fu,JSON.stringify(t))}function wu(e){return e===`localhost`||e===`127.0.0.1`?`http`:`https`}var Tu=/^(([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?|localhost|\d{1,3}(\.\d{1,3}){3})$/;function Eu(e){return Tu.test(e)}function Du(e){if(!Eu(e.host))throw Error(`Invalid KB hostname: "${e.host}"`);let t=new URL(`http://x`);return t.protocol=e.protocol+`:`,t.hostname=e.host,t.port=String(e.port),`${e.protocol}://${t.hostname}:${e.port}`}function Ou(){return crypto.randomUUID()}var ku=class extends zo{kbId;constructor(e,t,n=null){super(t,e,{kbId:n}),this.name=`SemiontSessionError`,this.kbId=n}},Au=class e{kb;client;token$;user$;streamState$;errors$;ready;storage;doRefresh;doValidate;onAuthFailed;onError;refreshTimer=null;unsubscribeStorage=null;disposed=!1;constructor(e){this.kb=e.kb,this.storage=e.storage,this.doRefresh=e.refresh,this.doValidate=e.validate,this.onAuthFailed=e.onAuthFailed??(()=>{}),this.onError=e.onError??(()=>{}),this.client=e.client,this.token$=e.token$,this.user$=new _i(null),this.errors$=this.client.transport.errors$;let t=gu(this.storage,this.kb.id);t&&!bu(t.access)&&this.token$.getValue()===null&&this.token$.next(Na(t.access));let n=this.token$.getValue();this.streamState$=this.client.state$,n&&this.scheduleProactiveRefresh(n),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{this.handleStorageChange(e,t)})??null,this.ready=this.validate(t)}async validate(e){if(!e)return;let t=bu(e.access)?this.doRefresh?await this.doRefresh():null:e.access;if(!t){bu(e.access)&&vu(this.storage,this.kb.id);return}if(t!==e.access&&(this.token$.next(Na(t)),this.scheduleProactiveRefresh(t)),!this.doValidate)return;let n=async e=>{if(!this.disposed)try{let t=await this.doValidate(Na(e));if(this.disposed)return;this.user$.next(t)}catch(e){if(this.disposed)return;if(e instanceof Rl&&e.status===401){let e=this.doRefresh?await this.doRefresh():null;if(this.disposed)return;if(e){this.token$.next(Na(e)),this.scheduleProactiveRefresh(e),await n(e);return}vu(this.storage,this.kb.id),this.token$.next(null),this.onAuthFailed(`Your session has expired. Please sign in again.`)}else this.onError(new ku(`session.auth-failed`,e instanceof Error?e.message:String(e),this.kb.id))}};await n(t)}async refresh(){if(this.disposed||!this.doRefresh)return null;let e=await this.doRefresh();if(this.disposed)return null;if(e){let t=Na(e);return this.token$.next(t),this.scheduleProactiveRefresh(e),t}return this.token$.next(null),vu(this.storage,this.kb.id),this.onAuthFailed(`Your session has expired. Please sign in again.`),this.onError(new ku(`session.refresh-exhausted`,`Token refresh failed`,this.kb.id)),null}scheduleProactiveRefresh(e){this.clearRefreshTimer();let t=yu(e);if(!t)return;let n=t.getTime()-mu,r=Math.max(0,n-Date.now());this.refreshTimer=setTimeout(()=>{this.refreshTimer=null,this.disposed||this.refresh()},r)}clearRefreshTimer(){this.refreshTimer&&=(clearTimeout(this.refreshTimer),null)}handleStorageChange(e,t){if(!this.disposed&&e===hu(this.kb.id)){if(!t){this.token$.next(null),this.user$.next(null),this.clearRefreshTimer();return}try{let e=JSON.parse(t);typeof e.access==`string`&&(this.token$.next(Na(e.access)),this.scheduleProactiveRefresh(e.access))}catch{}}}get expiresAt(){let e=this.token$.getValue();return e?yu(e):null}subscribe(e,t){let n=this.client.bus.get(e).subscribe(t);return()=>n.unsubscribe()}async dispose(){this.disposed||(this.disposed=!0,this.clearRefreshTimer(),this.unsubscribeStorage&&=(this.unsubscribeStorage(),null),this.client.dispose(),this.token$.complete(),this.user$.complete())}static fromHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(t.token==null?null:typeof t.token==`string`?Na(t.token):t.token),i=new zl({baseUrl:n,token$:r}),a=new uu(i,new Bl(i),i),o={kb:t.kb,storage:t.storage,client:a,token$:r};return t.refresh&&(o.refresh=t.refresh),t.validate&&(o.validate=t.validate),t.onAuthFailed&&(o.onAuthFailed=t.onAuthFailed),t.onError&&(o.onError=t.onError),new e(o)}static async signInHttp(t){let n=typeof t.baseUrl==`string`?La(t.baseUrl):t.baseUrl,r=new _i(null),i=new zl({baseUrl:n,token$:r}),a=new uu(i,new Bl(i),i),o;try{o=await a.auth.password(t.email,t.password)}catch(e){throw a.dispose(),e}_u(t.storage,t.kb.id,{access:o.token,refresh:o.refreshToken}),r.next(Na(o.token));let s={kb:t.kb,storage:t.storage,client:a,token$:r,refresh:async()=>{let e=gu(t.storage,t.kb.id);if(!e)return null;try{return(await a.auth.refresh(e.refresh)).access_token}catch{return null}}};t.validate&&(s.validate=t.validate),t.onAuthFailed&&(s.onAuthFailed=t.onAuthFailed),t.onError&&(s.onError=t.onError);let c=new e(s);return await c.ready,c}},ju=class{sessionExpiredAt$;sessionExpiredMessage$;permissionDeniedAt$;permissionDeniedMessage$;constructor(){this.sessionExpiredAt$=new _i(null),this.sessionExpiredMessage$=new _i(null),this.permissionDeniedAt$=new _i(null),this.permissionDeniedMessage$=new _i(null)}notifySessionExpired(e){this.sessionExpiredMessage$.next(e??`Your session has expired. Please sign in again.`),this.sessionExpiredAt$.next(Date.now())}notifyPermissionDenied(e){this.permissionDeniedMessage$.next(e??`You do not have permission to perform this action.`),this.permissionDeniedAt$.next(Date.now())}acknowledgeSessionExpired(){this.sessionExpiredAt$.next(null),this.sessionExpiredMessage$.next(null)}acknowledgePermissionDenied(){this.permissionDeniedAt$.next(null),this.permissionDeniedMessage$.next(null)}dispose(){this.sessionExpiredAt$.complete(),this.sessionExpiredMessage$.complete(),this.permissionDeniedAt$.complete(),this.permissionDeniedMessage$.complete()}},Mu=`openDocuments`;function Nu(e){return[...e].sort((e,t)=>e.order!==void 0&&t.order!==void 0?e.order-t.order:e.openedAt-t.openedAt)}function Pu(e){try{let t=e.get(Mu);if(t)return Nu(JSON.parse(t))}catch{}return[]}var Fu=class{kbs$;activeKbId$;activeSession$;activeSignals$;sessionActivating$;openResources$;error$;identityToken$;storage;sessionFactory;eventBus=new Ja;unsubscribeStorage=null;disposed=!1;activating=null;constructor(e){this.storage=e.storage,this.sessionFactory=e.sessionFactory;let t=Su(this.storage),n=this.storage.get(pu),r=n&&t.some(e=>e.id===n)?n:t[0]?.id??null;this.kbs$=new _i(t),this.activeKbId$=new _i(r),this.activeSession$=new _i(null),this.activeSignals$=new _i(null),this.sessionActivating$=new _i(!1),this.openResources$=new _i(Pu(this.storage)),this.error$=new hi,this.identityToken$=new _i(null),this.kbs$.subscribe(e=>Cu(this.storage,e)),this.activeKbId$.subscribe(e=>{e?this.storage.set(pu,e):this.storage.delete(pu)}),this.openResources$.subscribe(e=>{this.storage.set(Mu,JSON.stringify(e))}),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{if(!(e!==Mu||!t))try{this.openResources$.next(Nu(JSON.parse(t)))}catch{}})??null,r&&this.setActiveKb(r)}emit(e,t){this.disposed||this.eventBus.get(e).next(t)}on(e,t){let n=this.eventBus.get(e).subscribe(t);return()=>n.unsubscribe()}stream(e){return this.eventBus.get(e).asObservable()}setIdentityToken(e){this.disposed||this.identityToken$.next(e)}addKb(e,t,n){let r={id:Ou(),...e};return _u(this.storage,r.id,{access:t,refresh:n}),this.kbs$.next([...this.kbs$.getValue(),r]),this.setActiveKb(r.id),r}removeKb(e){vu(this.storage,e);let t=this.kbs$.getValue().filter(t=>t.id!==e);this.kbs$.next(t),this.activeKbId$.getValue()===e&&this.setActiveKb(t[0]?.id??null)}updateKb(e,t){this.kbs$.next(this.kbs$.getValue().map(n=>n.id===e?{...n,...t}:n))}getKbSessionStatus(e){let t=gu(this.storage,e);return t?bu(t.access)?`expired`:`authenticated`:`signed-out`}async setActiveKb(e){if(this.disposed)return;let t=this.activeKbId$.getValue(),n=this.activeSession$.getValue();if(e===t&&n)return;for(t!==e&&this.activeKbId$.next(e),n&&(this.activeSession$.next(null),this.activeSignals$.next(null));this.activating;)if(await this.activating,this.disposed||this.activeKbId$.getValue()!==e)return;let r=(async()=>{let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();if(t&&(this.activeSession$.next(null),this.activeSignals$.next(null),await t.dispose(),n?.dispose()),!e)return;let r=this.kbs$.getValue().find(t=>t.id===e);if(!r)return;let i=new ju,a;try{a=this.sessionFactory({kb:r,storage:this.storage,signals:i,onError:e=>this.error$.next(e)})}catch(t){this.error$.next(t instanceof ku?t:new ku(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),i.dispose();return}a.errors$.subscribe(e=>{e.code===`unauthorized`?i.notifySessionExpired(e.message):e.code===`forbidden`&&i.notifyPermissionDenied(e.message)});try{await a.ready}catch(t){this.error$.next(new ku(`session.construct-failed`,t instanceof Error?t.message:String(t),e)),await a.dispose(),i.dispose();return}if(this.disposed||this.activeKbId$.getValue()!==e){await a.dispose(),i.dispose();return}this.activeSession$.next(a),this.activeSignals$.next(i)})();this.activating=r,this.sessionActivating$.next(!0);try{await r}finally{this.activating===r&&(this.activating=null,this.sessionActivating$.next(!1))}}async signIn(e,t,n){if(!this.disposed){if(_u(this.storage,e,{access:t,refresh:n}),this.activeKbId$.getValue()===e){let t=this.activeSession$.getValue(),n=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),t&&await t.dispose(),n?.dispose(),await this.setActiveKb(e);return}await this.setActiveKb(e)}}async signOut(e){if(!this.disposed&&(vu(this.storage,e),this.kbs$.next([...this.kbs$.getValue()]),this.activeKbId$.getValue()===e)){let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose()}}addOpenResource(e,t,n,r){let i=this.openResources$.getValue(),a=i.findIndex(t=>t.id===e);if(a>=0){let e={...i[a],name:t,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}},o=[...i];o[a]=e,this.openResources$.next(o);return}let o={id:e,name:t,openedAt:Date.now(),order:i.length,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}};this.openResources$.next([...i,o])}removeOpenResource(e){this.openResources$.next(this.openResources$.getValue().filter(t=>t.id!==e))}updateOpenResourceName(e,t){this.openResources$.next(this.openResources$.getValue().map(n=>n.id===e?{...n,name:t}:n))}reorderOpenResources(e,t){let n=[...this.openResources$.getValue()];if(e<0||e>=n.length||t<0||t>=n.length)return;let[r]=n.splice(e,1);r&&n.splice(t,0,r),this.openResources$.next(n)}async dispose(){if(this.disposed)return;this.disposed=!0,this.unsubscribeStorage&&=(this.unsubscribeStorage(),null);let e=this.activeSession$.getValue(),t=this.activeSignals$.getValue();this.activeSession$.next(null),this.activeSignals$.next(null),e&&await e.dispose(),t?.dispose(),this.kbs$.complete(),this.activeKbId$.complete(),this.activeSession$.complete(),this.activeSignals$.complete(),this.openResources$.complete(),this.error$.complete(),this.identityToken$.complete(),this.eventBus.destroy()}};function Iu(){let e=new Map;return t=>{let{kb:n,storage:r,signals:i,onError:a}=t;if(n.endpoint.kind!==`http`)throw new ku(`session.construct-failed`,`HTTP session factory cannot construct a session for endpoint kind "${n.endpoint.kind}"`,n.id);let o=n.endpoint,s=async()=>{let t=e.get(n.id);if(t)return t;let i=(async()=>{let e=gu(r,n.id);if(!e)return null;let t=new zl({baseUrl:La(Du(o))}),i=new uu(t,new Bl(t),t);try{let t=(await i.auth.refresh(e.refresh)).access_token;return t?(_u(r,n.id,{access:t,refresh:e.refresh}),t):null}catch{return null}finally{i.dispose()}})();e.set(n.id,i);try{return await i}finally{e.delete(n.id)}},c=async e=>{let t=new _i(e),n=new zl({baseUrl:La(Du(o)),token$:t}),r=new uu(n,new Bl(n),n);try{return await r.auth.me()}finally{r.dispose(),t.complete()}},l=new _i(null),u,d=new zl({baseUrl:La(Du(o)),token$:l,tokenRefresher:()=>u.refresh().then(e=>e??null)});return u=new Au({kb:n,storage:r,client:new uu(d,new Bl(d),d),token$:l,refresh:s,validate:c,onAuthFailed:e=>i.notifySessionExpired(e),onError:a}),u}}var Lu=null;function Ru(e){return Lu||=new Fu({storage:e.storage,sessionFactory:e.sessionFactory}),Lu}function zu(){let e=new Nr;return{add:t=>e.add(typeof t==`function`?t:()=>t.dispose()),dispose:()=>e.unsubscribe()}}function Bu(e,t={}){let n=t.debounceMs??250,r=t.initialQuery??``,i=new hi;return{query$:i.pipe(Oa(r)),state$:i.pipe(Oa(r),Sa(n),wa(),ka(t=>{let n=t.trim();return n?e(n).pipe(pa(e=>({results:e??[],isSearching:e===void 0})),Oa({results:[],isSearching:!0})):ia({results:[],isSearching:!1})})),setQuery:e=>i.next(e),dispose:()=>i.complete()}}function Vu(e){let t=[],n=new _i(null);return t.push(e.bus.get(`beckon:hover`).subscribe(({annotationId:t})=>{n.next(t),t&&e.bus.get(`beckon:sparkle`).next({annotationId:t})})),t.push(e.bus.get(`browse:click`).subscribe(({annotationId:t})=>{e.bus.get(`beckon:focus`).next({annotationId:t})})),{hoveredAnnotationId$:n.asObservable(),hover:t=>e.bus.get(`beckon:hover`).next({annotationId:t}),focus:t=>e.bus.get(`beckon:focus`).next({annotationId:t}),sparkle:t=>e.bus.get(`beckon:sparkle`).next({annotationId:t}),dispose(){t.forEach(e=>e.unsubscribe()),n.complete()}}}function Hu(e,t){let n=null,r=null,i=()=>{r!==null&&(clearTimeout(r),r=null)};return{handleMouseEnter:a=>{n!==a&&(i(),r=setTimeout(()=>{r=null,n=a,e(a)},t))},handleMouseLeave:()=>{i(),n!==null&&(n=null,e(null))},cleanup:i}}function Uu(e,t){let n=[],r=new _i(null),i=new _i(!1),a=new _i(null),o=new _i(null);return n.push(e.bus.get(`gather:requested`).subscribe(s=>{i.next(!0),a.next(null),r.next(null),o.next(za(s.annotationId));let c=e.gather.annotation(t,za(s.annotationId),{contextWindow:s.options?.contextWindow??2e3}).pipe(da(6e4)).subscribe({next:e=>{`response`in e&&e.response&&(r.next(e.response.context??null),i.next(!1))},error:e=>{a.next(e instanceof Error?e:Error(String(e))),i.next(!1)},complete:()=>{i.next(!1)}});n.push(c)})),{context$:r.asObservable(),loading$:i.asObservable(),error$:a.asObservable(),annotationId$:o.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete(),o.complete()}}}function Wu(e,t){let n=[];return n.push(e.bus.get(`match:search-requested`).subscribe(t=>{let r=e.match.search(Ra(t.resourceId),za(t.referenceId),t.context,{limit:t.limit,useSemanticScoring:t.useSemanticScoring}).pipe(da(6e4)).subscribe({next:t=>e.bus.get(`match:search-results`).next(t),error:n=>e.bus.get(`match:search-failed`).next({correlationId:t.correlationId,referenceId:t.referenceId,error:n instanceof Error?n.message:String(n)})});n.push(r)})),{dispose(){n.forEach(e=>e.unsubscribe())}}}function Gu(e,t,n){let r=[],i=new _i(!1),a=new _i(null),o=null;return{isGenerating$:i.asObservable(),progress$:a.asObservable(),generate:(s,c)=>{let l=e.yield.fromAnnotation(Ra(t),za(s),{...c,language:c.language||n}).pipe(da({each:3e5})).subscribe({next:e=>{e.kind===`progress`&&(a.next(e.data),i.next(!0))},complete:()=>{i.next(!1),o&&clearTimeout(o),o=setTimeout(()=>{a.next(null),o=null},2e3)},error:()=>{a.next(null),i.next(!1)}});r.push(l)},dispose(){r.forEach(e=>e.unsubscribe()),o&&clearTimeout(o),i.complete(),a.complete()}}}function Ku(e){if(e.svgSelector)return{type:`SvgSelector`,value:e.svgSelector};if(e.fragmentSelector){let t=[{type:`FragmentSelector`,value:e.fragmentSelector,...e.conformsTo&&{conformsTo:e.conformsTo}}];return e.exact&&t.push({type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}),t}return{type:`TextQuoteSelector`,exact:e.exact,...e.prefix&&{prefix:e.prefix},...e.suffix&&{suffix:e.suffix}}}function qu(e,t){let n=[],r=new _i(null),i=new _i(null),a=new _i(null),o=null,s=()=>{o&&=(clearTimeout(o),null)},c=e=>{r.next(e)};return n.push(e.bus.get(`mark:requested`).subscribe(c)),n.push(e.bus.get(`mark:select-comment`).subscribe(e=>c({selector:Ku(e),motivation:`commenting`}))),n.push(e.bus.get(`mark:select-tag`).subscribe(e=>c({selector:Ku(e),motivation:`tagging`}))),n.push(e.bus.get(`mark:select-assessment`).subscribe(e=>c({selector:Ku(e),motivation:`assessing`}))),n.push(e.bus.get(`mark:select-reference`).subscribe(e=>c({selector:Ku(e),motivation:`linking`}))),n.push(e.bus.get(`mark:cancel-pending`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:create-ok`).subscribe(()=>r.next(null))),n.push(e.bus.get(`mark:submit`).subscribe(async n=>{try{let r=await e.mark.annotation({motivation:n.motivation,target:{source:t,selector:n.selector},body:n.body});e.bus.get(`mark:create-ok`).next({annotationId:r.annotationId})}catch(t){e.bus.get(`mark:create-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:delete`).subscribe(async n=>{try{await e.mark.delete(t,n.annotationId),e.bus.get(`mark:delete-ok`).next({annotationId:n.annotationId})}catch(t){e.bus.get(`mark:delete-failed`).next({message:t instanceof Error?t.message:String(t)})}})),n.push(e.bus.get(`mark:assist-request`).subscribe(r=>{s(),i.next(r.motivation),a.next(null);let c=e.mark.assist(t,r.motivation,r.options).pipe(da({each:18e4})).subscribe({next:e=>{e.kind===`progress`&&a.next(e.data)},complete:()=>{i.next(null),s(),o=setTimeout(()=>{a.next(null),o=null},5e3)},error:()=>{s(),i.next(null),a.next(null)}});n.push(c)})),n.push(e.bus.get(`mark:progress-dismiss`).subscribe(()=>{s(),a.next(null)})),{pendingAnnotation$:r.asObservable(),assistingMotivation$:i.asObservable(),progress$:a.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),s(),r.complete(),i.complete(),a.complete()}}}var Ju=p({"../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isFunction=void 0;function t(e){return typeof e==`function`}e.isFunction=t}}),Yu=p({"../../node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createErrorClass=void 0;function t(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}e.createErrorClass=t}}),Xu=p({"../../node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.UnsubscriptionError=void 0,e.UnsubscriptionError=Yu().createErrorClass(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
9
9
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
10
10
|
`):``,this.name=`UnsubscriptionError`,this.errors=t}})}}),Zu=p({"../../node_modules/rxjs/dist/cjs/internal/util/arrRemove.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.arrRemove=void 0;function t(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}e.arrRemove=t}}),Qu=p({"../../node_modules/rxjs/dist/cjs/internal/Subscription.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},n=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},r=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.isSubscription=e.EMPTY_SUBSCRIPTION=e.Subscription=void 0;var i=Ju(),a=Xu(),o=Zu(),s=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,o,s,c,u;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=t(d),p=f.next();!p.done;p=f.next())p.value.remove(this)}catch(t){e={error:t}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(e)throw e.error}}else d.remove(this);var m=this.initialTeardown;if(i.isFunction(m))try{m()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var g=t(h),_=g.next();!_.done;_=g.next()){var v=_.value;try{l(v)}catch(e){u??=[],e instanceof a.UnsubscriptionError?u=r(r([],n(u)),n(e.errors)):u.push(e)}}}catch(e){s={error:e}}finally{try{_&&!_.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&o.arrRemove(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&o.arrRemove(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();e.Subscription=s,e.EMPTY_SUBSCRIPTION=s.EMPTY;function c(e){return e instanceof s||e&&`closed`in e&&i.isFunction(e.remove)&&i.isFunction(e.add)&&i.isFunction(e.unsubscribe)}e.isSubscription=c;function l(e){i.isFunction(e)?e():e.unsubscribe()}}}),$u=p({"../../node_modules/rxjs/dist/cjs/internal/config.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.config=void 0,e.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}}}),ed=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/timeoutProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.timeoutProvider=void 0,e.timeoutProvider={setTimeout:function(r,i){var a=[...arguments].slice(2),o=e.timeoutProvider.delegate;return o?.setTimeout?o.setTimeout.apply(o,n([r,i],t(a))):setTimeout.apply(void 0,n([r,i],t(a)))},clearTimeout:function(t){return(e.timeoutProvider.delegate?.clearTimeout||clearTimeout)(t)},delegate:void 0}}}),td=p({"../../node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.reportUnhandledError=void 0;var t=$u(),n=ed();function r(e){n.timeoutProvider.setTimeout(function(){var n=t.config.onUnhandledError;if(n)n(e);else throw e})}e.reportUnhandledError=r}}),nd=p({"../../node_modules/rxjs/dist/cjs/internal/util/noop.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.noop=void 0;function t(){}e.noop=t}}),rd=p({"../../node_modules/rxjs/dist/cjs/internal/NotificationFactories.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createNotification=e.nextNotification=e.errorNotification=e.COMPLETE_NOTIFICATION=void 0,e.COMPLETE_NOTIFICATION=(function(){return r(`C`,void 0,void 0)})();function t(e){return r(`E`,void 0,e)}e.errorNotification=t;function n(e){return r(`N`,e,void 0)}e.nextNotification=n;function r(e,t,n){return{kind:e,value:t,error:n}}e.createNotification=r}}),id=p({"../../node_modules/rxjs/dist/cjs/internal/util/errorContext.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.captureError=e.errorContext=void 0;var t=$u(),n=null;function r(e){if(t.config.useDeprecatedSynchronousErrorHandling){var r=!n;if(r&&(n={errorThrown:!1,error:null}),e(),r){var i=n,a=i.errorThrown,o=i.error;if(n=null,a)throw o}}else e()}e.errorContext=r;function i(e){t.config.useDeprecatedSynchronousErrorHandling&&n&&(n.errorThrown=!0,n.error=e)}e.captureError=i}}),ad=p({"../../node_modules/rxjs/dist/cjs/internal/Subscriber.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.EMPTY_OBSERVER=e.SafeSubscriber=e.Subscriber=void 0;var n=Ju(),r=Qu(),i=$u(),a=td(),o=nd(),s=rd(),c=ed(),l=id(),u=(function(n){t(i,n);function i(t){var i=n.call(this)||this;return i.isStopped=!1,t?(i.destination=t,r.isSubscription(t)&&t.add(i)):i.destination=e.EMPTY_OBSERVER,i}return i.create=function(e,t,n){return new m(e,t,n)},i.prototype.next=function(e){this.isStopped?_(s.nextNotification(e),this):this._next(e)},i.prototype.error=function(e){this.isStopped?_(s.errorNotification(e),this):(this.isStopped=!0,this._error(e))},i.prototype.complete=function(){this.isStopped?_(s.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},i.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},i.prototype._next=function(e){this.destination.next(e)},i.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},i.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},i})(r.Subscription);e.Subscriber=u;var d=Function.prototype.bind;function f(e,t){return d.call(e,t)}var p=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){h(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){h(e)}else h(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){h(e)}},e})(),m=(function(e){t(r,e);function r(t,r,a){var o=e.call(this)||this,s;if(n.isFunction(t)||!t)s={next:t??void 0,error:r??void 0,complete:a??void 0};else{var c;o&&i.config.useDeprecatedNextContext?(c=Object.create(t),c.unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&f(t.next,c),error:t.error&&f(t.error,c),complete:t.complete&&f(t.complete,c)}):s=t}return o.destination=new p(s),o}return r})(u);e.SafeSubscriber=m;function h(e){i.config.useDeprecatedSynchronousErrorHandling?l.captureError(e):a.reportUnhandledError(e)}function g(e){throw e}function _(e,t){var n=i.config.onStoppedNotification;n&&c.timeoutProvider.setTimeout(function(){return n(e,t)})}e.EMPTY_OBSERVER={closed:!0,next:o.noop,error:g,complete:o.noop}}}),od=p({"../../node_modules/rxjs/dist/cjs/internal/symbol/observable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.observable=void 0,e.observable=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})()}}),sd=p({"../../node_modules/rxjs/dist/cjs/internal/util/identity.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.identity=void 0;function t(e){return e}e.identity=t}}),cd=p({"../../node_modules/rxjs/dist/cjs/internal/util/pipe.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.pipeFromArray=e.pipe=void 0;var t=sd();function n(){return r([...arguments])}e.pipe=n;function r(e){return e.length===0?t.identity:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}e.pipeFromArray=r}}),ld=p({"../../node_modules/rxjs/dist/cjs/internal/Observable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.Observable=void 0;var t=ad(),n=Qu(),r=od(),i=cd(),a=$u(),o=Ju(),s=id();e.Observable=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,n,r){var i=this,a=u(e)?e:new t.SafeSubscriber(e,n,r);return s.errorContext(function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,n){var r=this;return n=c(n),new n(function(n,i){var a=new t.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:n});r.subscribe(a)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[r.observable]=function(){return this},e.prototype.pipe=function(){var e=[...arguments];return i.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=c(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function c(e){return e??a.config.Promise??Promise}function l(e){return e&&o.isFunction(e.next)&&o.isFunction(e.error)&&o.isFunction(e.complete)}function u(e){return e&&e instanceof t.Subscriber||l(e)&&n.isSubscription(e)}}}),F=p({"../../node_modules/rxjs/dist/cjs/internal/util/lift.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.operate=e.hasLift=void 0;var t=Ju();function n(e){return t.isFunction(e?.lift)}e.hasLift=n;function r(e){return function(t){if(n(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}e.operate=r}}),I=p({"../../node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.OperatorSubscriber=e.createOperatorSubscriber=void 0;var n=ad();function r(e,t,n,r,a){return new i(e,t,n,r,a)}e.createOperatorSubscriber=r;var i=(function(e){t(n,e);function n(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},n})(n.Subscriber);e.OperatorSubscriber=i}}),ud=p({"../../node_modules/rxjs/dist/cjs/internal/operators/refCount.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.refCount=void 0;var t=F(),n=I();function r(){return t.operate(function(e,t){var r=null;e._refCount++;var i=n.createOperatorSubscriber(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){r=null;return}var n=e._connection,i=r;r=null,n&&(!i||n===i)&&n.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}e.refCount=r}}),dd=p({"../../node_modules/rxjs/dist/cjs/internal/observable/ConnectableObservable.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.ConnectableObservable=void 0;var n=ld(),r=Qu(),i=ud(),a=I(),o=F();e.ConnectableObservable=(function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,o.hasLift(t)&&(r.lift=t.lift),r}return n.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},n.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},n.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,e?.unsubscribe()},n.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new r.Subscription;var n=this.getSubject();t.add(this.source.subscribe(a.createOperatorSubscriber(n,void 0,function(){e._teardown(),n.complete()},function(t){e._teardown(),n.error(t)},function(){return e._teardown()}))),t.closed&&(this._connection=null,t=r.Subscription.EMPTY)}return t},n.prototype.refCount=function(){return i.refCount()(this)},n})(n.Observable)}}),fd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/performanceTimestampProvider.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.performanceTimestampProvider=void 0,e.performanceTimestampProvider={now:function(){return(e.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}}}),pd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrameProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.animationFrameProvider=void 0;var r=Qu();e.animationFrameProvider={schedule:function(t){var n=requestAnimationFrame,i=cancelAnimationFrame,a=e.animationFrameProvider.delegate;a&&(n=a.requestAnimationFrame,i=a.cancelAnimationFrame);var o=n(function(e){i=void 0,t(e)});return new r.Subscription(function(){return i?.(o)})},requestAnimationFrame:function(){var r=[...arguments];return(e.animationFrameProvider.delegate?.requestAnimationFrame||requestAnimationFrame).apply(void 0,n([],t(r)))},cancelAnimationFrame:function(){var r=[...arguments];return(e.animationFrameProvider.delegate?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,n([],t(r)))},delegate:void 0}}}),md=p({"../../node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.animationFrames=void 0;var t=ld(),n=fd(),r=pd();function i(e){return e?a(e):o}e.animationFrames=i;function a(e){return new t.Observable(function(t){var i=e||n.performanceTimestampProvider,a=i.now(),o=0,s=function(){t.closed||(o=r.animationFrameProvider.requestAnimationFrame(function(n){o=0;var r=i.now();t.next({timestamp:e?r:n,elapsed:r-a}),s()}))};return s(),function(){o&&r.animationFrameProvider.cancelAnimationFrame(o)}})}var o=a()}}),hd=p({"../../node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.ObjectUnsubscribedError=void 0,e.ObjectUnsubscribedError=Yu().createErrorClass(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}})}}),gd=p({"../../node_modules/rxjs/dist/cjs/internal/Subject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.AnonymousSubject=e.Subject=void 0;var r=ld(),i=Qu(),a=hd(),o=Zu(),s=id(),c=(function(e){t(c,e);function c(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return c.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},c.prototype._throwIfClosed=function(){if(this.closed)throw new a.ObjectUnsubscribedError},c.prototype.next=function(e){var t=this;s.errorContext(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var a=n(t.currentObservers),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}})},c.prototype.error=function(e){var t=this;s.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},c.prototype.complete=function(){var e=this;s.errorContext(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},c.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(c.prototype,`observed`,{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),c.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},c.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},c.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,a=n.isStopped,s=n.observers;return r||a?i.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(e),new i.Subscription(function(){t.currentObservers=null,o.arrRemove(s,e)}))},c.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},c.prototype.asObservable=function(){var e=new r.Observable;return e.source=this,e},c.create=function(e,t){return new l(e,t)},c})(r.Observable);e.Subject=c;var l=(function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return n.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},n.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},n.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},n.prototype._subscribe=function(e){return this.source?.subscribe(e)??i.EMPTY_SUBSCRIPTION},n})(c);e.AnonymousSubject=l}}),_d=p({"../../node_modules/rxjs/dist/cjs/internal/BehaviorSubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.BehaviorSubject=void 0,e.BehaviorSubject=(function(e){t(n,e);function n(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(n.prototype,`value`,{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n})(gd().Subject)}}),vd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/dateTimestampProvider.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.dateTimestampProvider=void 0,e.dateTimestampProvider={now:function(){return(e.dateTimestampProvider.delegate||Date).now()},delegate:void 0}}}),yd=p({"../../node_modules/rxjs/dist/cjs/internal/ReplaySubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.ReplaySubject=void 0;var n=gd(),r=vd();e.ReplaySubject=(function(e){t(n,e);function n(t,n,i){t===void 0&&(t=1/0),n===void 0&&(n=1/0),i===void 0&&(i=r.dateTimestampProvider);var a=e.call(this)||this;return a._bufferSize=t,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,t),a._windowTime=Math.max(1,n),a}return n.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},n.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},n.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},n})(n.Subject)}}),bd=p({"../../node_modules/rxjs/dist/cjs/internal/AsyncSubject.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AsyncSubject=void 0,e.AsyncSubject=(function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return n.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t._hasValue,i=t._value,a=t.thrownError,o=t.isStopped,s=t._isComplete;n?e.error(a):(o||s)&&(r&&e.next(i),e.complete())},n.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},n.prototype.complete=function(){var t=this,n=t._hasValue,r=t._value;t._isComplete||(this._isComplete=!0,n&&e.prototype.next.call(this,r),e.prototype.complete.call(this))},n})(gd().Subject)}}),xd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/Action.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.Action=void 0,e.Action=(function(e){t(n,e);function n(t,n){return e.call(this)||this}return n.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},n})(Qu().Subscription)}}),Sd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/intervalProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.intervalProvider=void 0,e.intervalProvider={setInterval:function(r,i){var a=[...arguments].slice(2),o=e.intervalProvider.delegate;return o?.setInterval?o.setInterval.apply(o,n([r,i],t(a))):setInterval.apply(void 0,n([r,i],t(a)))},clearInterval:function(t){return(e.intervalProvider.delegate?.clearInterval||clearInterval)(t)},delegate:void 0}}}),Cd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsyncAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AsyncAction=void 0;var n=xd(),r=Sd(),i=Zu();e.AsyncAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return n.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),r.intervalProvider.setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&r.intervalProvider.clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,a=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,i.arrRemove(a,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n})(n.Action)}}),wd=p({"../../node_modules/rxjs/dist/cjs/internal/util/Immediate.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.TestTools=e.Immediate=void 0;var t=1,n,r={};function i(e){return e in r?(delete r[e],!0):!1}e.Immediate={setImmediate:function(e){var a=t++;return r[a]=!0,n||=Promise.resolve(),n.then(function(){return i(a)&&e()}),a},clearImmediate:function(e){i(e)}},e.TestTools={pending:function(){return Object.keys(r).length}}}}),Td=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/immediateProvider.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.immediateProvider=void 0;var r=wd(),i=r.Immediate.setImmediate,a=r.Immediate.clearImmediate;e.immediateProvider={setImmediate:function(){var r=[...arguments];return(e.immediateProvider.delegate?.setImmediate||i).apply(void 0,n([],t(r)))},clearImmediate:function(t){return(e.immediateProvider.delegate?.clearImmediate||a)(t)},delegate:void 0}}}),Ed=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsapAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AsapAction=void 0;var n=Cd(),r=Td();e.AsapAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||=r.immediateProvider.setImmediate(t.flush.bind(t,void 0)))},n.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i==null?this.delay>0:i>0)return e.prototype.recycleAsyncId.call(this,t,n,i);var a=t.actions;n!=null&&a[a.length-1]?.id!==n&&(r.immediateProvider.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},n})(n.AsyncAction)}}),Dd=p({"../../node_modules/rxjs/dist/cjs/internal/Scheduler.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.Scheduler=void 0;var t=vd();e.Scheduler=(function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=t.dateTimestampProvider.now,e})()}}),Od=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsyncScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AsyncScheduler=void 0;var n=Dd();e.AsyncScheduler=(function(e){t(r,e);function r(t,r){r===void 0&&(r=n.Scheduler.now);var i=e.call(this,t,r)||this;return i.actions=[],i._active=!1,i}return r.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},r})(n.Scheduler)}}),kd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AsapScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AsapScheduler=void 0,e.AsapScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n=this.actions,r;e||=n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},n})(Od().AsyncScheduler)}}),Ad=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/asap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.asap=e.asapScheduler=void 0;var t=Ed();e.asapScheduler=new(kd()).AsapScheduler(t.AsapAction),e.asap=e.asapScheduler}}),jd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.async=e.asyncScheduler=void 0;var t=Cd();e.asyncScheduler=new(Od()).AsyncScheduler(t.AsyncAction),e.async=e.asyncScheduler}}),Md=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/QueueAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.QueueAction=void 0,e.QueueAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},n.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},n.prototype.requestAsyncId=function(t,n,r){return r===void 0&&(r=0),r!=null&&r>0||r==null&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.flush(this),0)},n})(Cd().AsyncAction)}}),Nd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/QueueScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.QueueScheduler=void 0,e.QueueScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n})(Od().AsyncScheduler)}}),Pd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/queue.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.queue=e.queueScheduler=void 0;var t=Md();e.queueScheduler=new(Nd()).QueueScheduler(t.QueueAction),e.queue=e.queueScheduler}}),Fd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameAction.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AnimationFrameAction=void 0;var n=Cd(),r=pd();e.AnimationFrameAction=(function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return n.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||=r.animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)}))},n.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i==null?this.delay>0:i>0)return e.prototype.recycleAsyncId.call(this,t,n,i);var a=t.actions;n!=null&&n===t._scheduled&&a[a.length-1]?.id!==n&&(r.animationFrameProvider.cancelAnimationFrame(n),t._scheduled=void 0)},n})(n.AsyncAction)}}),Id=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/AnimationFrameScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.AnimationFrameScheduler=void 0,e.AnimationFrameScheduler=(function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.flush=function(e){this._active=!0;var t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var n=this.actions,r;e||=n.shift();do if(r=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},n})(Od().AsyncScheduler)}}),Ld=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.animationFrame=e.animationFrameScheduler=void 0;var t=Fd();e.animationFrameScheduler=new(Id()).AnimationFrameScheduler(t.AnimationFrameAction),e.animationFrame=e.animationFrameScheduler}}),Rd=p({"../../node_modules/rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler.js"(e){var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.VirtualAction=e.VirtualTimeScheduler=void 0;var n=Cd(),r=Qu();e.VirtualTimeScheduler=(function(e){t(n,e);function n(t,n){t===void 0&&(t=i),n===void 0&&(n=1/0);var r=e.call(this,t,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return n.prototype.flush=function(){for(var e=this,t=e.actions,n=e.maxFrames,r,i;(i=t[0])&&i.delay<=n&&(t.shift(),this.frame=i.delay,!(r=i.execute(i.state,i.delay))););if(r){for(;i=t.shift();)i.unsubscribe();throw r}},n.frameTimeFactor=10,n})(Od().AsyncScheduler);var i=(function(e){t(n,e);function n(t,n,r){r===void 0&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return n.prototype.schedule=function(t,i){if(i===void 0&&(i=0),Number.isFinite(i)){if(!this.id)return e.prototype.schedule.call(this,t,i);this.active=!1;var a=new n(this.scheduler,this.work);return this.add(a),a.schedule(t,i)}else return r.Subscription.EMPTY},n.prototype.requestAsyncId=function(e,t,r){r===void 0&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(n.sortActions),1},n.prototype.recycleAsyncId=function(e,t,n){n===void 0&&(n=0)},n.prototype._execute=function(t,n){if(this.active===!0)return e.prototype._execute.call(this,t,n)},n.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},n})(n.AsyncAction);e.VirtualAction=i}}),zd=p({"../../node_modules/rxjs/dist/cjs/internal/observable/empty.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.empty=e.EMPTY=void 0;var t=ld();e.EMPTY=new t.Observable(function(e){return e.complete()});function n(t){return t?r(t):e.EMPTY}e.empty=n;function r(e){return new t.Observable(function(t){return e.schedule(function(){return t.complete()})})}}}),Bd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isScheduler.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isScheduler=void 0;var t=Ju();function n(e){return e&&t.isFunction(e.schedule)}e.isScheduler=n}}),Vd=p({"../../node_modules/rxjs/dist/cjs/internal/util/args.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.popNumber=e.popScheduler=e.popResultSelector=void 0;var t=Ju(),n=Bd();function r(e){return e[e.length-1]}function i(e){return t.isFunction(r(e))?e.pop():void 0}e.popResultSelector=i;function a(e){return n.isScheduler(r(e))?e.pop():void 0}e.popScheduler=a;function o(e,t){return typeof r(e)==`number`?e.pop():t}e.popNumber=o}}),Hd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isArrayLike.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isArrayLike=void 0,e.isArrayLike=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`})}}),Ud=p({"../../node_modules/rxjs/dist/cjs/internal/util/isPromise.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isPromise=void 0;var t=Ju();function n(e){return t.isFunction(e?.then)}e.isPromise=n}}),Wd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isInteropObservable=void 0;var t=od(),n=Ju();function r(e){return n.isFunction(e[t.observable])}e.isInteropObservable=r}}),Gd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isAsyncIterable=void 0;var t=Ju();function n(e){return Symbol.asyncIterator&&t.isFunction(e?.[Symbol.asyncIterator])}e.isAsyncIterable=n}}),Kd=p({"../../node_modules/rxjs/dist/cjs/internal/util/throwUnobservableError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createInvalidObservableTypeError=void 0;function t(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}e.createInvalidObservableTypeError=t}}),qd=p({"../../node_modules/rxjs/dist/cjs/internal/symbol/iterator.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.iterator=e.getSymbolIterator=void 0;function t(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}e.getSymbolIterator=t,e.iterator=t()}}),Jd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isIterable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isIterable=void 0;var t=qd(),n=Ju();function r(e){return n.isFunction(e?.[t.iterator])}e.isIterable=r}}),Yd=p({"../../node_modules/rxjs/dist/cjs/internal/util/isReadableStreamLike.js"(e){var t=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},n=e&&e.__await||function(e){return this instanceof n?(this.v=e,this):new n(e)},r=e&&e.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var i=r.apply(e,t||[]),a,o=[];return a={},s(`next`),s(`throw`),s(`return`),a[Symbol.asyncIterator]=function(){return this},a;function s(e){i[e]&&(a[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||c(e,t)})})}function c(e,t){try{l(i[e](t))}catch(e){f(o[0][3],e)}}function l(e){e.value instanceof n?Promise.resolve(e.value.v).then(u,d):f(o[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),o.shift(),o.length&&c(o[0][0],o[0][1])}};Object.defineProperty(e,`__esModule`,{value:!0}),e.isReadableStreamLike=e.readableStreamLikeToAsyncGenerator=void 0;var i=Ju();function a(e){return r(this,arguments,function(){var r,i,a,o;return t(this,function(t){switch(t.label){case 0:r=e.getReader(),t.label=1;case 1:t.trys.push([1,,9,10]),t.label=2;case 2:return[4,n(r.read())];case 3:return i=t.sent(),a=i.value,o=i.done,o?[4,n(void 0)]:[3,5];case 4:return[2,t.sent()];case 5:return[4,n(a)];case 6:return[4,t.sent()];case 7:return t.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}e.readableStreamLikeToAsyncGenerator=a;function o(e){return i.isFunction(e?.getReader)}e.isReadableStreamLike=o}}),L=p({"../../node_modules/rxjs/dist/cjs/internal/observable/innerFrom.js"(e){var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},r=e&&e.__asyncValues||function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},i=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.fromReadableStreamLike=e.fromAsyncIterable=e.fromIterable=e.fromPromise=e.fromArrayLike=e.fromInteropObservable=e.innerFrom=void 0;var a=Hd(),o=Ud(),s=ld(),c=Wd(),l=Gd(),u=Kd(),d=Jd(),f=Yd(),p=Ju(),m=td(),h=od();function g(e){if(e instanceof s.Observable)return e;if(e!=null){if(c.isInteropObservable(e))return _(e);if(a.isArrayLike(e))return v(e);if(o.isPromise(e))return y(e);if(l.isAsyncIterable(e))return x(e);if(d.isIterable(e))return b(e);if(f.isReadableStreamLike(e))return S(e)}throw u.createInvalidObservableTypeError(e)}e.innerFrom=g;function _(e){return new s.Observable(function(t){var n=e[h.observable]();if(p.isFunction(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}e.fromInteropObservable=_;function v(e){return new s.Observable(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}e.fromArrayLike=v;function y(e){return new s.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,m.reportUnhandledError)})}e.fromPromise=y;function b(e){return new s.Observable(function(t){var n,r;try{for(var a=i(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t.complete()})}e.fromIterable=b;function x(e){return new s.Observable(function(t){C(e,t).catch(function(e){return t.error(e)})})}e.fromAsyncIterable=x;function S(e){return x(f.readableStreamLikeToAsyncGenerator(e))}e.fromReadableStreamLike=S;function C(e,i){var a,o,s,c;return t(this,void 0,void 0,function(){var t,l;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,5,6,11]),a=r(e),n.label=1;case 1:return[4,a.next()];case 2:if(o=n.sent(),o.done)return[3,4];if(t=o.value,i.next(t),i.closed)return[2];n.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=n.sent(),s={error:l},[3,11];case 6:return n.trys.push([6,,9,10]),o&&!o.done&&(c=a.return)?[4,c.call(a)]:[3,8];case 7:n.sent(),n.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return i.complete(),[2]}})})}}}),Xd=p({"../../node_modules/rxjs/dist/cjs/internal/util/executeSchedule.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.executeSchedule=void 0;function t(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}e.executeSchedule=t}}),Zd=p({"../../node_modules/rxjs/dist/cjs/internal/operators/observeOn.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.observeOn=void 0;var t=Xd(),n=F(),r=I();function i(e,i){return i===void 0&&(i=0),n.operate(function(n,a){n.subscribe(r.createOperatorSubscriber(a,function(n){return t.executeSchedule(a,e,function(){return a.next(n)},i)},function(){return t.executeSchedule(a,e,function(){return a.complete()},i)},function(n){return t.executeSchedule(a,e,function(){return a.error(n)},i)}))})}e.observeOn=i}}),Qd=p({"../../node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.subscribeOn=void 0;var t=F();function n(e,n){return n===void 0&&(n=0),t.operate(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}e.subscribeOn=n}}),$d=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduleObservable=void 0;var t=L(),n=Zd(),r=Qd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.scheduleObservable=i}}),ef=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.schedulePromise=void 0;var t=L(),n=Zd(),r=Qd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.schedulePromise=i}}),tf=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduleArray=void 0;var t=ld();function n(e,n){return new t.Observable(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}e.scheduleArray=n}}),nf=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduleIterable=void 0;var t=ld(),n=qd(),r=Ju(),i=Xd();function a(e,a){return new t.Observable(function(t){var o;return i.executeSchedule(t,a,function(){o=e[n.iterator](),i.executeSchedule(t,a,function(){var e,n,r;try{e=o.next(),n=e.value,r=e.done}catch(e){t.error(e);return}r?t.complete():t.next(n)},0,!0)}),function(){return r.isFunction(o?.return)&&o.return()}})}e.scheduleIterable=a}}),rf=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduleAsyncIterable=void 0;var t=ld(),n=Xd();function r(e,r){if(!e)throw Error(`Iterable cannot be null`);return new t.Observable(function(t){n.executeSchedule(t,r,function(){var i=e[Symbol.asyncIterator]();n.executeSchedule(t,r,function(){i.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})})}e.scheduleAsyncIterable=r}}),af=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduleReadableStreamLike=void 0;var t=rf(),n=Yd();function r(e,r){return t.scheduleAsyncIterable(n.readableStreamLikeToAsyncGenerator(e),r)}e.scheduleReadableStreamLike=r}}),of=p({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scheduled=void 0;var t=$d(),n=ef(),r=tf(),i=nf(),a=rf(),o=Wd(),s=Ud(),c=Hd(),l=Jd(),u=Gd(),d=Kd(),f=Yd(),p=af();function m(e,m){if(e!=null){if(o.isInteropObservable(e))return t.scheduleObservable(e,m);if(c.isArrayLike(e))return r.scheduleArray(e,m);if(s.isPromise(e))return n.schedulePromise(e,m);if(u.isAsyncIterable(e))return a.scheduleAsyncIterable(e,m);if(l.isIterable(e))return i.scheduleIterable(e,m);if(f.isReadableStreamLike(e))return p.scheduleReadableStreamLike(e,m)}throw d.createInvalidObservableTypeError(e)}e.scheduled=m}}),sf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/from.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.from=void 0;var t=of(),n=L();function r(e,r){return r?t.scheduled(e,r):n.innerFrom(e)}e.from=r}}),cf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/of.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.of=void 0;var t=Vd(),n=sf();function r(){var e=[...arguments],r=t.popScheduler(e);return n.from(e,r)}e.of=r}}),lf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/throwError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.throwError=void 0;var t=ld(),n=Ju();function r(e,r){var i=n.isFunction(e)?e:function(){return e},a=function(e){return e.error(i())};return new t.Observable(r?function(e){return r.schedule(a,0,e)}:a)}e.throwError=r}}),uf=p({"../../node_modules/rxjs/dist/cjs/internal/Notification.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.observeNotification=e.Notification=e.NotificationKind=void 0;var t=zd(),n=cf(),r=lf(),i=Ju();(function(e){e.NEXT=`N`,e.ERROR=`E`,e.COMPLETE=`C`})(e.NotificationKind||={}),e.Notification=(function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e===`N`}return e.prototype.observe=function(e){return a(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return i===`N`?e?.(a):i===`E`?t?.(o):n?.()},e.prototype.accept=function(e,t,n){return i.isFunction(e?.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,i=e.kind,a=e.value,o=e.error,s=i===`N`?n.of(a):i===`E`?r.throwError(function(){return o}):i===`C`?t.EMPTY:0;if(!s)throw TypeError(`Unexpected notification kind `+i);return s},e.createNext=function(t){return new e(`N`,t)},e.createError=function(t){return new e(`E`,void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e(`C`),e})();function a(e,t){var n,r,i,a=e,o=a.kind,s=a.value,c=a.error;if(typeof o!=`string`)throw TypeError(`Invalid notification, missing "kind"`);o===`N`?(n=t.next)==null||n.call(t,s):o===`E`?(r=t.error)==null||r.call(t,c):(i=t.complete)==null||i.call(t)}e.observeNotification=a}}),df=p({"../../node_modules/rxjs/dist/cjs/internal/util/isObservable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isObservable=void 0;var t=ld(),n=Ju();function r(e){return!!e&&(e instanceof t.Observable||n.isFunction(e.lift)&&n.isFunction(e.subscribe))}e.isObservable=r}}),ff=p({"../../node_modules/rxjs/dist/cjs/internal/util/EmptyError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.EmptyError=void 0,e.EmptyError=Yu().createErrorClass(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}})}}),pf=p({"../../node_modules/rxjs/dist/cjs/internal/lastValueFrom.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.lastValueFrom=void 0;var t=ff();function n(e,n){var r=typeof n==`object`;return new Promise(function(i,a){var o=!1,s;e.subscribe({next:function(e){s=e,o=!0},error:a,complete:function(){o?i(s):r?i(n.defaultValue):a(new t.EmptyError)}})})}e.lastValueFrom=n}}),mf=p({"../../node_modules/rxjs/dist/cjs/internal/firstValueFrom.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.firstValueFrom=void 0;var t=ff(),n=ad();function r(e,r){var i=typeof r==`object`;return new Promise(function(a,o){var s=new n.SafeSubscriber({next:function(e){a(e),s.unsubscribe()},error:o,complete:function(){i?a(r.defaultValue):o(new t.EmptyError)}});e.subscribe(s)})}e.firstValueFrom=r}}),hf=p({"../../node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.ArgumentOutOfRangeError=void 0,e.ArgumentOutOfRangeError=Yu().createErrorClass(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}})}}),gf=p({"../../node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.NotFoundError=void 0,e.NotFoundError=Yu().createErrorClass(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}})}}),_f=p({"../../node_modules/rxjs/dist/cjs/internal/util/SequenceError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.SequenceError=void 0,e.SequenceError=Yu().createErrorClass(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}})}}),vf=p({"../../node_modules/rxjs/dist/cjs/internal/util/isDate.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isValidDate=void 0;function t(e){return e instanceof Date&&!isNaN(e)}e.isValidDate=t}}),yf=p({"../../node_modules/rxjs/dist/cjs/internal/operators/timeout.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.timeout=e.TimeoutError=void 0;var t=jd(),n=vf(),r=F(),i=L(),a=Yu(),o=I(),s=Xd();e.TimeoutError=a.createErrorClass(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function c(e,a){var c=n.isValidDate(e)?{first:e}:typeof e==`number`?{each:e}:e,u=c.first,d=c.each,f=c.with,p=f===void 0?l:f,m=c.scheduler,h=m===void 0?a??t.asyncScheduler:m,g=c.meta,_=g===void 0?null:g;if(u==null&&d==null)throw TypeError(`No timeout provided.`);return r.operate(function(e,t){var n,r,a=null,c=0,l=function(e){r=s.executeSchedule(t,h,function(){try{n.unsubscribe(),i.innerFrom(p({meta:_,lastValue:a,seen:c})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(o.createOperatorSubscriber(t,function(e){r?.unsubscribe(),c++,t.next(a=e),d>0&&l(d)},void 0,void 0,function(){r?.closed||r?.unsubscribe(),a=null})),!c&&l(u==null?d:typeof u==`number`?u:+u-h.now())})}e.timeout=c;function l(t){throw new e.TimeoutError(t)}}}),bf=p({"../../node_modules/rxjs/dist/cjs/internal/operators/map.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.map=void 0;var t=F(),n=I();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){i.next(e.call(r,t,a++))}))})}e.map=r}}),xf=p({"../../node_modules/rxjs/dist/cjs/internal/util/mapOneOrManyArgs.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.mapOneOrManyArgs=void 0;var r=bf(),i=Array.isArray;function a(e,r){return i(r)?e.apply(void 0,n([],t(r))):e(r)}function o(e){return r.map(function(t){return a(e,t)})}e.mapOneOrManyArgs=o}}),Sf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallbackInternals.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.bindCallbackInternals=void 0;var r=Bd(),i=ld(),a=Qd(),o=xf(),s=Zd(),c=bd();function l(e,u,d,f){if(d)if(r.isScheduler(d))f=d;else return function(){var t=[...arguments];return l(e,u,f).apply(this,t).pipe(o.mapOneOrManyArgs(d))};return f?function(){var t=[...arguments];return l(e,u).apply(this,t).pipe(a.subscribeOn(f),s.observeOn(f))}:function(){for(var r=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=new c.AsyncSubject,l=!0;return new i.Observable(function(i){var o=s.subscribe(i);if(l){l=!1;var c=!1,d=!1;u.apply(r,n(n([],t(a)),[function(){var t=[...arguments];if(e){var n=t.shift();if(n!=null){s.error(n);return}}s.next(1<t.length?t:t[0]),d=!0,c&&s.complete()}])),d&&s.complete(),c=!0}return o})}}e.bindCallbackInternals=l}}),Cf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.bindCallback=void 0;var t=Sf();function n(e,n,r){return t.bindCallbackInternals(!1,e,n,r)}e.bindCallback=n}}),wf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.bindNodeCallback=void 0;var t=Sf();function n(e,n,r){return t.bindCallbackInternals(!0,e,n,r)}e.bindNodeCallback=n}}),Tf=p({"../../node_modules/rxjs/dist/cjs/internal/util/argsArgArrayOrObject.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.argsArgArrayOrObject=void 0;var t=Array.isArray,n=Object.getPrototypeOf,r=Object.prototype,i=Object.keys;function a(e){if(e.length===1){var n=e[0];if(t(n))return{args:n,keys:null};if(o(n)){var r=i(n);return{args:r.map(function(e){return n[e]}),keys:r}}}return{args:e,keys:null}}e.argsArgArrayOrObject=a;function o(e){return e&&typeof e==`object`&&n(e)===r}}}),Ef=p({"../../node_modules/rxjs/dist/cjs/internal/util/createObject.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createObject=void 0;function t(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}e.createObject=t}}),Df=p({"../../node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.combineLatestInit=e.combineLatest=void 0;var t=ld(),n=Tf(),r=sf(),i=sd(),a=xf(),o=Vd(),s=Ef(),c=I(),l=Xd();function u(){var e=[...arguments],c=o.popScheduler(e),l=o.popResultSelector(e),u=n.argsArgArrayOrObject(e),f=u.args,p=u.keys;if(f.length===0)return r.from([],c);var m=new t.Observable(d(f,c,p?function(e){return s.createObject(p,e)}:i.identity));return l?m.pipe(a.mapOneOrManyArgs(l)):m}e.combineLatest=u;function d(e,t,n){return n===void 0&&(n=i.identity),function(i){f(t,function(){for(var a=e.length,o=Array(a),s=a,l=a,u=function(a){f(t,function(){var u=r.from(e[a],t),d=!1;u.subscribe(c.createOperatorSubscriber(i,function(e){o[a]=e,d||(d=!0,l--),l||i.next(n(o.slice()))},function(){--s||i.complete()}))},i)},d=0;d<a;d++)u(d)},i)}}e.combineLatestInit=d;function f(e,t,n){e?l.executeSchedule(n,e,t):t()}}}),Of=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeInternals=void 0;var t=L(),n=Xd(),r=I();function i(e,i,a,o,s,c,l,u){var d=[],f=0,p=0,m=!1,h=function(){m&&!d.length&&!f&&i.complete()},g=function(e){return f<o?_(e):d.push(e)},_=function(e){c&&i.next(e),f++;var u=!1;t.innerFrom(a(e,p++)).subscribe(r.createOperatorSubscriber(i,function(e){s?.(e),c?g(e):i.next(e)},function(){u=!0},void 0,function(){if(u)try{f--;for(var e=function(){var e=d.shift();l?n.executeSchedule(i,l,function(){return _(e)}):_(e)};d.length&&f<o;)e();h()}catch(e){i.error(e)}}))};return e.subscribe(r.createOperatorSubscriber(i,g,function(){m=!0,h()})),function(){u?.()}}e.mergeInternals=i}}),kf=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeMap=void 0;var t=bf(),n=L(),r=F(),i=Of(),a=Ju();function o(e,s,c){return c===void 0&&(c=1/0),a.isFunction(s)?o(function(r,i){return t.map(function(e,t){return s(r,e,i,t)})(n.innerFrom(e(r,i)))},c):(typeof s==`number`&&(c=s),r.operate(function(t,n){return i.mergeInternals(t,n,e,c)}))}e.mergeMap=o}}),Af=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeAll=void 0;var t=kf(),n=sd();function r(e){return e===void 0&&(e=1/0),t.mergeMap(n.identity,e)}e.mergeAll=r}}),jf=p({"../../node_modules/rxjs/dist/cjs/internal/operators/concatAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.concatAll=void 0;var t=Af();function n(){return t.mergeAll(1)}e.concatAll=n}}),Mf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/concat.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.concat=void 0;var t=jf(),n=Vd(),r=sf();function i(){var e=[...arguments];return t.concatAll()(r.from(e,n.popScheduler(e)))}e.concat=i}}),Nf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/defer.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.defer=void 0;var t=ld(),n=L();function r(e){return new t.Observable(function(t){n.innerFrom(e()).subscribe(t)})}e.defer=r}}),Pf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/connectable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.connectable=void 0;var t=gd(),n=ld(),r=Nf(),i={connector:function(){return new t.Subject},resetOnDisconnect:!0};function a(e,t){t===void 0&&(t=i);var a=null,o=t.connector,s=t.resetOnDisconnect,c=s===void 0?!0:s,l=o(),u=new n.Observable(function(e){return l.subscribe(e)});return u.connect=function(){return(!a||a.closed)&&(a=r.defer(function(){return e}).subscribe(l),c&&a.add(function(){return l=o()})),a},u}e.connectable=a}}),Ff=p({"../../node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.forkJoin=void 0;var t=ld(),n=Tf(),r=L(),i=Vd(),a=I(),o=xf(),s=Ef();function c(){var e=[...arguments],c=i.popResultSelector(e),l=n.argsArgArrayOrObject(e),u=l.args,d=l.keys,f=new t.Observable(function(e){var t=u.length;if(!t){e.complete();return}for(var n=Array(t),i=t,o=t,c=function(t){var c=!1;r.innerFrom(u[t]).subscribe(a.createOperatorSubscriber(e,function(e){c||(c=!0,o--),n[t]=e},function(){return i--},void 0,function(){(!i||!c)&&(o||e.next(d?s.createObject(d,n):n),e.complete())}))},l=0;l<t;l++)c(l)});return c?f.pipe(o.mapOneOrManyArgs(c)):f}e.forkJoin=c}}),If=p({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,`__esModule`,{value:!0}),e.fromEvent=void 0;var n=L(),r=ld(),i=kf(),a=Hd(),o=Ju(),s=xf(),c=[`addListener`,`removeListener`],l=[`addEventListener`,`removeEventListener`],u=[`on`,`off`];function d(e,g,_,v){if(o.isFunction(_)&&(v=_,_=void 0),v)return d(e,g,_).pipe(s.mapOneOrManyArgs(v));var y=t(h(e)?l.map(function(t){return function(n){return e[t](g,n,_)}}):p(e)?c.map(f(e,g)):m(e)?u.map(f(e,g)):[],2),b=y[0],x=y[1];if(!b&&a.isArrayLike(e))return i.mergeMap(function(e){return d(e,g,_)})(n.innerFrom(e));if(!b)throw TypeError(`Invalid event target`);return new r.Observable(function(e){var t=function(){var t=[...arguments];return e.next(1<t.length?t:t[0])};return b(t),function(){return x(t)}})}e.fromEvent=d;function f(e,t){return function(n){return function(r){return e[n](t,r)}}}function p(e){return o.isFunction(e.addListener)&&o.isFunction(e.removeListener)}function m(e){return o.isFunction(e.on)&&o.isFunction(e.off)}function h(e){return o.isFunction(e.addEventListener)&&o.isFunction(e.removeEventListener)}}}),Lf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.fromEventPattern=void 0;var t=ld(),n=Ju(),r=xf();function i(e,a,o){return o?i(e,a).pipe(r.mapOneOrManyArgs(o)):new t.Observable(function(t){var r=function(){var e=[...arguments];return t.next(e.length===1?e[0]:e)},i=e(r);return n.isFunction(a)?function(){return a(r,i)}:void 0})}e.fromEventPattern=i}}),Rf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/generate.js"(e){var t=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(e,`__esModule`,{value:!0}),e.generate=void 0;var n=sd(),r=Bd(),i=Nf(),a=nf();function o(e,o,s,c,l){var u,d,f,p;arguments.length===1?(u=e,p=u.initialState,o=u.condition,s=u.iterate,d=u.resultSelector,f=d===void 0?n.identity:d,l=u.scheduler):(p=e,!c||r.isScheduler(c)?(f=n.identity,l=c):f=c);function m(){var e;return t(this,function(t){switch(t.label){case 0:e=p,t.label=1;case 1:return!o||o(e)?[4,f(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e=s(e),[3,1];case 4:return[2]}})}return i.defer(l?function(){return a.scheduleIterable(m(),l)}:m)}e.generate=o}}),zf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/iif.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.iif=void 0;var t=Nf();function n(e,n,r){return t.defer(function(){return e()?n:r})}e.iif=n}}),Bf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/timer.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.timer=void 0;var t=ld(),n=jd(),r=Bd(),i=vf();function a(e,a,o){e===void 0&&(e=0),o===void 0&&(o=n.async);var s=-1;return a!=null&&(r.isScheduler(a)?o=a:s=a),new t.Observable(function(t){var n=i.isValidDate(e)?+e-o.now():e;n<0&&(n=0);var r=0;return o.schedule(function(){t.closed||(t.next(r++),0<=s?this.schedule(void 0,s):t.complete())},n)})}e.timer=a}}),Vf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/interval.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.interval=void 0;var t=jd(),n=Bf();function r(e,r){return e===void 0&&(e=0),r===void 0&&(r=t.asyncScheduler),e<0&&(e=0),n.timer(e,e,r)}e.interval=r}}),Hf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/merge.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;var t=Af(),n=L(),r=zd(),i=Vd(),a=sf();function o(){var e=[...arguments],o=i.popScheduler(e),s=i.popNumber(e,1/0),c=e;return c.length?c.length===1?n.innerFrom(c[0]):t.mergeAll(s)(a.from(c,o)):r.EMPTY}e.merge=o}}),Uf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/never.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.never=e.NEVER=void 0;var t=ld(),n=nd();e.NEVER=new t.Observable(n.noop);function r(){return e.NEVER}e.never=r}}),Wf=p({"../../node_modules/rxjs/dist/cjs/internal/util/argsOrArgArray.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.argsOrArgArray=void 0;var t=Array.isArray;function n(e){return e.length===1&&t(e[0])?e[0]:e}e.argsOrArgArray=n}}),Gf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.onErrorResumeNext=void 0;var t=ld(),n=Wf(),r=I(),i=nd(),a=L();function o(){var e=[...arguments],o=n.argsOrArgArray(e);return new t.Observable(function(e){var t=0,n=function(){if(t<o.length){var s=void 0;try{s=a.innerFrom(o[t++])}catch{n();return}var c=new r.OperatorSubscriber(e,void 0,i.noop,i.noop);s.subscribe(c),c.add(n)}else e.complete()};n()})}e.onErrorResumeNext=o}}),Kf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/pairs.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.pairs=void 0;var t=sf();function n(e,n){return t.from(Object.entries(e),n)}e.pairs=n}}),qf=p({"../../node_modules/rxjs/dist/cjs/internal/util/not.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.not=void 0;function t(e,t){return function(n,r){return!e.call(t,n,r)}}e.not=t}}),Jf=p({"../../node_modules/rxjs/dist/cjs/internal/operators/filter.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.filter=void 0;var t=F(),n=I();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){return e.call(r,t,a++)&&i.next(t)}))})}e.filter=r}}),Yf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/partition.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.partition=void 0;var t=qf(),n=Jf(),r=L();function i(e,i,a){return[n.filter(i,a)(r.innerFrom(e)),n.filter(t.not(i,a))(r.innerFrom(e))]}e.partition=i}}),Xf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/race.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.raceInit=e.race=void 0;var t=ld(),n=L(),r=Wf(),i=I();function a(){var e=[...arguments];return e=r.argsOrArgArray(e),e.length===1?n.innerFrom(e[0]):new t.Observable(o(e))}e.race=a;function o(e){return function(t){for(var r=[],a=function(a){r.push(n.innerFrom(e[a]).subscribe(i.createOperatorSubscriber(t,function(e){if(r){for(var n=0;n<r.length;n++)n!==a&&r[n].unsubscribe();r=null}t.next(e)})))},o=0;r&&!t.closed&&o<e.length;o++)a(o)}}e.raceInit=o}}),Zf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/range.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.range=void 0;var t=ld(),n=zd();function r(e,r,i){if(r??(r=e,e=0),r<=0)return n.EMPTY;var a=r+e;return new t.Observable(i?function(t){var n=e;return i.schedule(function(){n<a?(t.next(n++),this.schedule()):t.complete()})}:function(t){for(var n=e;n<a&&!t.closed;)t.next(n++);t.complete()})}e.range=r}}),Qf=p({"../../node_modules/rxjs/dist/cjs/internal/observable/using.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.using=void 0;var t=ld(),n=L(),r=zd();function i(e,i){return new t.Observable(function(t){var a=e(),o=i(a);return(o?n.innerFrom(o):r.EMPTY).subscribe(t),function(){a&&a.unsubscribe()}})}e.using=i}}),$f=p({"../../node_modules/rxjs/dist/cjs/internal/observable/zip.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.zip=void 0;var r=ld(),i=L(),a=Wf(),o=zd(),s=I(),c=Vd();function l(){var e=[...arguments],l=c.popResultSelector(e),u=a.argsOrArgArray(e);return u.length?new r.Observable(function(e){var r=u.map(function(){return[]}),a=u.map(function(){return!1});e.add(function(){r=a=null});for(var o=function(o){i.innerFrom(u[o]).subscribe(s.createOperatorSubscriber(e,function(i){if(r[o].push(i),r.every(function(e){return e.length})){var s=r.map(function(e){return e.shift()});e.next(l?l.apply(void 0,n([],t(s))):s),r.some(function(e,t){return!e.length&&a[t]})&&e.complete()}},function(){a[o]=!0,!r[o].length&&e.complete()}))},c=0;!e.closed&&c<u.length;c++)o(c);return function(){r=a=null}}):o.EMPTY}e.zip=l}}),ep=p({"../../node_modules/rxjs/dist/cjs/internal/types.js"(e){Object.defineProperty(e,`__esModule`,{value:!0})}}),tp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/audit.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.audit=void 0;var t=F(),n=L(),r=I();function i(e){return t.operate(function(t,i){var a=!1,o=null,s=null,c=!1,l=function(){if(s?.unsubscribe(),s=null,a){a=!1;var e=o;o=null,i.next(e)}c&&i.complete()},u=function(){s=null,c&&i.complete()};t.subscribe(r.createOperatorSubscriber(i,function(t){a=!0,o=t,s||n.innerFrom(e(t)).subscribe(s=r.createOperatorSubscriber(i,l,u))},function(){c=!0,(!a||!s||s.closed)&&i.complete()}))})}e.audit=i}}),np=p({"../../node_modules/rxjs/dist/cjs/internal/operators/auditTime.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.auditTime=void 0;var t=jd(),n=tp(),r=Bf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.audit(function(){return r.timer(e,i)})}e.auditTime=i}}),rp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/buffer.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.buffer=void 0;var t=F(),n=nd(),r=I(),i=L();function a(e){return t.operate(function(t,a){var o=[];return t.subscribe(r.createOperatorSubscriber(a,function(e){return o.push(e)},function(){a.next(o),a.complete()})),i.innerFrom(e).subscribe(r.createOperatorSubscriber(a,function(){var e=o;o=[],a.next(e)},n.noop)),function(){o=null}})}e.buffer=a}}),ip=p({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferCount.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.bufferCount=void 0;var n=F(),r=I(),i=Zu();function a(e,a){return a===void 0&&(a=null),a??=e,n.operate(function(n,o){var s=[],c=0;n.subscribe(r.createOperatorSubscriber(o,function(n){var r,l,u,d,f=null;c++%a===0&&s.push([]);try{for(var p=t(s),m=p.next();!m.done;m=p.next()){var h=m.value;h.push(n),e<=h.length&&(f??=[],f.push(h))}}catch(e){r={error:e}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(r)throw r.error}}if(f)try{for(var g=t(f),_=g.next();!_.done;_=g.next()){var h=_.value;i.arrRemove(s,h),o.next(h)}}catch(e){u={error:e}}finally{try{_&&!_.done&&(d=g.return)&&d.call(g)}finally{if(u)throw u.error}}},function(){var e,n;try{for(var r=t(s),i=r.next();!i.done;i=r.next()){var a=i.value;o.next(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}o.complete()},void 0,function(){s=null}))})}e.bufferCount=a}}),ap=p({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferTime.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.bufferTime=void 0;var n=Qu(),r=F(),i=I(),a=Zu(),o=jd(),s=Vd(),c=Xd();function l(e){var l=[...arguments].slice(1),u=s.popScheduler(l)??o.asyncScheduler,d=l[0]??null,f=l[1]||1/0;return r.operate(function(r,o){var s=[],l=!1,p=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(s,e),o.next(t),l&&m()},m=function(){if(s){var t=new n.Subscription;o.add(t);var r={buffer:[],subs:t};s.push(r),c.executeSchedule(t,u,function(){return p(r)},e)}};d!==null&&d>=0?c.executeSchedule(o,u,m,d,!0):l=!0,m();var h=i.createOperatorSubscriber(o,function(e){var n,r,i=s.slice();try{for(var a=t(i),o=a.next();!o.done;o=a.next()){var c=o.value,l=c.buffer;l.push(e),f<=l.length&&p(c)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},function(){for(;s?.length;)o.next(s.shift().buffer);h?.unsubscribe(),o.complete(),o.unsubscribe()},void 0,function(){return s=null});r.subscribe(h)})}e.bufferTime=l}}),op=p({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferToggle.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.bufferToggle=void 0;var n=Qu(),r=F(),i=L(),a=I(),o=nd(),s=Zu();function c(e,c){return r.operate(function(r,l){var u=[];i.innerFrom(e).subscribe(a.createOperatorSubscriber(l,function(e){var t=[];u.push(t);var r=new n.Subscription;r.add(i.innerFrom(c(e)).subscribe(a.createOperatorSubscriber(l,function(){s.arrRemove(u,t),l.next(t),r.unsubscribe()},o.noop)))},o.noop)),r.subscribe(a.createOperatorSubscriber(l,function(e){var n,r;try{for(var i=t(u),a=i.next();!a.done;a=i.next())a.value.push(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},function(){for(;u.length>0;)l.next(u.shift());l.complete()}))})}e.bufferToggle=c}}),sp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.bufferWhen=void 0;var t=F(),n=nd(),r=I(),i=L();function a(e){return t.operate(function(t,a){var o=null,s=null,c=function(){s?.unsubscribe();var t=o;o=[],t&&a.next(t),i.innerFrom(e()).subscribe(s=r.createOperatorSubscriber(a,c,n.noop))};c(),t.subscribe(r.createOperatorSubscriber(a,function(e){return o?.push(e)},function(){o&&a.next(o),a.complete()},void 0,function(){return o=s=null}))})}e.bufferWhen=a}}),cp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/catchError.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.catchError=void 0;var t=L(),n=I(),r=F();function i(e){return r.operate(function(r,a){var o=null,s=!1,c;o=r.subscribe(n.createOperatorSubscriber(a,void 0,void 0,function(n){c=t.innerFrom(e(n,i(e)(r))),o?(o.unsubscribe(),o=null,c.subscribe(a)):s=!0})),s&&(o.unsubscribe(),o=null,c.subscribe(a))})}e.catchError=i}}),lp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scanInternals=void 0;var t=I();function n(e,n,r,i,a){return function(o,s){var c=r,l=n,u=0;o.subscribe(t.createOperatorSubscriber(s,function(t){var n=u++;l=c?e(l,t,n):(c=!0,t),i&&s.next(l)},a&&(function(){c&&s.next(l),s.complete()})))}}e.scanInternals=n}}),up=p({"../../node_modules/rxjs/dist/cjs/internal/operators/reduce.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.reduce=void 0;var t=lp(),n=F();function r(e,r){return n.operate(t.scanInternals(e,r,arguments.length>=2,!1,!0))}e.reduce=r}}),dp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/toArray.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.toArray=void 0;var t=up(),n=F(),r=function(e,t){return e.push(t),e};function i(){return n.operate(function(e,n){t.reduce(r,[])(e).subscribe(n)})}e.toArray=i}}),fp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.joinAllInternals=void 0;var t=sd(),n=xf(),r=cd(),i=kf(),a=dp();function o(e,o){return r.pipe(a.toArray(),i.mergeMap(function(t){return e(t)}),o?n.mapOneOrManyArgs(o):t.identity)}e.joinAllInternals=o}}),pp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.combineLatestAll=void 0;var t=Df(),n=fp();function r(e){return n.joinAllInternals(t.combineLatest,e)}e.combineLatestAll=r}}),mp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/combineAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.combineAll=void 0,e.combineAll=pp().combineLatestAll}}),hp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatest.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.combineLatest=void 0;var r=Df(),i=F(),a=Wf(),o=xf(),s=cd(),c=Vd();function l(){var e=[...arguments],u=c.popResultSelector(e);return u?s.pipe(l.apply(void 0,n([],t(e))),o.mapOneOrManyArgs(u)):i.operate(function(i,o){r.combineLatestInit(n([i],t(a.argsOrArgArray(e))))(o)})}e.combineLatest=l}}),gp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.combineLatestWith=void 0;var r=hp();function i(){var e=[...arguments];return r.combineLatest.apply(void 0,n([],t(e)))}e.combineLatestWith=i}}),_p=p({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.concatMap=void 0;var t=kf(),n=Ju();function r(e,r){return n.isFunction(r)?t.mergeMap(e,r,1):t.mergeMap(e,1)}e.concatMap=r}}),vp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.concatMapTo=void 0;var t=_p(),n=Ju();function r(e,r){return n.isFunction(r)?t.concatMap(function(){return e},r):t.concatMap(function(){return e})}e.concatMapTo=r}}),yp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/concat.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.concat=void 0;var r=F(),i=jf(),a=Vd(),o=sf();function s(){var e=[...arguments],s=a.popScheduler(e);return r.operate(function(r,a){i.concatAll()(o.from(n([r],t(e)),s)).subscribe(a)})}e.concat=s}}),bp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/concatWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.concatWith=void 0;var r=yp();function i(){var e=[...arguments];return r.concat.apply(void 0,n([],t(e)))}e.concatWith=i}}),xp=p({"../../node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSubscribable=void 0;var t=ld();function n(e){return new t.Observable(function(t){return e.subscribe(t)})}e.fromSubscribable=n}}),Sp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/connect.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.connect=void 0;var t=gd(),n=L(),r=F(),i=xp(),a={connector:function(){return new t.Subject}};function o(e,t){t===void 0&&(t=a);var o=t.connector;return r.operate(function(t,r){var a=o();n.innerFrom(e(i.fromSubscribable(a))).subscribe(r),r.add(t.subscribe(a))})}e.connect=o}}),Cp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/count.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.count=void 0;var t=up();function n(e){return t.reduce(function(t,n,r){return!e||e(n,r)?t+1:t},0)}e.count=n}}),wp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/debounce.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.debounce=void 0;var t=F(),n=nd(),r=I(),i=L();function a(e){return t.operate(function(t,a){var o=!1,s=null,c=null,l=function(){if(c?.unsubscribe(),c=null,o){o=!1;var e=s;s=null,a.next(e)}};t.subscribe(r.createOperatorSubscriber(a,function(t){c?.unsubscribe(),o=!0,s=t,c=r.createOperatorSubscriber(a,l,n.noop),i.innerFrom(e(t)).subscribe(c)},function(){l(),a.complete()},void 0,function(){s=c=null}))})}e.debounce=a}}),Tp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.debounceTime=void 0;var t=jd(),n=F(),r=I();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.operate(function(t,n){var a=null,o=null,s=null,c=function(){if(a){a.unsubscribe(),a=null;var e=o;o=null,n.next(e)}};function l(){var t=s+e,r=i.now();if(r<t){a=this.schedule(void 0,t-r),n.add(a);return}c()}t.subscribe(r.createOperatorSubscriber(n,function(t){o=t,s=i.now(),a||(a=i.schedule(l,e),n.add(a))},function(){c(),n.complete()},void 0,function(){o=a=null}))})}e.debounceTime=i}}),Ep=p({"../../node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultIfEmpty=void 0;var t=F(),n=I();function r(e){return t.operate(function(t,r){var i=!1;t.subscribe(n.createOperatorSubscriber(r,function(e){i=!0,r.next(e)},function(){i||r.next(e),r.complete()}))})}e.defaultIfEmpty=r}}),Dp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/take.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.take=void 0;var t=zd(),n=F(),r=I();function i(e){return e<=0?function(){return t.EMPTY}:n.operate(function(t,n){var i=0;t.subscribe(r.createOperatorSubscriber(n,function(t){++i<=e&&(n.next(t),e<=i&&n.complete())}))})}e.take=i}}),Op=p({"../../node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.ignoreElements=void 0;var t=F(),n=I(),r=nd();function i(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,r.noop))})}e.ignoreElements=i}}),kp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mapTo.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mapTo=void 0;var t=bf();function n(e){return t.map(function(){return e})}e.mapTo=n}}),Ap=p({"../../node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.delayWhen=void 0;var t=Mf(),n=Dp(),r=Op(),i=kp(),a=kf(),o=L();function s(e,c){return c?function(i){return t.concat(c.pipe(n.take(1),r.ignoreElements()),i.pipe(s(e)))}:a.mergeMap(function(t,r){return o.innerFrom(e(t,r)).pipe(n.take(1),i.mapTo(t))})}e.delayWhen=s}}),jp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/delay.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.delay=void 0;var t=jd(),n=Ap(),r=Bf();function i(e,i){i===void 0&&(i=t.asyncScheduler);var a=r.timer(e,i);return n.delayWhen(function(){return a})}e.delay=i}}),Mp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.dematerialize=void 0;var t=uf(),n=F(),r=I();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){return t.observeNotification(e,n)}))})}e.dematerialize=i}}),Np=p({"../../node_modules/rxjs/dist/cjs/internal/operators/distinct.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.distinct=void 0;var t=F(),n=I(),r=nd(),i=L();function a(e,a){return t.operate(function(t,o){var s=new Set;t.subscribe(n.createOperatorSubscriber(o,function(t){var n=e?e(t):t;s.has(n)||(s.add(n),o.next(t))})),a&&i.innerFrom(a).subscribe(n.createOperatorSubscriber(o,function(){return s.clear()},r.noop))})}e.distinct=a}}),Pp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.distinctUntilChanged=void 0;var t=sd(),n=F(),r=I();function i(e,i){return i===void 0&&(i=t.identity),e??=a,n.operate(function(t,n){var a,o=!0;t.subscribe(r.createOperatorSubscriber(n,function(t){var r=i(t);(o||!e(a,r))&&(o=!1,a=r,n.next(t))}))})}e.distinctUntilChanged=i;function a(e,t){return e===t}}}),Fp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.distinctUntilKeyChanged=void 0;var t=Pp();function n(e,n){return t.distinctUntilChanged(function(t,r){return n?n(t[e],r[e]):t[e]===r[e]})}e.distinctUntilKeyChanged=n}}),Ip=p({"../../node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.throwIfEmpty=void 0;var t=ff(),n=F(),r=I();function i(e){return e===void 0&&(e=a),n.operate(function(t,n){var i=!1;t.subscribe(r.createOperatorSubscriber(n,function(e){i=!0,n.next(e)},function(){return i?n.complete():n.error(e())}))})}e.throwIfEmpty=i;function a(){return new t.EmptyError}}}),Lp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/elementAt.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.elementAt=void 0;var t=hf(),n=Jf(),r=Ip(),i=Ep(),a=Dp();function o(e,o){if(e<0)throw new t.ArgumentOutOfRangeError;var s=arguments.length>=2;return function(c){return c.pipe(n.filter(function(t,n){return n===e}),a.take(1),s?i.defaultIfEmpty(o):r.throwIfEmpty(function(){return new t.ArgumentOutOfRangeError}))}}e.elementAt=o}}),Rp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/endWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.endWith=void 0;var r=Mf(),i=cf();function a(){var e=[...arguments];return function(a){return r.concat(a,i.of.apply(void 0,n([],t(e))))}}e.endWith=a}}),zp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/every.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.every=void 0;var t=F(),n=I();function r(e,r){return t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(n){e.call(r,n,a++,t)||(i.next(!1),i.complete())},function(){i.next(!0),i.complete()}))})}e.every=r}}),Bp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.exhaustMap=void 0;var t=bf(),n=L(),r=F(),i=I();function a(e,o){return o?function(r){return r.pipe(a(function(r,i){return n.innerFrom(e(r,i)).pipe(t.map(function(e,t){return o(r,e,i,t)}))}))}:r.operate(function(t,r){var a=0,o=null,s=!1;t.subscribe(i.createOperatorSubscriber(r,function(t){o||(o=i.createOperatorSubscriber(r,void 0,function(){o=null,s&&r.complete()}),n.innerFrom(e(t,a++)).subscribe(o))},function(){s=!0,!o&&r.complete()}))})}e.exhaustMap=a}}),Vp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.exhaustAll=void 0;var t=Bp(),n=sd();function r(){return t.exhaustMap(n.identity)}e.exhaustAll=r}}),Hp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.exhaust=void 0,e.exhaust=Vp().exhaustAll}}),Up=p({"../../node_modules/rxjs/dist/cjs/internal/operators/expand.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.expand=void 0;var t=F(),n=Of();function r(e,r,i){return r===void 0&&(r=1/0),r=(r||0)<1?1/0:r,t.operate(function(t,a){return n.mergeInternals(t,a,e,r,void 0,!0,i)})}e.expand=r}}),Wp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/finalize.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.finalize=void 0;var t=F();function n(e){return t.operate(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}e.finalize=n}}),Gp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/find.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createFind=e.find=void 0;var t=F(),n=I();function r(e,n){return t.operate(i(e,n,`value`))}e.find=r;function i(e,t,r){var i=r===`index`;return function(r,a){var o=0;r.subscribe(n.createOperatorSubscriber(a,function(n){var s=o++;e.call(t,n,s,r)&&(a.next(i?s:n),a.complete())},function(){a.next(i?-1:void 0),a.complete()}))}}e.createFind=i}}),Kp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/findIndex.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.findIndex=void 0;var t=F(),n=Gp();function r(e,r){return t.operate(n.createFind(e,r,`index`))}e.findIndex=r}}),qp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/first.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.first=void 0;var t=ff(),n=Jf(),r=Dp(),i=Ep(),a=Ip(),o=sd();function s(e,s){var c=arguments.length>=2;return function(l){return l.pipe(e?n.filter(function(t,n){return e(t,n,l)}):o.identity,r.take(1),c?i.defaultIfEmpty(s):a.throwIfEmpty(function(){return new t.EmptyError}))}}e.first=s}}),Jp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.groupBy=void 0;var t=ld(),n=L(),r=gd(),i=F(),a=I();function o(e,o,s,c){return i.operate(function(i,l){var u;!o||typeof o==`function`?u=o:(s=o.duration,u=o.element,c=o.connector);var d=new Map,f=function(e){d.forEach(e),e(l)},p=function(e){return f(function(t){return t.error(e)})},m=0,h=!1,g=new a.OperatorSubscriber(l,function(t){try{var i=e(t),o=d.get(i);if(!o){d.set(i,o=c?c():new r.Subject);var f=_(i,o);if(l.next(f),s){var m=a.createOperatorSubscriber(o,function(){o.complete(),m?.unsubscribe()},void 0,void 0,function(){return d.delete(i)});g.add(n.innerFrom(s(f)).subscribe(m))}}o.next(u?u(t):t)}catch(e){p(e)}},function(){return f(function(e){return e.complete()})},p,function(){return d.clear()},function(){return h=!0,m===0});i.subscribe(g);function _(e,n){var r=new t.Observable(function(e){m++;var t=n.subscribe(e);return function(){t.unsubscribe(),--m===0&&h&&g.unsubscribe()}});return r.key=e,r}})}e.groupBy=o}}),Yp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmpty=void 0;var t=F(),n=I();function r(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}e.isEmpty=r}}),Xp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/takeLast.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.takeLast=void 0;var n=zd(),r=F(),i=I();function a(e){return e<=0?function(){return n.EMPTY}:r.operate(function(n,r){var a=[];n.subscribe(i.createOperatorSubscriber(r,function(t){a.push(t),e<a.length&&a.shift()},function(){var e,n;try{for(var i=t(a),o=i.next();!o.done;o=i.next()){var s=o.value;r.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}r.complete()},void 0,function(){a=null}))})}e.takeLast=a}}),Zp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/last.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.last=void 0;var t=ff(),n=Jf(),r=Xp(),i=Ip(),a=Ep(),o=sd();function s(e,s){var c=arguments.length>=2;return function(l){return l.pipe(e?n.filter(function(t,n){return e(t,n,l)}):o.identity,r.takeLast(1),c?a.defaultIfEmpty(s):i.throwIfEmpty(function(){return new t.EmptyError}))}}e.last=s}}),Qp=p({"../../node_modules/rxjs/dist/cjs/internal/operators/materialize.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.materialize=void 0;var t=uf(),n=F(),r=I();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){n.next(t.Notification.createNext(e))},function(){n.next(t.Notification.createComplete()),n.complete()},function(e){n.next(t.Notification.createError(e)),n.complete()}))})}e.materialize=i}}),$p=p({"../../node_modules/rxjs/dist/cjs/internal/operators/max.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.max=void 0;var t=up(),n=Ju();function r(e){return t.reduce(n.isFunction(e)?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t})}e.max=r}}),em=p({"../../node_modules/rxjs/dist/cjs/internal/operators/flatMap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.flatMap=void 0,e.flatMap=kf().mergeMap}}),tm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeMapTo=void 0;var t=kf(),n=Ju();function r(e,r,i){return i===void 0&&(i=1/0),n.isFunction(r)?t.mergeMap(function(){return e},r,i):(typeof r==`number`&&(i=r),t.mergeMap(function(){return e},i))}e.mergeMapTo=r}}),nm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeScan=void 0;var t=F(),n=Of();function r(e,r,i){return i===void 0&&(i=1/0),t.operate(function(t,a){var o=r;return n.mergeInternals(t,a,function(t,n){return e(o,t,n)},i,function(e){o=e},!1,void 0,function(){return o=null})})}e.mergeScan=r}}),rm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/merge.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;var r=F(),i=Af(),a=Vd(),o=sf();function s(){var e=[...arguments],s=a.popScheduler(e),c=a.popNumber(e,1/0);return r.operate(function(r,a){i.mergeAll(c)(o.from(n([r],t(e)),s)).subscribe(a)})}e.merge=s}}),im=p({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeWith=void 0;var r=rm();function i(){var e=[...arguments];return r.merge.apply(void 0,n([],t(e)))}e.mergeWith=i}}),am=p({"../../node_modules/rxjs/dist/cjs/internal/operators/min.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.min=void 0;var t=up(),n=Ju();function r(e){return t.reduce(n.isFunction(e)?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t})}e.min=r}}),om=p({"../../node_modules/rxjs/dist/cjs/internal/operators/multicast.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.multicast=void 0;var t=dd(),n=Ju(),r=Sp();function i(e,i){var a=n.isFunction(e)?e:function(){return e};return n.isFunction(i)?r.connect(i,{connector:a}):function(e){return new t.ConnectableObservable(e,a)}}e.multicast=i}}),sm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/onErrorResumeNextWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.onErrorResumeNext=e.onErrorResumeNextWith=void 0;var r=Wf(),i=Gf();function a(){var e=[...arguments],a=r.argsOrArgArray(e);return function(e){return i.onErrorResumeNext.apply(void 0,n([e],t(a)))}}e.onErrorResumeNextWith=a,e.onErrorResumeNext=a}}),cm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/pairwise.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.pairwise=void 0;var t=F(),n=I();function r(){return t.operate(function(e,t){var r,i=!1;e.subscribe(n.createOperatorSubscriber(t,function(e){var n=r;r=e,i&&t.next([n,e]),i=!0}))})}e.pairwise=r}}),lm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/pluck.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.pluck=void 0;var t=bf();function n(){var e=[...arguments],n=e.length;if(n===0)throw Error(`list of properties cannot be empty.`);return t.map(function(t){for(var r=t,i=0;i<n;i++){var a=r?.[e[i]];if(a!==void 0)r=a;else return}return r})}e.pluck=n}}),um=p({"../../node_modules/rxjs/dist/cjs/internal/operators/publish.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.publish=void 0;var t=gd(),n=om(),r=Sp();function i(e){return e?function(t){return r.connect(e)(t)}:function(e){return n.multicast(new t.Subject)(e)}}e.publish=i}}),dm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.publishBehavior=void 0;var t=_d(),n=dd();function r(e){return function(r){var i=new t.BehaviorSubject(e);return new n.ConnectableObservable(r,function(){return i})}}e.publishBehavior=r}}),fm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/publishLast.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.publishLast=void 0;var t=bd(),n=dd();function r(){return function(e){var r=new t.AsyncSubject;return new n.ConnectableObservable(e,function(){return r})}}e.publishLast=r}}),pm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.publishReplay=void 0;var t=yd(),n=om(),r=Ju();function i(e,i,a,o){a&&!r.isFunction(a)&&(o=a);var s=r.isFunction(a)?a:void 0;return function(r){return n.multicast(new t.ReplaySubject(e,i,o),s)(r)}}e.publishReplay=i}}),mm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/raceWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.raceWith=void 0;var r=Xf(),i=F(),a=sd();function o(){var e=[...arguments];return e.length?i.operate(function(i,a){r.raceInit(n([i],t(e)))(a)}):a.identity}e.raceWith=o}}),hm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/repeat.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.repeat=void 0;var t=zd(),n=F(),r=I(),i=L(),a=Bf();function o(e){var o,s=1/0,c;return e!=null&&(typeof e==`object`?(o=e.count,s=o===void 0?1/0:o,c=e.delay):s=e),s<=0?function(){return t.EMPTY}:n.operate(function(e,t){var n=0,o,l=function(){if(o?.unsubscribe(),o=null,c!=null){var e=typeof c==`number`?a.timer(c):i.innerFrom(c(n)),s=r.createOperatorSubscriber(t,function(){s.unsubscribe(),u()});e.subscribe(s)}else u()},u=function(){var i=!1;o=e.subscribe(r.createOperatorSubscriber(t,void 0,function(){++n<s?o?l():i=!0:t.complete()})),i&&l()};u()})}e.repeat=o}}),gm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.repeatWhen=void 0;var t=L(),n=gd(),r=F(),i=I();function a(e){return r.operate(function(r,a){var o,s=!1,c,l=!1,u=!1,d=function(){return u&&l&&(a.complete(),!0)},f=function(){return c||(c=new n.Subject,t.innerFrom(e(c)).subscribe(i.createOperatorSubscriber(a,function(){o?p():s=!0},function(){l=!0,d()}))),c},p=function(){u=!1,o=r.subscribe(i.createOperatorSubscriber(a,void 0,function(){u=!0,!d()&&f().next()})),s&&(o.unsubscribe(),o=null,s=!1,p())};p()})}e.repeatWhen=a}}),_m=p({"../../node_modules/rxjs/dist/cjs/internal/operators/retry.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.retry=void 0;var t=F(),n=I(),r=sd(),i=Bf(),a=L();function o(e){e===void 0&&(e=1/0);var o=e&&typeof e==`object`?e:{count:e},s=o.count,c=s===void 0?1/0:s,l=o.delay,u=o.resetOnSuccess,d=u===void 0?!1:u;return c<=0?r.identity:t.operate(function(e,t){var r=0,o,s=function(){var u=!1;o=e.subscribe(n.createOperatorSubscriber(t,function(e){d&&(r=0),t.next(e)},void 0,function(e){if(r++<c){var d=function(){o?(o.unsubscribe(),o=null,s()):u=!0};if(l!=null){var f=typeof l==`number`?i.timer(l):a.innerFrom(l(e,r)),p=n.createOperatorSubscriber(t,function(){p.unsubscribe(),d()},function(){t.complete()});f.subscribe(p)}else d()}else t.error(e)})),u&&(o.unsubscribe(),o=null,s())};s()})}e.retry=o}}),vm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.retryWhen=void 0;var t=L(),n=gd(),r=F(),i=I();function a(e){return r.operate(function(r,a){var o,s=!1,c,l=function(){o=r.subscribe(i.createOperatorSubscriber(a,void 0,void 0,function(r){c||(c=new n.Subject,t.innerFrom(e(c)).subscribe(i.createOperatorSubscriber(a,function(){return o?l():s=!0}))),c&&c.next(r)})),s&&(o.unsubscribe(),o=null,s=!1,l())};l()})}e.retryWhen=a}}),ym=p({"../../node_modules/rxjs/dist/cjs/internal/operators/sample.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.sample=void 0;var t=L(),n=F(),r=nd(),i=I();function a(e){return n.operate(function(n,a){var o=!1,s=null;n.subscribe(i.createOperatorSubscriber(a,function(e){o=!0,s=e})),t.innerFrom(e).subscribe(i.createOperatorSubscriber(a,function(){if(o){o=!1;var e=s;s=null,a.next(e)}},r.noop))})}e.sample=a}}),bm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.sampleTime=void 0;var t=jd(),n=ym(),r=Vf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.sample(r.interval(e,i))}e.sampleTime=i}}),xm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/scan.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.scan=void 0;var t=F(),n=lp();function r(e,r){return t.operate(n.scanInternals(e,r,arguments.length>=2,!0))}e.scan=r}}),Sm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.sequenceEqual=void 0;var t=F(),n=I(),r=L();function i(e,i){return i===void 0&&(i=function(e,t){return e===t}),t.operate(function(t,o){var s=a(),c=a(),l=function(e){o.next(e),o.complete()},u=function(e,t){var r=n.createOperatorSubscriber(o,function(n){var r=t.buffer,a=t.complete;r.length===0?a?l(!1):e.buffer.push(n):!i(n,r.shift())&&l(!1)},function(){e.complete=!0;var n=t.complete,i=t.buffer;n&&l(i.length===0),r?.unsubscribe()});return r};t.subscribe(u(s,c)),r.innerFrom(e).subscribe(u(c,s))})}e.sequenceEqual=i;function a(){return{buffer:[],complete:!1}}}}),Cm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/share.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.share=void 0;var r=L(),i=gd(),a=ad(),o=F();function s(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new i.Subject}:t,s=e.resetOnError,l=s===void 0?!0:s,u=e.resetOnComplete,d=u===void 0?!0:u,f=e.resetOnRefCountZero,p=f===void 0?!0:f;return function(e){var t,i,s,u=0,f=!1,m=!1,h=function(){i?.unsubscribe(),i=void 0},g=function(){h(),t=s=void 0,f=m=!1},_=function(){var e=t;g(),e?.unsubscribe()};return o.operate(function(e,o){u++,!m&&!f&&h();var v=s??=n();o.add(function(){u--,u===0&&!m&&!f&&(i=c(_,p))}),v.subscribe(o),!t&&u>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){m=!0,h(),i=c(g,l,e),v.error(e)},complete:function(){f=!0,h(),i=c(g,d),v.complete()}}),r.innerFrom(e).subscribe(t))})(e)}}e.share=s;function c(e,i){var o=[...arguments].slice(2);if(i===!0){e();return}if(i!==!1){var s=new a.SafeSubscriber({next:function(){s.unsubscribe(),e()}});return r.innerFrom(i.apply(void 0,n([],t(o)))).subscribe(s)}}}}),wm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.shareReplay=void 0;var t=yd(),n=Cm();function r(e,r,i){var a,o,s,c,l=!1;return e&&typeof e==`object`?(a=e.bufferSize,c=a===void 0?1/0:a,o=e.windowTime,r=o===void 0?1/0:o,s=e.refCount,l=s===void 0?!1:s,i=e.scheduler):c=e??1/0,n.share({connector:function(){return new t.ReplaySubject(c,r,i)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}e.shareReplay=r}}),Tm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/single.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.single=void 0;var t=ff(),n=_f(),r=gf(),i=F(),a=I();function o(e){return i.operate(function(i,o){var s=!1,c,l=!1,u=0;i.subscribe(a.createOperatorSubscriber(o,function(t){l=!0,(!e||e(t,u++,i))&&(s&&o.error(new n.SequenceError(`Too many matching values`)),s=!0,c=t)},function(){s?(o.next(c),o.complete()):o.error(l?new r.NotFoundError(`No matching values`):new t.EmptyError)}))})}e.single=o}}),Em=p({"../../node_modules/rxjs/dist/cjs/internal/operators/skip.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.skip=void 0;var t=Jf();function n(e){return t.filter(function(t,n){return e<=n})}e.skip=n}}),Dm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/skipLast.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.skipLast=void 0;var t=sd(),n=F(),r=I();function i(e){return e<=0?t.identity:n.operate(function(t,n){var i=Array(e),a=0;return t.subscribe(r.createOperatorSubscriber(n,function(t){var r=a++;if(r<e)i[r]=t;else{var o=r%e,s=i[o];i[o]=t,n.next(s)}})),function(){i=null}})}e.skipLast=i}}),Om=p({"../../node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.skipUntil=void 0;var t=F(),n=I(),r=L(),i=nd();function a(e){return t.operate(function(t,a){var o=!1,s=n.createOperatorSubscriber(a,function(){s?.unsubscribe(),o=!0},i.noop);r.innerFrom(e).subscribe(s),t.subscribe(n.createOperatorSubscriber(a,function(e){return o&&a.next(e)}))})}e.skipUntil=a}}),km=p({"../../node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.skipWhile=void 0;var t=F(),n=I();function r(e){return t.operate(function(t,r){var i=!1,a=0;t.subscribe(n.createOperatorSubscriber(r,function(t){return(i||=!e(t,a++))&&r.next(t)}))})}e.skipWhile=r}}),Am=p({"../../node_modules/rxjs/dist/cjs/internal/operators/startWith.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.startWith=void 0;var t=Mf(),n=Vd(),r=F();function i(){var e=[...arguments],i=n.popScheduler(e);return r.operate(function(n,r){(i?t.concat(e,n,i):t.concat(e,n)).subscribe(r)})}e.startWith=i}}),jm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.switchMap=void 0;var t=L(),n=F(),r=I();function i(e,i){return n.operate(function(n,a){var o=null,s=0,c=!1,l=function(){return c&&!o&&a.complete()};n.subscribe(r.createOperatorSubscriber(a,function(n){o?.unsubscribe();var c=0,u=s++;t.innerFrom(e(n,u)).subscribe(o=r.createOperatorSubscriber(a,function(e){return a.next(i?i(n,e,u,c++):e)},function(){o=null,l()}))},function(){c=!0,l()}))})}e.switchMap=i}}),Mm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/switchAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.switchAll=void 0;var t=jm(),n=sd();function r(){return t.switchMap(n.identity)}e.switchAll=r}}),Nm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.switchMapTo=void 0;var t=jm(),n=Ju();function r(e,r){return n.isFunction(r)?t.switchMap(function(){return e},r):t.switchMap(function(){return e})}e.switchMapTo=r}}),Pm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/switchScan.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.switchScan=void 0;var t=jm(),n=F();function r(e,r){return n.operate(function(n,i){var a=r;return t.switchMap(function(t,n){return e(a,t,n)},function(e,t){return a=t,t})(n).subscribe(i),function(){a=null}})}e.switchScan=r}}),Fm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.takeUntil=void 0;var t=F(),n=I(),r=L(),i=nd();function a(e){return t.operate(function(t,a){r.innerFrom(e).subscribe(n.createOperatorSubscriber(a,function(){return a.complete()},i.noop)),!a.closed&&t.subscribe(a)})}e.takeUntil=a}}),Im=p({"../../node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.takeWhile=void 0;var t=F(),n=I();function r(e,r){return r===void 0&&(r=!1),t.operate(function(t,i){var a=0;t.subscribe(n.createOperatorSubscriber(i,function(t){var n=e(t,a++);(n||r)&&i.next(t),!n&&i.complete()}))})}e.takeWhile=r}}),Lm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/tap.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.tap=void 0;var t=Ju(),n=F(),r=I(),i=sd();function a(e,a,o){var s=t.isFunction(e)||a||o?{next:e,error:a,complete:o}:e;return s?n.operate(function(e,t){var n;(n=s.subscribe)==null||n.call(s);var i=!0;e.subscribe(r.createOperatorSubscriber(t,function(e){var n;(n=s.next)==null||n.call(s,e),t.next(e)},function(){var e;i=!1,(e=s.complete)==null||e.call(s),t.complete()},function(e){var n;i=!1,(n=s.error)==null||n.call(s,e),t.error(e)},function(){var e,t;i&&((e=s.unsubscribe)==null||e.call(s)),(t=s.finalize)==null||t.call(s)}))}):i.identity}e.tap=a}}),Rm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/throttle.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.throttle=void 0;var t=F(),n=I(),r=L();function i(e,i){return t.operate(function(t,a){var o=i??{},s=o.leading,c=s===void 0?!0:s,l=o.trailing,u=l===void 0?!1:l,d=!1,f=null,p=null,m=!1,h=function(){p?.unsubscribe(),p=null,u&&(v(),m&&a.complete())},g=function(){p=null,m&&a.complete()},_=function(t){return p=r.innerFrom(e(t)).subscribe(n.createOperatorSubscriber(a,h,g))},v=function(){if(d){d=!1;var e=f;f=null,a.next(e),!m&&_(e)}};t.subscribe(n.createOperatorSubscriber(a,function(e){d=!0,f=e,!(p&&!p.closed)&&(c?v():_(e))},function(){m=!0,!(u&&d&&p&&!p.closed)&&a.complete()}))})}e.throttle=i}}),zm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.throttleTime=void 0;var t=jd(),n=Rm(),r=Bf();function i(e,i,a){i===void 0&&(i=t.asyncScheduler);var o=r.timer(e,i);return n.throttle(function(){return o},a)}e.throttleTime=i}}),Bm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.TimeInterval=e.timeInterval=void 0;var t=jd(),n=F(),r=I();function i(e){return e===void 0&&(e=t.asyncScheduler),n.operate(function(t,n){var i=e.now();t.subscribe(r.createOperatorSubscriber(n,function(t){var r=e.now(),o=r-i;i=r,n.next(new a(t,o))}))})}e.timeInterval=i;var a=(function(){function e(e,t){this.value=e,this.interval=t}return e})();e.TimeInterval=a}}),Vm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.timeoutWith=void 0;var t=jd(),n=vf(),r=yf();function i(e,i,a){var o,s,c;if(a??=t.async,n.isValidDate(e)?o=e:typeof e==`number`&&(s=e),i)c=function(){return i};else throw TypeError(`No observable provided to switch to`);if(o==null&&s==null)throw TypeError(`No timeout provided.`);return r.timeout({first:o,each:s,scheduler:a,with:c})}e.timeoutWith=i}}),Hm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/timestamp.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.timestamp=void 0;var t=vd(),n=bf();function r(e){return e===void 0&&(e=t.dateTimestampProvider),n.map(function(t){return{value:t,timestamp:e.now()}})}e.timestamp=r}}),Um=p({"../../node_modules/rxjs/dist/cjs/internal/operators/window.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.window=void 0;var t=gd(),n=F(),r=I(),i=nd(),a=L();function o(e){return n.operate(function(n,o){var s=new t.Subject;o.next(s.asObservable());var c=function(e){s.error(e),o.error(e)};return n.subscribe(r.createOperatorSubscriber(o,function(e){return s?.next(e)},function(){s.complete(),o.complete()},c)),a.innerFrom(e).subscribe(r.createOperatorSubscriber(o,function(){s.complete(),o.next(s=new t.Subject)},i.noop,c)),function(){s?.unsubscribe(),s=null}})}e.window=o}}),Wm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/windowCount.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.windowCount=void 0;var n=gd(),r=F(),i=I();function a(e,a){a===void 0&&(a=0);var o=a>0?a:e;return r.operate(function(r,a){var s=[new n.Subject],c=0;a.next(s[0].asObservable()),r.subscribe(i.createOperatorSubscriber(a,function(r){var i,l;try{for(var u=t(s),d=u.next();!d.done;d=u.next())d.value.next(r)}catch(e){i={error:e}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(i)throw i.error}}var f=c-e+1;if(f>=0&&f%o===0&&s.shift().complete(),++c%o===0){var p=new n.Subject;s.push(p),a.next(p.asObservable())}},function(){for(;s.length>0;)s.shift().complete();a.complete()},function(e){for(;s.length>0;)s.shift().error(e);a.error(e)},function(){s=null}))})}e.windowCount=a}}),Gm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/windowTime.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.windowTime=void 0;var t=gd(),n=jd(),r=Qu(),i=F(),a=I(),o=Zu(),s=Vd(),c=Xd();function l(e){var l=[...arguments].slice(1),u=s.popScheduler(l)??n.asyncScheduler,d=l[0]??null,f=l[1]||1/0;return i.operate(function(n,i){var s=[],l=!1,p=function(e){var t=e.window,n=e.subs;t.complete(),n.unsubscribe(),o.arrRemove(s,e),l&&m()},m=function(){if(s){var n=new r.Subscription;i.add(n);var a=new t.Subject,o={window:a,subs:n,seen:0};s.push(o),i.next(a.asObservable()),c.executeSchedule(n,u,function(){return p(o)},e)}};d!==null&&d>=0?c.executeSchedule(i,u,m,d,!0):l=!0,m();var h=function(e){return s.slice().forEach(e)},g=function(e){h(function(t){var n=t.window;return e(n)}),e(i),i.unsubscribe()};return n.subscribe(a.createOperatorSubscriber(i,function(e){h(function(t){t.window.next(e),f<=++t.seen&&p(t)})},function(){return g(function(e){return e.complete()})},function(e){return g(function(t){return t.error(e)})})),function(){s=null}})}e.windowTime=l}}),Km=p({"../../node_modules/rxjs/dist/cjs/internal/operators/windowToggle.js"(e){var t=e&&e.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,`__esModule`,{value:!0}),e.windowToggle=void 0;var n=gd(),r=Qu(),i=F(),a=L(),o=I(),s=nd(),c=Zu();function l(e,l){return i.operate(function(i,u){var d=[],f=function(e){for(;0<d.length;)d.shift().error(e);u.error(e)};a.innerFrom(e).subscribe(o.createOperatorSubscriber(u,function(e){var t=new n.Subject;d.push(t);var i=new r.Subscription,p=function(){c.arrRemove(d,t),t.complete(),i.unsubscribe()},m;try{m=a.innerFrom(l(e))}catch(e){f(e);return}u.next(t.asObservable()),i.add(m.subscribe(o.createOperatorSubscriber(u,p,s.noop,f)))},s.noop)),i.subscribe(o.createOperatorSubscriber(u,function(e){var n,r,i=d.slice();try{for(var a=t(i),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},function(){for(;0<d.length;)d.shift().complete();u.complete()},f,function(){for(;0<d.length;)d.shift().unsubscribe()}))})}e.windowToggle=l}}),qm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.windowWhen=void 0;var t=gd(),n=F(),r=I(),i=L();function a(e){return n.operate(function(n,a){var o,s,c=function(e){o.error(e),a.error(e)},l=function(){s?.unsubscribe(),o?.complete(),o=new t.Subject,a.next(o.asObservable());var n;try{n=i.innerFrom(e())}catch(e){c(e);return}n.subscribe(s=r.createOperatorSubscriber(a,l,l,c))};l(),n.subscribe(r.createOperatorSubscriber(a,function(e){return o.next(e)},function(){o.complete(),a.complete()},c,function(){s?.unsubscribe(),o=null}))})}e.windowWhen=a}}),Jm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/withLatestFrom.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.withLatestFrom=void 0;var r=F(),i=I(),a=L(),o=sd(),s=nd(),c=Vd();function l(){var e=[...arguments],l=c.popResultSelector(e);return r.operate(function(r,c){for(var u=e.length,d=Array(u),f=e.map(function(){return!1}),p=!1,m=function(t){a.innerFrom(e[t]).subscribe(i.createOperatorSubscriber(c,function(e){d[t]=e,!p&&!f[t]&&(f[t]=!0,(p=f.every(o.identity))&&(f=null))},s.noop))},h=0;h<u;h++)m(h);r.subscribe(i.createOperatorSubscriber(c,function(e){if(p){var r=n([e],t(d));c.next(l?l.apply(void 0,n([],t(r))):r)}}))})}e.withLatestFrom=l}}),Ym=p({"../../node_modules/rxjs/dist/cjs/internal/operators/zipAll.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.zipAll=void 0;var t=$f(),n=fp();function r(e){return n.joinAllInternals(t.zip,e)}e.zipAll=r}}),Xm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/zip.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.zip=void 0;var r=$f(),i=F();function a(){var e=[...arguments];return i.operate(function(i,a){r.zip.apply(void 0,n([i],t(e))).subscribe(a)})}e.zip=a}}),Zm=p({"../../node_modules/rxjs/dist/cjs/internal/operators/zipWith.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.zipWith=void 0;var r=Xm();function i(){var e=[...arguments];return r.zip.apply(void 0,n([],t(e)))}e.zipWith=i}}),Qm=p({"../../node_modules/rxjs/dist/cjs/index.js"(e){var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.interval=e.iif=e.generate=e.fromEventPattern=e.fromEvent=e.from=e.forkJoin=e.empty=e.defer=e.connectable=e.concat=e.combineLatest=e.bindNodeCallback=e.bindCallback=e.UnsubscriptionError=e.TimeoutError=e.SequenceError=e.ObjectUnsubscribedError=e.NotFoundError=e.EmptyError=e.ArgumentOutOfRangeError=e.firstValueFrom=e.lastValueFrom=e.isObservable=e.identity=e.noop=e.pipe=e.NotificationKind=e.Notification=e.Subscriber=e.Subscription=e.Scheduler=e.VirtualAction=e.VirtualTimeScheduler=e.animationFrameScheduler=e.animationFrame=e.queueScheduler=e.queue=e.asyncScheduler=e.async=e.asapScheduler=e.asap=e.AsyncSubject=e.ReplaySubject=e.BehaviorSubject=e.Subject=e.animationFrames=e.observable=e.ConnectableObservable=e.Observable=void 0,e.filter=e.expand=e.exhaustMap=e.exhaustAll=e.exhaust=e.every=e.endWith=e.elementAt=e.distinctUntilKeyChanged=e.distinctUntilChanged=e.distinct=e.dematerialize=e.delayWhen=e.delay=e.defaultIfEmpty=e.debounceTime=e.debounce=e.count=e.connect=e.concatWith=e.concatMapTo=e.concatMap=e.concatAll=e.combineLatestWith=e.combineLatestAll=e.combineAll=e.catchError=e.bufferWhen=e.bufferToggle=e.bufferTime=e.bufferCount=e.buffer=e.auditTime=e.audit=e.config=e.NEVER=e.EMPTY=e.scheduled=e.zip=e.using=e.timer=e.throwError=e.range=e.race=e.partition=e.pairs=e.onErrorResumeNext=e.of=e.never=e.merge=void 0,e.switchMap=e.switchAll=e.subscribeOn=e.startWith=e.skipWhile=e.skipUntil=e.skipLast=e.skip=e.single=e.shareReplay=e.share=e.sequenceEqual=e.scan=e.sampleTime=e.sample=e.refCount=e.retryWhen=e.retry=e.repeatWhen=e.repeat=e.reduce=e.raceWith=e.publishReplay=e.publishLast=e.publishBehavior=e.publish=e.pluck=e.pairwise=e.onErrorResumeNextWith=e.observeOn=e.multicast=e.min=e.mergeWith=e.mergeScan=e.mergeMapTo=e.mergeMap=e.flatMap=e.mergeAll=e.max=e.materialize=e.mapTo=e.map=e.last=e.isEmpty=e.ignoreElements=e.groupBy=e.first=e.findIndex=e.find=e.finalize=void 0,e.zipWith=e.zipAll=e.withLatestFrom=e.windowWhen=e.windowToggle=e.windowTime=e.windowCount=e.window=e.toArray=e.timestamp=e.timeoutWith=e.timeout=e.timeInterval=e.throwIfEmpty=e.throttleTime=e.throttle=e.tap=e.takeWhile=e.takeUntil=e.takeLast=e.take=e.switchScan=e.switchMapTo=void 0;var r=ld();Object.defineProperty(e,`Observable`,{enumerable:!0,get:function(){return r.Observable}});var i=dd();Object.defineProperty(e,`ConnectableObservable`,{enumerable:!0,get:function(){return i.ConnectableObservable}});var a=od();Object.defineProperty(e,`observable`,{enumerable:!0,get:function(){return a.observable}});var o=md();Object.defineProperty(e,`animationFrames`,{enumerable:!0,get:function(){return o.animationFrames}});var s=gd();Object.defineProperty(e,`Subject`,{enumerable:!0,get:function(){return s.Subject}});var c=_d();Object.defineProperty(e,`BehaviorSubject`,{enumerable:!0,get:function(){return c.BehaviorSubject}});var l=yd();Object.defineProperty(e,`ReplaySubject`,{enumerable:!0,get:function(){return l.ReplaySubject}});var u=bd();Object.defineProperty(e,`AsyncSubject`,{enumerable:!0,get:function(){return u.AsyncSubject}});var d=Ad();Object.defineProperty(e,`asap`,{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(e,`asapScheduler`,{enumerable:!0,get:function(){return d.asapScheduler}});var f=jd();Object.defineProperty(e,`async`,{enumerable:!0,get:function(){return f.async}}),Object.defineProperty(e,`asyncScheduler`,{enumerable:!0,get:function(){return f.asyncScheduler}});var p=Pd();Object.defineProperty(e,`queue`,{enumerable:!0,get:function(){return p.queue}}),Object.defineProperty(e,`queueScheduler`,{enumerable:!0,get:function(){return p.queueScheduler}});var m=Ld();Object.defineProperty(e,`animationFrame`,{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(e,`animationFrameScheduler`,{enumerable:!0,get:function(){return m.animationFrameScheduler}});var h=Rd();Object.defineProperty(e,`VirtualTimeScheduler`,{enumerable:!0,get:function(){return h.VirtualTimeScheduler}}),Object.defineProperty(e,`VirtualAction`,{enumerable:!0,get:function(){return h.VirtualAction}});var g=Dd();Object.defineProperty(e,`Scheduler`,{enumerable:!0,get:function(){return g.Scheduler}});var _=Qu();Object.defineProperty(e,`Subscription`,{enumerable:!0,get:function(){return _.Subscription}});var v=ad();Object.defineProperty(e,`Subscriber`,{enumerable:!0,get:function(){return v.Subscriber}});var y=uf();Object.defineProperty(e,`Notification`,{enumerable:!0,get:function(){return y.Notification}}),Object.defineProperty(e,`NotificationKind`,{enumerable:!0,get:function(){return y.NotificationKind}});var b=cd();Object.defineProperty(e,`pipe`,{enumerable:!0,get:function(){return b.pipe}});var x=nd();Object.defineProperty(e,`noop`,{enumerable:!0,get:function(){return x.noop}});var S=sd();Object.defineProperty(e,`identity`,{enumerable:!0,get:function(){return S.identity}});var C=df();Object.defineProperty(e,`isObservable`,{enumerable:!0,get:function(){return C.isObservable}});var w=pf();Object.defineProperty(e,`lastValueFrom`,{enumerable:!0,get:function(){return w.lastValueFrom}});var T=mf();Object.defineProperty(e,`firstValueFrom`,{enumerable:!0,get:function(){return T.firstValueFrom}});var E=hf();Object.defineProperty(e,`ArgumentOutOfRangeError`,{enumerable:!0,get:function(){return E.ArgumentOutOfRangeError}});var D=ff();Object.defineProperty(e,`EmptyError`,{enumerable:!0,get:function(){return D.EmptyError}});var O=gf();Object.defineProperty(e,`NotFoundError`,{enumerable:!0,get:function(){return O.NotFoundError}});var k=hd();Object.defineProperty(e,`ObjectUnsubscribedError`,{enumerable:!0,get:function(){return k.ObjectUnsubscribedError}});var A=_f();Object.defineProperty(e,`SequenceError`,{enumerable:!0,get:function(){return A.SequenceError}});var ee=yf();Object.defineProperty(e,`TimeoutError`,{enumerable:!0,get:function(){return ee.TimeoutError}});var te=Xu();Object.defineProperty(e,`UnsubscriptionError`,{enumerable:!0,get:function(){return te.UnsubscriptionError}});var j=Cf();Object.defineProperty(e,`bindCallback`,{enumerable:!0,get:function(){return j.bindCallback}});var ne=wf();Object.defineProperty(e,`bindNodeCallback`,{enumerable:!0,get:function(){return ne.bindNodeCallback}});var re=Df();Object.defineProperty(e,`combineLatest`,{enumerable:!0,get:function(){return re.combineLatest}});var ie=Mf();Object.defineProperty(e,`concat`,{enumerable:!0,get:function(){return ie.concat}});var ae=Pf();Object.defineProperty(e,`connectable`,{enumerable:!0,get:function(){return ae.connectable}});var M=Nf();Object.defineProperty(e,`defer`,{enumerable:!0,get:function(){return M.defer}});var oe=zd();Object.defineProperty(e,`empty`,{enumerable:!0,get:function(){return oe.empty}});var se=Ff();Object.defineProperty(e,`forkJoin`,{enumerable:!0,get:function(){return se.forkJoin}});var ce=sf();Object.defineProperty(e,`from`,{enumerable:!0,get:function(){return ce.from}});var le=If();Object.defineProperty(e,`fromEvent`,{enumerable:!0,get:function(){return le.fromEvent}});var ue=Lf();Object.defineProperty(e,`fromEventPattern`,{enumerable:!0,get:function(){return ue.fromEventPattern}});var N=Rf();Object.defineProperty(e,`generate`,{enumerable:!0,get:function(){return N.generate}});var de=zf();Object.defineProperty(e,`iif`,{enumerable:!0,get:function(){return de.iif}});var fe=Vf();Object.defineProperty(e,`interval`,{enumerable:!0,get:function(){return fe.interval}});var pe=Hf();Object.defineProperty(e,`merge`,{enumerable:!0,get:function(){return pe.merge}});var me=Uf();Object.defineProperty(e,`never`,{enumerable:!0,get:function(){return me.never}});var he=cf();Object.defineProperty(e,`of`,{enumerable:!0,get:function(){return he.of}});var ge=Gf();Object.defineProperty(e,`onErrorResumeNext`,{enumerable:!0,get:function(){return ge.onErrorResumeNext}});var _e=Kf();Object.defineProperty(e,`pairs`,{enumerable:!0,get:function(){return _e.pairs}});var ve=Yf();Object.defineProperty(e,`partition`,{enumerable:!0,get:function(){return ve.partition}});var ye=Xf();Object.defineProperty(e,`race`,{enumerable:!0,get:function(){return ye.race}});var be=Zf();Object.defineProperty(e,`range`,{enumerable:!0,get:function(){return be.range}});var xe=lf();Object.defineProperty(e,`throwError`,{enumerable:!0,get:function(){return xe.throwError}});var Se=Bf();Object.defineProperty(e,`timer`,{enumerable:!0,get:function(){return Se.timer}});var Ce=Qf();Object.defineProperty(e,`using`,{enumerable:!0,get:function(){return Ce.using}});var we=$f();Object.defineProperty(e,`zip`,{enumerable:!0,get:function(){return we.zip}});var Te=of();Object.defineProperty(e,`scheduled`,{enumerable:!0,get:function(){return Te.scheduled}});var Ee=zd();Object.defineProperty(e,`EMPTY`,{enumerable:!0,get:function(){return Ee.EMPTY}});var De=Uf();Object.defineProperty(e,`NEVER`,{enumerable:!0,get:function(){return De.NEVER}}),n(ep(),e);var Oe=$u();Object.defineProperty(e,`config`,{enumerable:!0,get:function(){return Oe.config}});var ke=tp();Object.defineProperty(e,`audit`,{enumerable:!0,get:function(){return ke.audit}});var Ae=np();Object.defineProperty(e,`auditTime`,{enumerable:!0,get:function(){return Ae.auditTime}});var je=rp();Object.defineProperty(e,`buffer`,{enumerable:!0,get:function(){return je.buffer}});var Me=ip();Object.defineProperty(e,`bufferCount`,{enumerable:!0,get:function(){return Me.bufferCount}});var Ne=ap();Object.defineProperty(e,`bufferTime`,{enumerable:!0,get:function(){return Ne.bufferTime}});var Pe=op();Object.defineProperty(e,`bufferToggle`,{enumerable:!0,get:function(){return Pe.bufferToggle}});var Fe=sp();Object.defineProperty(e,`bufferWhen`,{enumerable:!0,get:function(){return Fe.bufferWhen}});var Ie=cp();Object.defineProperty(e,`catchError`,{enumerable:!0,get:function(){return Ie.catchError}});var Le=mp();Object.defineProperty(e,`combineAll`,{enumerable:!0,get:function(){return Le.combineAll}});var Re=pp();Object.defineProperty(e,`combineLatestAll`,{enumerable:!0,get:function(){return Re.combineLatestAll}});var ze=gp();Object.defineProperty(e,`combineLatestWith`,{enumerable:!0,get:function(){return ze.combineLatestWith}});var Be=jf();Object.defineProperty(e,`concatAll`,{enumerable:!0,get:function(){return Be.concatAll}});var Ve=_p();Object.defineProperty(e,`concatMap`,{enumerable:!0,get:function(){return Ve.concatMap}});var He=vp();Object.defineProperty(e,`concatMapTo`,{enumerable:!0,get:function(){return He.concatMapTo}});var Ue=bp();Object.defineProperty(e,`concatWith`,{enumerable:!0,get:function(){return Ue.concatWith}});var We=Sp();Object.defineProperty(e,`connect`,{enumerable:!0,get:function(){return We.connect}});var Ge=Cp();Object.defineProperty(e,`count`,{enumerable:!0,get:function(){return Ge.count}});var Ke=wp();Object.defineProperty(e,`debounce`,{enumerable:!0,get:function(){return Ke.debounce}});var qe=Tp();Object.defineProperty(e,`debounceTime`,{enumerable:!0,get:function(){return qe.debounceTime}});var Je=Ep();Object.defineProperty(e,`defaultIfEmpty`,{enumerable:!0,get:function(){return Je.defaultIfEmpty}});var Ye=jp();Object.defineProperty(e,`delay`,{enumerable:!0,get:function(){return Ye.delay}});var Xe=Ap();Object.defineProperty(e,`delayWhen`,{enumerable:!0,get:function(){return Xe.delayWhen}});var Ze=Mp();Object.defineProperty(e,`dematerialize`,{enumerable:!0,get:function(){return Ze.dematerialize}});var Qe=Np();Object.defineProperty(e,`distinct`,{enumerable:!0,get:function(){return Qe.distinct}});var $e=Pp();Object.defineProperty(e,`distinctUntilChanged`,{enumerable:!0,get:function(){return $e.distinctUntilChanged}});var et=Fp();Object.defineProperty(e,`distinctUntilKeyChanged`,{enumerable:!0,get:function(){return et.distinctUntilKeyChanged}});var tt=Lp();Object.defineProperty(e,`elementAt`,{enumerable:!0,get:function(){return tt.elementAt}});var nt=Rp();Object.defineProperty(e,`endWith`,{enumerable:!0,get:function(){return nt.endWith}});var rt=zp();Object.defineProperty(e,`every`,{enumerable:!0,get:function(){return rt.every}});var it=Hp();Object.defineProperty(e,`exhaust`,{enumerable:!0,get:function(){return it.exhaust}});var at=Vp();Object.defineProperty(e,`exhaustAll`,{enumerable:!0,get:function(){return at.exhaustAll}});var ot=Bp();Object.defineProperty(e,`exhaustMap`,{enumerable:!0,get:function(){return ot.exhaustMap}});var st=Up();Object.defineProperty(e,`expand`,{enumerable:!0,get:function(){return st.expand}});var ct=Jf();Object.defineProperty(e,`filter`,{enumerable:!0,get:function(){return ct.filter}});var lt=Wp();Object.defineProperty(e,`finalize`,{enumerable:!0,get:function(){return lt.finalize}});var ut=Gp();Object.defineProperty(e,`find`,{enumerable:!0,get:function(){return ut.find}});var dt=Kp();Object.defineProperty(e,`findIndex`,{enumerable:!0,get:function(){return dt.findIndex}});var ft=qp();Object.defineProperty(e,`first`,{enumerable:!0,get:function(){return ft.first}});var pt=Jp();Object.defineProperty(e,`groupBy`,{enumerable:!0,get:function(){return pt.groupBy}});var mt=Op();Object.defineProperty(e,`ignoreElements`,{enumerable:!0,get:function(){return mt.ignoreElements}});var ht=Yp();Object.defineProperty(e,`isEmpty`,{enumerable:!0,get:function(){return ht.isEmpty}});var gt=Zp();Object.defineProperty(e,`last`,{enumerable:!0,get:function(){return gt.last}});var _t=bf();Object.defineProperty(e,`map`,{enumerable:!0,get:function(){return _t.map}});var vt=kp();Object.defineProperty(e,`mapTo`,{enumerable:!0,get:function(){return vt.mapTo}});var yt=Qp();Object.defineProperty(e,`materialize`,{enumerable:!0,get:function(){return yt.materialize}});var bt=$p();Object.defineProperty(e,`max`,{enumerable:!0,get:function(){return bt.max}});var xt=Af();Object.defineProperty(e,`mergeAll`,{enumerable:!0,get:function(){return xt.mergeAll}});var St=em();Object.defineProperty(e,`flatMap`,{enumerable:!0,get:function(){return St.flatMap}});var Ct=kf();Object.defineProperty(e,`mergeMap`,{enumerable:!0,get:function(){return Ct.mergeMap}});var wt=tm();Object.defineProperty(e,`mergeMapTo`,{enumerable:!0,get:function(){return wt.mergeMapTo}});var Tt=nm();Object.defineProperty(e,`mergeScan`,{enumerable:!0,get:function(){return Tt.mergeScan}});var Et=im();Object.defineProperty(e,`mergeWith`,{enumerable:!0,get:function(){return Et.mergeWith}});var Dt=am();Object.defineProperty(e,`min`,{enumerable:!0,get:function(){return Dt.min}});var Ot=om();Object.defineProperty(e,`multicast`,{enumerable:!0,get:function(){return Ot.multicast}});var kt=Zd();Object.defineProperty(e,`observeOn`,{enumerable:!0,get:function(){return kt.observeOn}});var At=sm();Object.defineProperty(e,`onErrorResumeNextWith`,{enumerable:!0,get:function(){return At.onErrorResumeNextWith}});var jt=cm();Object.defineProperty(e,`pairwise`,{enumerable:!0,get:function(){return jt.pairwise}});var Mt=lm();Object.defineProperty(e,`pluck`,{enumerable:!0,get:function(){return Mt.pluck}});var Nt=um();Object.defineProperty(e,`publish`,{enumerable:!0,get:function(){return Nt.publish}});var Pt=dm();Object.defineProperty(e,`publishBehavior`,{enumerable:!0,get:function(){return Pt.publishBehavior}});var Ft=fm();Object.defineProperty(e,`publishLast`,{enumerable:!0,get:function(){return Ft.publishLast}});var It=pm();Object.defineProperty(e,`publishReplay`,{enumerable:!0,get:function(){return It.publishReplay}});var Lt=mm();Object.defineProperty(e,`raceWith`,{enumerable:!0,get:function(){return Lt.raceWith}});var Rt=up();Object.defineProperty(e,`reduce`,{enumerable:!0,get:function(){return Rt.reduce}});var zt=hm();Object.defineProperty(e,`repeat`,{enumerable:!0,get:function(){return zt.repeat}});var Bt=gm();Object.defineProperty(e,`repeatWhen`,{enumerable:!0,get:function(){return Bt.repeatWhen}});var Vt=_m();Object.defineProperty(e,`retry`,{enumerable:!0,get:function(){return Vt.retry}});var Ht=vm();Object.defineProperty(e,`retryWhen`,{enumerable:!0,get:function(){return Ht.retryWhen}});var Ut=ud();Object.defineProperty(e,`refCount`,{enumerable:!0,get:function(){return Ut.refCount}});var Wt=ym();Object.defineProperty(e,`sample`,{enumerable:!0,get:function(){return Wt.sample}});var Gt=bm();Object.defineProperty(e,`sampleTime`,{enumerable:!0,get:function(){return Gt.sampleTime}});var Kt=xm();Object.defineProperty(e,`scan`,{enumerable:!0,get:function(){return Kt.scan}});var qt=Sm();Object.defineProperty(e,`sequenceEqual`,{enumerable:!0,get:function(){return qt.sequenceEqual}});var Jt=Cm();Object.defineProperty(e,`share`,{enumerable:!0,get:function(){return Jt.share}});var Yt=wm();Object.defineProperty(e,`shareReplay`,{enumerable:!0,get:function(){return Yt.shareReplay}});var Xt=Tm();Object.defineProperty(e,`single`,{enumerable:!0,get:function(){return Xt.single}});var Zt=Em();Object.defineProperty(e,`skip`,{enumerable:!0,get:function(){return Zt.skip}});var Qt=Dm();Object.defineProperty(e,`skipLast`,{enumerable:!0,get:function(){return Qt.skipLast}});var $t=Om();Object.defineProperty(e,`skipUntil`,{enumerable:!0,get:function(){return $t.skipUntil}});var en=km();Object.defineProperty(e,`skipWhile`,{enumerable:!0,get:function(){return en.skipWhile}});var tn=Am();Object.defineProperty(e,`startWith`,{enumerable:!0,get:function(){return tn.startWith}});var nn=Qd();Object.defineProperty(e,`subscribeOn`,{enumerable:!0,get:function(){return nn.subscribeOn}});var rn=Mm();Object.defineProperty(e,`switchAll`,{enumerable:!0,get:function(){return rn.switchAll}});var an=jm();Object.defineProperty(e,`switchMap`,{enumerable:!0,get:function(){return an.switchMap}});var on=Nm();Object.defineProperty(e,`switchMapTo`,{enumerable:!0,get:function(){return on.switchMapTo}});var sn=Pm();Object.defineProperty(e,`switchScan`,{enumerable:!0,get:function(){return sn.switchScan}});var cn=Dp();Object.defineProperty(e,`take`,{enumerable:!0,get:function(){return cn.take}});var ln=Xp();Object.defineProperty(e,`takeLast`,{enumerable:!0,get:function(){return ln.takeLast}});var un=Fm();Object.defineProperty(e,`takeUntil`,{enumerable:!0,get:function(){return un.takeUntil}});var dn=Im();Object.defineProperty(e,`takeWhile`,{enumerable:!0,get:function(){return dn.takeWhile}});var fn=Lm();Object.defineProperty(e,`tap`,{enumerable:!0,get:function(){return fn.tap}});var pn=Rm();Object.defineProperty(e,`throttle`,{enumerable:!0,get:function(){return pn.throttle}});var mn=zm();Object.defineProperty(e,`throttleTime`,{enumerable:!0,get:function(){return mn.throttleTime}});var hn=Ip();Object.defineProperty(e,`throwIfEmpty`,{enumerable:!0,get:function(){return hn.throwIfEmpty}});var gn=Bm();Object.defineProperty(e,`timeInterval`,{enumerable:!0,get:function(){return gn.timeInterval}});var _n=yf();Object.defineProperty(e,`timeout`,{enumerable:!0,get:function(){return _n.timeout}});var vn=Vm();Object.defineProperty(e,`timeoutWith`,{enumerable:!0,get:function(){return vn.timeoutWith}});var yn=Hm();Object.defineProperty(e,`timestamp`,{enumerable:!0,get:function(){return yn.timestamp}});var bn=dp();Object.defineProperty(e,`toArray`,{enumerable:!0,get:function(){return bn.toArray}});var xn=Um();Object.defineProperty(e,`window`,{enumerable:!0,get:function(){return xn.window}});var Sn=Wm();Object.defineProperty(e,`windowCount`,{enumerable:!0,get:function(){return Sn.windowCount}});var Cn=Gm();Object.defineProperty(e,`windowTime`,{enumerable:!0,get:function(){return Cn.windowTime}});var wn=Km();Object.defineProperty(e,`windowToggle`,{enumerable:!0,get:function(){return wn.windowToggle}});var Tn=qm();Object.defineProperty(e,`windowWhen`,{enumerable:!0,get:function(){return Tn.windowWhen}});var En=Jm();Object.defineProperty(e,`withLatestFrom`,{enumerable:!0,get:function(){return En.withLatestFrom}});var Dn=Ym();Object.defineProperty(e,`zipAll`,{enumerable:!0,get:function(){return Dn.zipAll}});var On=Zm();Object.defineProperty(e,`zipWith`,{enumerable:!0,get:function(){return On.zipWith}})}}),$m=class{constructor(){if(typeof window>`u`)throw Error(`WebBrowserStorage is client-only. It must not be constructed on the server — a single process-wide instance would leak tokens between HTTP requests. Wrap any code path that constructs this in "use client".`)}get(e){return localStorage.getItem(e)}set(e,t){localStorage.setItem(e,t)}delete(e){localStorage.removeItem(e)}subscribe(e){let t=t=>{t.key!==null&&e(t.key,t.newValue)};return window.addEventListener(`storage`,t),()=>{window.removeEventListener(`storage`,t)}}},eh=(0,m.createContext)(null);function th({browser:e,storage:t,sessionFactory:n,children:r}){let i=(0,m.useMemo)(()=>e??Ru({storage:t??new $m,sessionFactory:n??Iu()}),[e,t,n]);return(0,P.jsx)(eh.Provider,{value:i,children:r})}function R(){let e=(0,m.useContext)(eh);if(!e)throw Error(`useSemiont must be used within a <SemiontProvider>`);return e}var nh={success:(0,P.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}),error:(0,P.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}),warning:(0,P.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})}),info:(0,P.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})};function rh({toast:e,onClose:t}){return(0,m.useEffect)(()=>{let n=setTimeout(()=>{t(e.id)},e.duration||3e3);return()=>clearTimeout(n)},[e,t]),(0,P.jsxs)(`div`,{className:`semiont-toast`,"data-variant":e.type,role:`alert`,children:[(0,P.jsx)(`div`,{className:`semiont-toast-icon-wrapper`,children:nh[e.type]}),(0,P.jsx)(`p`,{className:`semiont-toast-message`,children:e.message}),(0,P.jsx)(`button`,{onClick:()=>t(e.id),className:`semiont-toast-close`,"aria-label":`Close`,children:(0,P.jsx)(`svg`,{className:`semiont-toast-close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function ih({toasts:e,onClose:t}){let[n,r]=(0,m.useState)(!1);return(0,m.useEffect)(()=>(r(!0),()=>r(!1)),[]),n?(0,h.createPortal)((0,P.jsx)(`div`,{className:`semiont-toast-container`,children:e.map(e=>(0,P.jsx)(rh,{toast:e,onClose:t},e.id))}),document.body):null}var ah=m.createContext(void 0);function oh({children:e}){let[t,n]=(0,m.useState)([]),r=m.useCallback((e,t=`info`,r)=>{let i=Date.now().toString(),a=r===void 0?{id:i,message:e,type:t}:{id:i,message:e,type:t,duration:r};n(e=>[...e,a])},[]),i=m.useCallback((e,t)=>r(e,`success`,t),[r]),a=m.useCallback((e,t)=>r(e,`error`,t),[r]),o=m.useCallback((e,t)=>r(e,`warning`,t),[r]),s=m.useCallback((e,t)=>r(e,`info`,t),[r]),c=m.useCallback(e=>{n(t=>t.filter(t=>t.id!==e))},[]),l=m.useMemo(()=>({showToast:r,showSuccess:i,showError:a,showWarning:o,showInfo:s}),[r,i,a,o,s]);return(0,P.jsxs)(ah.Provider,{value:l,children:[e,(0,P.jsx)(ih,{toasts:t,onClose:c})]})}function sh(){let e=m.useContext(ah);if(e===void 0)throw Error(`useToast must be used within a ToastProvider`);return e}var ch=f({"../../translations/ar.json":()=>b(()=>import(`./ar-U2EXWUMQ-Ds9Pt3_I.js`),[]),"../../translations/bn.json":()=>b(()=>import(`./bn-DRJGV772-BUYrNEk8.js`),[]),"../../translations/cs.json":()=>b(()=>import(`./cs-PTWDM23V-DfbMzFEw.js`),[]),"../../translations/da.json":()=>b(()=>import(`./da-KSNIKYSS-BMtq201F.js`),[]),"../../translations/de.json":()=>b(()=>import(`./de-F2XBEWFY-ChjoYEH0.js`),[]),"../../translations/el.json":()=>b(()=>import(`./el-DLD2GWAP-ClFunpNV.js`),[]),"../../translations/en.json":()=>b(()=>import(`./en-L45VK7BS-C9ArL-E1.js`),__vite__mapDeps([0,1])),"../../translations/es.json":()=>b(()=>import(`./es-WLPYWGB5-C53vYarX.js`),[]),"../../translations/fa.json":()=>b(()=>import(`./fa-BAXHSDZG-DJia4XF_.js`),[]),"../../translations/fi.json":()=>b(()=>import(`./fi-FCHSYVOT-D2etzjyC.js`),[]),"../../translations/fr.json":()=>b(()=>import(`./fr-3UERBSL6-Bi8o9u26.js`),[]),"../../translations/he.json":()=>b(()=>import(`./he-F6F3FV2K-CwGkucCK.js`),[]),"../../translations/hi.json":()=>b(()=>import(`./hi-4BK6IK7Q-fsSpyO-Z.js`),[]),"../../translations/id.json":()=>b(()=>import(`./id-7ECCWP3J-MhvUbYNG.js`),[]),"../../translations/it.json":()=>b(()=>import(`./it-234Z6XK6-n-8MkFtz.js`),[]),"../../translations/ja.json":()=>b(()=>import(`./ja-PJWQI4OQ-CbrcVSYZ.js`),[]),"../../translations/ko.json":()=>b(()=>import(`./ko-APUEW2RS-CLubHAbf.js`),[]),"../../translations/ms.json":()=>b(()=>import(`./ms-PJBZWZWD-Bu45eJYe.js`),[]),"../../translations/nl.json":()=>b(()=>import(`./nl-L4C3ZBCU-bLU3oN_N.js`),[]),"../../translations/no.json":()=>b(()=>import(`./no-QE5N5KNG-BCG75Nm1.js`),[]),"../../translations/pl.json":()=>b(()=>import(`./pl-5Q2D23PD-DgP2517z.js`),[]),"../../translations/pt.json":()=>b(()=>import(`./pt-AIGUOIOC-CN21pR38.js`),[]),"../../translations/ro.json":()=>b(()=>import(`./ro-T56CSHTY-mCdsn9QL.js`),[]),"../../translations/sv.json":()=>b(()=>import(`./sv-L4TJQ2UH-Cj1jmTXz.js`),[]),"../../translations/th.json":()=>b(()=>import(`./th-6O7Y6O2Q-Db0HgJLY.js`),[]),"../../translations/tr.json":()=>b(()=>import(`./tr-D4CQCSNO-B0u3f4nL.js`),[]),"../../translations/uk.json":()=>b(()=>import(`./uk-2HMQG6ND-Dx2FfvV4.js`),[]),"../../translations/vi.json":()=>b(()=>import(`./vi-XVJ4RUEJ-CeoZ1h3m.js`),[]),"../../translations/zh.json":()=>b(()=>import(`./zh-K2KDPGHK-BriluvPe.js`),[])}),lh=(0,m.createContext)(null),uh=new Map;function dh(e,t){let n=e.match(/\{(\w+),\s*plural,\s*/);if(!n)return e;let r=t[n[1]];if(r===void 0)return e;let i=n[0].length,a=1,o=i;for(let t=i;t<e.length;t++)if(e[t]===`{`)a++;else if(e[t]===`}`&&(a--,a===0)){o=t;break}let s=e.substring(i,o),c={},l=/(?:=(\d+)|(\w+))\s*\{([^}]+)\}/g,u;for(;(u=l.exec(s))!==null;){let[,e,t,n]=u,r=e===void 0?t:`=${e}`;c[r]=n}let d=c[`=${r}`];if(d!==void 0){let t=d.replace(/#/g,String(r));return e.substring(0,n.index)+t+e.substring(o+1)}let f=c.other;if(f!==void 0){let t=f.replace(/#/g,String(r));return e.substring(0,n.index)+t+e.substring(o+1)}return e}async function fh(e){if(uh.has(e))return uh.get(e);if(e===`en`)return uh.set(`en`,l),l;try{let t=await ch(`../../translations/${e}.json`),n=t.default||t;return uh.set(e,n),n}catch(t){return console.error(`Failed to load translations for locale: ${e}`,t),l}}var ph={t:(e,t,n)=>{let r=l[e]?.[t];if(!r)return console.warn(`Translation not found for ${e}.${t}`),`${e}.${t}`;if(n&&typeof r==`string`){let e=r;return e=dh(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}};function mh({translationManager:e,locale:t,loadingComponent:n=null,children:r}){let[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(!1);(0,m.useEffect)(()=>{t&&!e&&(s(!0),fh(t).then(e=>{a(e),s(!1)}).catch(e=>{console.error(`Failed to load translations:`,e),a(l),s(!1)}))},[t,e]);let c=(0,m.useMemo)(()=>i?{t:(e,n,r)=>{let a=i[e]?.[n];if(!a)return console.warn(`Translation not found for ${e}.${n} in locale ${t}`),`${e}.${n}`;if(r&&typeof a==`string`){let e=a;return e=dh(e,r),Object.entries(r).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return a}}:null,[i,t]);return e?(0,P.jsx)(lh.Provider,{value:e,children:r}):t&&o?(0,P.jsx)(P.Fragment,{children:n}):t&&c?(0,P.jsx)(lh.Provider,{value:c,children:r}):(0,P.jsx)(lh.Provider,{value:ph,children:r})}function hh(e){let t=(0,m.useContext)(lh);return t?(n,r)=>t.t(e,n,r):(t,n)=>{let r=l[e]?.[t];if(!r)return console.warn(`Translation not found for ${e}.${t}`),`${e}.${t}`;if(n&&typeof r==`string`){let e=r;return e=dh(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}}var gh=(0,m.createContext)(null),_h={didCatch:!1,error:null},vh=class extends m.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_h}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(e!==null){var t,n,r=[...arguments];(t=(n=this.props).onReset)==null||t.call(n,{args:r,reason:`imperative-api`}),this.setState(_h)}}componentDidCatch(e,t){var n,r;(n=(r=this.props).onError)==null||n.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;if(n&&t.error!==null&&yh(e.resetKeys,r)){var i,a;(i=(a=this.props).onReset)==null||i.call(a,{next:r,prev:e.resetKeys,reason:`keys`}),this.setState(_h)}}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,m.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,m.createElement)(gh.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function yh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var bh=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),xh=t(((e,t)=>{t.exports=bh()})),Sh=t(((e,t)=>{t.exports={}})),Ch=t(((e,t)=>{var n=t.exports={},r,i;function a(){throw Error(`setTimeout has not been defined`)}function o(){throw Error(`clearTimeout has not been defined`)}(function(){try{r=typeof setTimeout==`function`?setTimeout:a}catch{r=a}try{i=typeof clearTimeout==`function`?clearTimeout:o}catch{i=o}})();function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}function c(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch{try{return i.call(null,e)}catch{return i.call(this,e)}}}var l=[],u=!1,d,f=-1;function p(){!u||!d||(u=!1,d.length?l=d.concat(l):f=-1,l.length&&m())}function m(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(d=l,l=[];++f<t;)d&&d[f].run();f=-1,t=l.length}d=null,u=!1,c(e)}}n.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),l.length===1&&!u&&s(m)};function h(e,t){this.fun=e,this.array=t}h.prototype.run=function(){this.fun.apply(null,this.array)},n.title=`browser`,n.browser=!0,n.env={},n.argv=[],n.version=``,n.versions={};function g(){}n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(e){return[]},n.binding=function(e){throw Error(`process.binding is not supported`)},n.cwd=function(){return`/`},n.chdir=function(e){throw Error(`process.chdir is not supported`)},n.umask=function(){return 0}})),wh=xh(),Th=e(Sh(),1),Eh=e(Ch(),1);function Dh(e){return e.replace(/^file:\/\//,``)}var Oh=p({"../../node_modules/inline-style-parser/cjs/index.js"(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,u=`
|
|
11
11
|
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g}}),kh=p({"../../node_modules/style-to-object/cjs/index.js"(e){var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Oh());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}}}),Ah=p({"../../node_modules/style-to-js/cjs/utilities.js"(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))}}}),jh=p({"../../node_modules/style-to-js/cjs/index.js"(e,t){var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(kh()),r=Ah();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}}),Mh=p({"../../node_modules/extend/index.js"(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}}}),Nh=p({"../../node_modules/rxjs/dist/cjs/internal/operators/partition.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.partition=void 0;var t=qf(),n=Jf();function r(e,r){return function(i){return[n.filter(e,r)(i),n.filter(t.not(e,r))(i)]}}e.partition=r}}),Ph=p({"../../node_modules/rxjs/dist/cjs/internal/operators/race.js"(e){var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,`__esModule`,{value:!0}),e.race=void 0;var r=Wf(),i=mm();function a(){var e=[...arguments];return i.raceWith.apply(void 0,n([],t(r.argsOrArgArray(e))))}e.race=a}}),Fh=p({"../../node_modules/rxjs/dist/cjs/operators/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeAll=e.merge=e.max=e.materialize=e.mapTo=e.map=e.last=e.isEmpty=e.ignoreElements=e.groupBy=e.first=e.findIndex=e.find=e.finalize=e.filter=e.expand=e.exhaustMap=e.exhaustAll=e.exhaust=e.every=e.endWith=e.elementAt=e.distinctUntilKeyChanged=e.distinctUntilChanged=e.distinct=e.dematerialize=e.delayWhen=e.delay=e.defaultIfEmpty=e.debounceTime=e.debounce=e.count=e.connect=e.concatWith=e.concatMapTo=e.concatMap=e.concatAll=e.concat=e.combineLatestWith=e.combineLatest=e.combineLatestAll=e.combineAll=e.catchError=e.bufferWhen=e.bufferToggle=e.bufferTime=e.bufferCount=e.buffer=e.auditTime=e.audit=void 0,e.timeInterval=e.throwIfEmpty=e.throttleTime=e.throttle=e.tap=e.takeWhile=e.takeUntil=e.takeLast=e.take=e.switchScan=e.switchMapTo=e.switchMap=e.switchAll=e.subscribeOn=e.startWith=e.skipWhile=e.skipUntil=e.skipLast=e.skip=e.single=e.shareReplay=e.share=e.sequenceEqual=e.scan=e.sampleTime=e.sample=e.refCount=e.retryWhen=e.retry=e.repeatWhen=e.repeat=e.reduce=e.raceWith=e.race=e.publishReplay=e.publishLast=e.publishBehavior=e.publish=e.pluck=e.partition=e.pairwise=e.onErrorResumeNext=e.observeOn=e.multicast=e.min=e.mergeWith=e.mergeScan=e.mergeMapTo=e.mergeMap=e.flatMap=void 0,e.zipWith=e.zipAll=e.zip=e.withLatestFrom=e.windowWhen=e.windowToggle=e.windowTime=e.windowCount=e.window=e.toArray=e.timestamp=e.timeoutWith=e.timeout=void 0;var t=tp();Object.defineProperty(e,`audit`,{enumerable:!0,get:function(){return t.audit}});var n=np();Object.defineProperty(e,`auditTime`,{enumerable:!0,get:function(){return n.auditTime}});var r=rp();Object.defineProperty(e,`buffer`,{enumerable:!0,get:function(){return r.buffer}});var i=ip();Object.defineProperty(e,`bufferCount`,{enumerable:!0,get:function(){return i.bufferCount}});var a=ap();Object.defineProperty(e,`bufferTime`,{enumerable:!0,get:function(){return a.bufferTime}});var o=op();Object.defineProperty(e,`bufferToggle`,{enumerable:!0,get:function(){return o.bufferToggle}});var s=sp();Object.defineProperty(e,`bufferWhen`,{enumerable:!0,get:function(){return s.bufferWhen}});var c=cp();Object.defineProperty(e,`catchError`,{enumerable:!0,get:function(){return c.catchError}});var l=mp();Object.defineProperty(e,`combineAll`,{enumerable:!0,get:function(){return l.combineAll}});var u=pp();Object.defineProperty(e,`combineLatestAll`,{enumerable:!0,get:function(){return u.combineLatestAll}});var d=hp();Object.defineProperty(e,`combineLatest`,{enumerable:!0,get:function(){return d.combineLatest}});var f=gp();Object.defineProperty(e,`combineLatestWith`,{enumerable:!0,get:function(){return f.combineLatestWith}});var p=yp();Object.defineProperty(e,`concat`,{enumerable:!0,get:function(){return p.concat}});var m=jf();Object.defineProperty(e,`concatAll`,{enumerable:!0,get:function(){return m.concatAll}});var h=_p();Object.defineProperty(e,`concatMap`,{enumerable:!0,get:function(){return h.concatMap}});var g=vp();Object.defineProperty(e,`concatMapTo`,{enumerable:!0,get:function(){return g.concatMapTo}});var _=bp();Object.defineProperty(e,`concatWith`,{enumerable:!0,get:function(){return _.concatWith}});var v=Sp();Object.defineProperty(e,`connect`,{enumerable:!0,get:function(){return v.connect}});var y=Cp();Object.defineProperty(e,`count`,{enumerable:!0,get:function(){return y.count}});var b=wp();Object.defineProperty(e,`debounce`,{enumerable:!0,get:function(){return b.debounce}});var x=Tp();Object.defineProperty(e,`debounceTime`,{enumerable:!0,get:function(){return x.debounceTime}});var S=Ep();Object.defineProperty(e,`defaultIfEmpty`,{enumerable:!0,get:function(){return S.defaultIfEmpty}});var C=jp();Object.defineProperty(e,`delay`,{enumerable:!0,get:function(){return C.delay}});var w=Ap();Object.defineProperty(e,`delayWhen`,{enumerable:!0,get:function(){return w.delayWhen}});var T=Mp();Object.defineProperty(e,`dematerialize`,{enumerable:!0,get:function(){return T.dematerialize}});var E=Np();Object.defineProperty(e,`distinct`,{enumerable:!0,get:function(){return E.distinct}});var D=Pp();Object.defineProperty(e,`distinctUntilChanged`,{enumerable:!0,get:function(){return D.distinctUntilChanged}});var O=Fp();Object.defineProperty(e,`distinctUntilKeyChanged`,{enumerable:!0,get:function(){return O.distinctUntilKeyChanged}});var k=Lp();Object.defineProperty(e,`elementAt`,{enumerable:!0,get:function(){return k.elementAt}});var A=Rp();Object.defineProperty(e,`endWith`,{enumerable:!0,get:function(){return A.endWith}});var ee=zp();Object.defineProperty(e,`every`,{enumerable:!0,get:function(){return ee.every}});var te=Hp();Object.defineProperty(e,`exhaust`,{enumerable:!0,get:function(){return te.exhaust}});var j=Vp();Object.defineProperty(e,`exhaustAll`,{enumerable:!0,get:function(){return j.exhaustAll}});var ne=Bp();Object.defineProperty(e,`exhaustMap`,{enumerable:!0,get:function(){return ne.exhaustMap}});var re=Up();Object.defineProperty(e,`expand`,{enumerable:!0,get:function(){return re.expand}});var ie=Jf();Object.defineProperty(e,`filter`,{enumerable:!0,get:function(){return ie.filter}});var ae=Wp();Object.defineProperty(e,`finalize`,{enumerable:!0,get:function(){return ae.finalize}});var M=Gp();Object.defineProperty(e,`find`,{enumerable:!0,get:function(){return M.find}});var oe=Kp();Object.defineProperty(e,`findIndex`,{enumerable:!0,get:function(){return oe.findIndex}});var se=qp();Object.defineProperty(e,`first`,{enumerable:!0,get:function(){return se.first}});var ce=Jp();Object.defineProperty(e,`groupBy`,{enumerable:!0,get:function(){return ce.groupBy}});var le=Op();Object.defineProperty(e,`ignoreElements`,{enumerable:!0,get:function(){return le.ignoreElements}});var ue=Yp();Object.defineProperty(e,`isEmpty`,{enumerable:!0,get:function(){return ue.isEmpty}});var N=Zp();Object.defineProperty(e,`last`,{enumerable:!0,get:function(){return N.last}});var de=bf();Object.defineProperty(e,`map`,{enumerable:!0,get:function(){return de.map}});var fe=kp();Object.defineProperty(e,`mapTo`,{enumerable:!0,get:function(){return fe.mapTo}});var pe=Qp();Object.defineProperty(e,`materialize`,{enumerable:!0,get:function(){return pe.materialize}});var me=$p();Object.defineProperty(e,`max`,{enumerable:!0,get:function(){return me.max}});var he=rm();Object.defineProperty(e,`merge`,{enumerable:!0,get:function(){return he.merge}});var ge=Af();Object.defineProperty(e,`mergeAll`,{enumerable:!0,get:function(){return ge.mergeAll}});var _e=em();Object.defineProperty(e,`flatMap`,{enumerable:!0,get:function(){return _e.flatMap}});var ve=kf();Object.defineProperty(e,`mergeMap`,{enumerable:!0,get:function(){return ve.mergeMap}});var ye=tm();Object.defineProperty(e,`mergeMapTo`,{enumerable:!0,get:function(){return ye.mergeMapTo}});var be=nm();Object.defineProperty(e,`mergeScan`,{enumerable:!0,get:function(){return be.mergeScan}});var xe=im();Object.defineProperty(e,`mergeWith`,{enumerable:!0,get:function(){return xe.mergeWith}});var Se=am();Object.defineProperty(e,`min`,{enumerable:!0,get:function(){return Se.min}});var Ce=om();Object.defineProperty(e,`multicast`,{enumerable:!0,get:function(){return Ce.multicast}});var we=Zd();Object.defineProperty(e,`observeOn`,{enumerable:!0,get:function(){return we.observeOn}});var Te=sm();Object.defineProperty(e,`onErrorResumeNext`,{enumerable:!0,get:function(){return Te.onErrorResumeNext}});var Ee=cm();Object.defineProperty(e,`pairwise`,{enumerable:!0,get:function(){return Ee.pairwise}});var De=Nh();Object.defineProperty(e,`partition`,{enumerable:!0,get:function(){return De.partition}});var Oe=lm();Object.defineProperty(e,`pluck`,{enumerable:!0,get:function(){return Oe.pluck}});var ke=um();Object.defineProperty(e,`publish`,{enumerable:!0,get:function(){return ke.publish}});var Ae=dm();Object.defineProperty(e,`publishBehavior`,{enumerable:!0,get:function(){return Ae.publishBehavior}});var je=fm();Object.defineProperty(e,`publishLast`,{enumerable:!0,get:function(){return je.publishLast}});var Me=pm();Object.defineProperty(e,`publishReplay`,{enumerable:!0,get:function(){return Me.publishReplay}});var Ne=Ph();Object.defineProperty(e,`race`,{enumerable:!0,get:function(){return Ne.race}});var Pe=mm();Object.defineProperty(e,`raceWith`,{enumerable:!0,get:function(){return Pe.raceWith}});var Fe=up();Object.defineProperty(e,`reduce`,{enumerable:!0,get:function(){return Fe.reduce}});var Ie=hm();Object.defineProperty(e,`repeat`,{enumerable:!0,get:function(){return Ie.repeat}});var Le=gm();Object.defineProperty(e,`repeatWhen`,{enumerable:!0,get:function(){return Le.repeatWhen}});var Re=_m();Object.defineProperty(e,`retry`,{enumerable:!0,get:function(){return Re.retry}});var ze=vm();Object.defineProperty(e,`retryWhen`,{enumerable:!0,get:function(){return ze.retryWhen}});var Be=ud();Object.defineProperty(e,`refCount`,{enumerable:!0,get:function(){return Be.refCount}});var Ve=ym();Object.defineProperty(e,`sample`,{enumerable:!0,get:function(){return Ve.sample}});var He=bm();Object.defineProperty(e,`sampleTime`,{enumerable:!0,get:function(){return He.sampleTime}});var Ue=xm();Object.defineProperty(e,`scan`,{enumerable:!0,get:function(){return Ue.scan}});var We=Sm();Object.defineProperty(e,`sequenceEqual`,{enumerable:!0,get:function(){return We.sequenceEqual}});var Ge=Cm();Object.defineProperty(e,`share`,{enumerable:!0,get:function(){return Ge.share}});var Ke=wm();Object.defineProperty(e,`shareReplay`,{enumerable:!0,get:function(){return Ke.shareReplay}});var qe=Tm();Object.defineProperty(e,`single`,{enumerable:!0,get:function(){return qe.single}});var Je=Em();Object.defineProperty(e,`skip`,{enumerable:!0,get:function(){return Je.skip}});var Ye=Dm();Object.defineProperty(e,`skipLast`,{enumerable:!0,get:function(){return Ye.skipLast}});var Xe=Om();Object.defineProperty(e,`skipUntil`,{enumerable:!0,get:function(){return Xe.skipUntil}});var Ze=km();Object.defineProperty(e,`skipWhile`,{enumerable:!0,get:function(){return Ze.skipWhile}});var Qe=Am();Object.defineProperty(e,`startWith`,{enumerable:!0,get:function(){return Qe.startWith}});var $e=Qd();Object.defineProperty(e,`subscribeOn`,{enumerable:!0,get:function(){return $e.subscribeOn}});var et=Mm();Object.defineProperty(e,`switchAll`,{enumerable:!0,get:function(){return et.switchAll}});var tt=jm();Object.defineProperty(e,`switchMap`,{enumerable:!0,get:function(){return tt.switchMap}});var nt=Nm();Object.defineProperty(e,`switchMapTo`,{enumerable:!0,get:function(){return nt.switchMapTo}});var rt=Pm();Object.defineProperty(e,`switchScan`,{enumerable:!0,get:function(){return rt.switchScan}});var it=Dp();Object.defineProperty(e,`take`,{enumerable:!0,get:function(){return it.take}});var at=Xp();Object.defineProperty(e,`takeLast`,{enumerable:!0,get:function(){return at.takeLast}});var ot=Fm();Object.defineProperty(e,`takeUntil`,{enumerable:!0,get:function(){return ot.takeUntil}});var st=Im();Object.defineProperty(e,`takeWhile`,{enumerable:!0,get:function(){return st.takeWhile}});var ct=Lm();Object.defineProperty(e,`tap`,{enumerable:!0,get:function(){return ct.tap}});var lt=Rm();Object.defineProperty(e,`throttle`,{enumerable:!0,get:function(){return lt.throttle}});var ut=zm();Object.defineProperty(e,`throttleTime`,{enumerable:!0,get:function(){return ut.throttleTime}});var dt=Ip();Object.defineProperty(e,`throwIfEmpty`,{enumerable:!0,get:function(){return dt.throwIfEmpty}});var ft=Bm();Object.defineProperty(e,`timeInterval`,{enumerable:!0,get:function(){return ft.timeInterval}});var pt=yf();Object.defineProperty(e,`timeout`,{enumerable:!0,get:function(){return pt.timeout}});var mt=Vm();Object.defineProperty(e,`timeoutWith`,{enumerable:!0,get:function(){return mt.timeoutWith}});var ht=Hm();Object.defineProperty(e,`timestamp`,{enumerable:!0,get:function(){return ht.timestamp}});var gt=dp();Object.defineProperty(e,`toArray`,{enumerable:!0,get:function(){return gt.toArray}});var _t=Um();Object.defineProperty(e,`window`,{enumerable:!0,get:function(){return _t.window}});var vt=Wm();Object.defineProperty(e,`windowCount`,{enumerable:!0,get:function(){return vt.windowCount}});var yt=Gm();Object.defineProperty(e,`windowTime`,{enumerable:!0,get:function(){return yt.windowTime}});var bt=Km();Object.defineProperty(e,`windowToggle`,{enumerable:!0,get:function(){return bt.windowToggle}});var xt=qm();Object.defineProperty(e,`windowWhen`,{enumerable:!0,get:function(){return xt.windowWhen}});var St=Jm();Object.defineProperty(e,`withLatestFrom`,{enumerable:!0,get:function(){return St.withLatestFrom}});var Ct=Xm();Object.defineProperty(e,`zip`,{enumerable:!0,get:function(){return Ct.zip}});var wt=Ym();Object.defineProperty(e,`zipAll`,{enumerable:!0,get:function(){return wt.zipAll}});var Tt=Zm();Object.defineProperty(e,`zipWith`,{enumerable:!0,get:function(){return Tt.zipWith}})}}),Ih={highlight:{motivation:`highlighting`,internalType:`highlight`,displayName:`Highlight`,description:`Mark text for attention`,className:`annotation-highlight`,iconEmoji:`🟡`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>no(e),announceOnCreate:`Highlight created`,create:{bodyBuilder:`empty`,refetchAfter:!1},detection:{sseMethod:`detectHighlights`,countField:`createdCount`,displayNamePlural:`highlights`,displayNameSingular:`highlight`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},comment:{motivation:`commenting`,internalType:`comment`,displayName:`Comment`,description:`Add a comment about the text`,className:`annotation-comment`,iconEmoji:`💬`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>ao(e),announceOnCreate:`Comment created`,create:{bodyBuilder:`text`,refetchAfter:!1},detection:{sseMethod:`detectComments`,countField:`createdCount`,displayNamePlural:`comments`,displayNameSingular:`comment`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[1]==`string`&&e[1]&&t.push({label:`Tone`,value:e[1]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},assessment:{motivation:`assessing`,internalType:`assessment`,displayName:`Assessment`,description:`Provide evaluation or assessment`,className:`annotation-assessment`,iconEmoji:`🔴`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>e.motivation===`assessing`,announceOnCreate:`Assessment created`,create:{bodyBuilder:`text`,refetchAfter:!1},detection:{sseMethod:`detectAssessments`,countField:`createdCount`,displayNamePlural:`assessments`,displayNameSingular:`assessment`,formatRequestParams:e=>{let t=[];return typeof e[0]==`string`&&e[0]&&t.push({label:`Instructions`,value:e[0]}),typeof e[1]==`string`&&e[1]&&t.push({label:`Tone`,value:e[1]}),typeof e[2]==`number`&&t.push({label:`Density`,value:`${e[2]} per 2000 words`}),t}}},reference:{motivation:`linking`,internalType:`reference`,displayName:`Reference`,description:`Link to another resource`,className:`annotation-reference`,iconEmoji:`🔵`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>ro(e),announceOnCreate:`Reference created`,create:{bodyBuilder:`entityTag`,refetchAfter:!0},detection:{sseMethod:`detectReferences`,countField:`foundCount`,displayNamePlural:`entity references`,displayNameSingular:`entity reference`,formatRequestParams:e=>{let t=[],n=e[0];return Array.isArray(n)&&n.length>0&&t.push({label:`Entity Types`,value:n.join(`, `)}),e[1]===!0&&t.push({label:`Include Descriptive References`,value:`Yes`}),t}}},tag:{motivation:`tagging`,internalType:`tag`,displayName:`Tag`,description:`Structural role annotation`,className:`annotation-tag`,iconEmoji:`🏷️`,isClickable:!0,hasHoverInteraction:!0,hasSidePanel:!0,matchesAnnotation:e=>oo(e),announceOnCreate:`Tag created`,create:{bodyBuilder:`dualTag`,refetchAfter:!1,successMessage:`Tag "{value}" created`},detection:{sseMethod:`detectTags`,countField:`tagsCreated`,displayNamePlural:`tags`,displayNameSingular:`tag`,formatRequestParams:e=>{let t=[];typeof e[0]==`string`&&e[0]&&t.push({label:`Schema`,value:{"legal-irac":`Legal (IRAC)`,"scientific-imrad":`Scientific (IMRAD)`,"argument-toulmin":`Argument (Toulmin)`}[e[0]]||e[0]});let n=e[1];return Array.isArray(n)&&n.length>0&&t.push({label:`Categories`,value:n.join(`, `)}),t}}}},Lh={primary:{base:`semiont-button semiont-button--primary`,large:`semiont-button semiont-button--primary semiont-button--large`},secondary:{base:`semiont-button semiont-button--secondary`,withScale:`semiont-button semiont-button--secondary semiont-button--scale`},tertiary:{base:`semiont-button semiont-button--tertiary`},danger:{base:`semiont-button semiont-button--danger`},warning:{base:`semiont-button semiont-button--warning`},combine:(...e)=>e.filter(Boolean).join(` `)},Rh=[],zh=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?zh:Rh).push(n+=e[t])})();function Bh(e){if(e<768)return!1;for(let t=0,n=Rh.length;;){let r=t+n>>1;if(e<Rh[r])n=r;else if(e>=zh[r])t=r+1;else return!0;if(t==n)return!1}}function Vh(e){return e>=127462&&e<=127487}var Hh=8205;function Uh(e,t,n=!0,r=!0){return(n?Wh:Gh)(e,t,r)}function Wh(e,t,n){if(t==e.length)return t;t&&qh(e.charCodeAt(t))&&Jh(e.charCodeAt(t-1))&&t--;let r=Kh(e,t);for(t+=Yh(r);t<e.length;){let i=Kh(e,t);if(r==Hh||i==Hh||n&&Bh(i))t+=Yh(i),r=i;else if(Vh(i)){let n=0,r=t-2;for(;r>=0&&Vh(Kh(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function Gh(e,t,n){for(;t>0;){let r=Wh(e,t-2,n);if(r<t)return r;t--}return 0}function Kh(e,t){let n=e.charCodeAt(t);if(!Jh(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return qh(r)?(n-55296<<10)+(r-56320)+65536:n}function qh(e){return e>=56320&&e<57344}function Jh(e){return e>=55296&&e<56320}function Yh(e){return e<65536?1:2}var Xh=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=og(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Qh.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=og(this,e,t);let n=[];return this.decompose(e,t,n,0),Qh.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new ng(this),i=new ng(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new ng(this,e)}iterRange(e,t=this.length){return new rg(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ig(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new Zh(t):Qh.from(Zh.split(t,[]))}},Zh=class e extends Xh{constructor(e,t=$h(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new ag(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(tg(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=eg(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=og(this,t,n);let i=eg(this.text,eg(r.text,tg(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):Qh.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
@@ -104,7 +104,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
104
104
|
`),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(`
|
|
105
105
|
`)].join(`
|
|
106
106
|
`))}else{let e=u.props?.className,t=typeof e==`function`?(...t)=>BP(e(...t),c.className):BP(e,c.className),n=t?{className:t}:{},r=YP(u.props,ZP(QP(c,[`ref`])));for(let e in d)e in r&&delete d[e];return(0,m.cloneElement)(u,Object.assign({},r,d,l,{ref:i($P(u),l.ref)},n))}return(0,m.createElement)(a,Object.assign({},QP(c,[`ref`]),!eF(a)&&l,!eF(a)&&d),u)}function qP(){let e=(0,m.useRef)([]),t=(0,m.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function JP(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function YP(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function XP(e){return Object.assign((0,m.forwardRef)(e),{displayName:e.displayName??e.name})}function ZP(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function QP(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function $P(e){return`19.2.4`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function eF(e){return e===m.Fragment||e===Symbol.for(`react.fragment`)}function tF(e){return eF(e.type)}var nF=`span`,rF=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(rF||{});function iF(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return WP()({ourProps:i,theirProps:r,slot:{},defaultTag:nF,name:`Hidden`})}var aF=XP(iF);function oF(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function sF(e){return oF(e)&&`tagName`in e}function cF(e){return sF(e)&&`accessKey`in e}function lF(e){return sF(e)&&`tabIndex`in e}function uF(e){return sF(e)&&`style`in e}function dF(e){return cF(e)&&e.nodeName===`IFRAME`}function fF(e){return cF(e)&&e.nodeName===`INPUT`}var pF=Symbol();function mF(e,t=!0){return Object.assign(e,{[pF]:t})}function hF(...e){let t=(0,m.useRef)(e);(0,m.useEffect)(()=>{t.current=e},[e]);let n=IP(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[pF])?void 0:n}var gF=(0,m.createContext)(null);gF.displayName=`DescriptionContext`;function _F(){let e=(0,m.useContext)(gF);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,_F),e}return e}function vF(){let[e,t]=(0,m.useState)([]);return[e.length>0?e.join(` `):void 0,(0,m.useMemo)(()=>function(e){let n=IP(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,m.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return m.createElement(gF.Provider,{value:r},e.children)},[t])]}var yF=`p`;function bF(e,t){let n=(0,m.useId)(),r=zP(),{id:i=`headlessui-description-${n}`,...a}=e,o=_F(),s=hF(t);PP(()=>o.register(i),[i,o.register]);let c=LP({...o.slot,disabled:r||!1}),l={ref:s,...o.props,id:i};return WP()({ourProps:l,theirProps:a,slot:c,defaultTag:yF,name:o.name||`Description`})}var xF=XP(bF),SF=Object.assign(xF,{}),CF=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(CF||{}),wF=(0,m.createContext)(()=>{});function TF({value:e,children:t}){return m.createElement(wF.Provider,{value:e},t)}var EF=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},DF=Object.defineProperty,OF=(e,t,n)=>t in e?DF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kF=(e,t,n)=>(OF(e,typeof t==`symbol`?t:t+``,n),n),AF=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},jF=(e,t,n)=>(AF(e,t,`read from private field`),n?n.call(e):t.get(e)),MF=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},NF=(e,t,n,r)=>(AF(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),PF,FF,IF,LF=class{constructor(e){MF(this,PF,{}),MF(this,FF,new EF(()=>new Set)),MF(this,IF,new Set),kF(this,`disposables`,MP()),NF(this,PF,e),EP.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return jF(this,PF)}subscribe(e,t){if(EP.isServer)return()=>{};let n={selector:e,callback:t,current:e(jF(this,PF))};return jF(this,IF).add(n),this.disposables.add(()=>{jF(this,IF).delete(n)})}on(e,t){return EP.isServer?()=>{}:(jF(this,FF).get(e).add(t),this.disposables.add(()=>{jF(this,FF).get(e).delete(t)}))}send(e){let t=this.reduce(jF(this,PF),e);if(t!==jF(this,PF)){NF(this,PF,t);for(let e of jF(this,IF)){let t=e.selector(jF(this,PF));RF(e.current,t)||(e.current=t,e.callback(t))}for(let t of jF(this,FF).get(e.type))t(jF(this,PF),e)}}};PF=new WeakMap,FF=new WeakMap,IF=new WeakMap;function RF(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?zF(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?zF(e.entries(),t.entries()):!1:BF(e)&&BF(t)?zF(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function zF(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function BF(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var VF=Object.defineProperty,HF=(e,t,n)=>t in e?VF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UF=(e,t,n)=>(HF(e,typeof t==`symbol`?t:t+``,n),n),WF=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(WF||{}),GF={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},KF=class e extends LF{constructor(){super(...arguments),UF(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),UF(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return VP(t.type,GF,e,t)}},qF=new EF(()=>KF.new());function JF(e,t,n=RF){return(0,wh.useSyncExternalStoreWithSelector)(IP(t=>e.subscribe(YF,t)),IP(()=>e.state),IP(()=>e.state),IP(t),n)}function YF(e){return e}function XF(e,t){let n=(0,m.useId)(),r=qF.get(t),[i,a]=JF(r,(0,m.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return PP(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var ZF=new Map,QF=new Map;function $F(e){let t=QF.get(e)??0;return QF.set(e,t+1),t===0?(ZF.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>eI(e)):()=>eI(e)}function eI(e){let t=QF.get(e)??1;if(t===1?QF.delete(e):QF.set(e,t-1),t!==1)return;let n=ZF.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,ZF.delete(e))}function tI(e,{allowed:t,disallowed:n}={}){let r=XF(e,`inert-others`);PP(()=>{if(!r)return;let e=MP();for(let t of n?.()??[])t&&e.add($F(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=DP(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add($F(t));r=r.parentElement}}return e.dispose},[r,t,n])}function nI(e,t,n){let r=FP(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,m.useEffect)(()=>{if(!e)return;let n=t===null?null:cF(t)?t:t.current;if(!n)return;let i=MP();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var rI=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),iI=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),aI=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(aI||{}),oI=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(oI||{}),sI=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(sI||{});function cI(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(rI)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function lI(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(iI)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var uI=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(uI||{});function dI(e,t=0){return e===DP(e)?.body?!1:VP(t,{0(){return e.matches(rI)},1(){let t=e;for(;t!==null;){if(t.matches(rI))return!0;t=t.parentElement}return!1}})}var fI=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(fI||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function pI(e){e?.focus({preventScroll:!0})}var mI=[`textarea`,`input`].join(`,`);function hI(e){return(e?.matches)?.call(e,mI)??!1}function gI(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function _I(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?OP(e[0]):document:OP(e),o=Array.isArray(e)?n?gI(e):e:t&64?lI(e):cI(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==kP(f));return t&6&&hI(f)&&f.select(),2}function vI(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function yI(){return/Android/gi.test(window.navigator.userAgent)}function bI(){return vI()||yI()}function xI(e,t,n,r){let i=FP(n);(0,m.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function SI(e,t,n,r){let i=FP(n);(0,m.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var CI=30;function wI(e,t,n){let r=FP(n),i=(0,m.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=(function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]})(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!dI(i,uI.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,m.useRef)(null);xI(e,`pointerdown`,e=>{bI()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),xI(e,`pointerup`,e=>{if(bI()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,m.useRef)({x:0,y:0});xI(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),xI(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=CI||Math.abs(t.y-o.current.y)>=CI))return i(e,()=>lF(e.target)?e.target:null)},!0),SI(e,`blur`,e=>i(e,()=>dF(window.document.activeElement)?window.document.activeElement:null),!0)}function TI(...e){return(0,m.useMemo)(()=>DP(...e),[...e])}function EI(e,t,n,r){let i=FP(n);(0,m.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function DI(e){return(0,m.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function OI(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function kI(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function AI(){return vI()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=MP();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(lF(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);lF(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),lF(e.target)&&uF(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(lF(e.target)){if(fF(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{n!==(window.scrollY??window.pageYOffset)&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function jI(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function MI(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var NI=OI(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:MP(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=MI(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=MI(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[AI(),kI(),jI()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});NI.subscribe(()=>{let e=NI.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&NI.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&NI.dispatch(`TEARDOWN`,n)}});function PI(e,t,n=()=>({containers:[]})){let r=DI(NI),i=t?r.get(t):void 0,a=i?i.count>0:!1;return PP(()=>{if(!(!t||!e))return NI.dispatch(`PUSH`,t,n),()=>NI.dispatch(`POP`,t,n)},[e,t]),a}function FI(e,t,n=()=>[document.body]){PI(XF(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function II(e=0){let[t,n]=(0,m.useState)(e);return{flags:t,setFlag:(0,m.useCallback)(e=>n(e),[]),addFlag:(0,m.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,m.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,m.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,m.useCallback)(e=>n(t=>t^e),[])}}typeof process<`u`&&typeof globalThis<`u`&&typeof Element<`u`&&(process==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(`
|
|
107
|
-
`)),[]});var LI=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(LI||{});function RI(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function zI(e,t,n,r){let[i,a]=(0,m.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=II(e&&i?3:0),l=(0,m.useRef)(!1),u=(0,m.useRef)(!1);return PP(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),BI(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(s(3),c(4)):(s(4),c(2)))},run(){u.current?n?(c(3),s(4)):(c(4),s(3)):n?c(1):s(1)},done(){var e;u.current&&UI(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,NP()]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function BI(e,{prepare:t,run:n,done:r,inFlight:i}){let a=MP();return HI(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(VI(e,r))})}),a.dispose}function VI(e,t){let n=MP();if(!e)return n.dispose;let r=!1;n.add(()=>{r=!0});let i=e.getAnimations?.call(e).filter(e=>e instanceof CSSTransition)??[];return i.length===0?(t(),n.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{r||t()}),n.dispose)}function HI(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition=`none`,n(),e.offsetHeight,e.style.transition=r}function UI(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function WI(e,t){let n=(0,m.useRef)([]),r=IP(e);(0,m.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}var GI=(0,m.createContext)(null);GI.displayName=`OpenClosedContext`;var KI=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(KI||{});function qI(){return(0,m.useContext)(GI)}function JI({value:e,children:t}){return m.createElement(GI.Provider,{value:e},t)}function YI({children:e}){return m.createElement(GI.Provider,{value:null},e)}function XI(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var ZI=[];XI(()=>{function e(e){if(!lF(e.target)||e.target===document.body||ZI[0]===e.target)return;let t=e.target;t=t.closest(rI),ZI.unshift(t??e.target),ZI=ZI.filter(e=>e!=null&&e.isConnected),ZI.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function QI(e){let t=IP(e),n=(0,m.useRef)(!1);(0,m.useEffect)(()=>(n.current=!1,()=>{n.current=!0,jP(()=>{n.current&&t()})}),[t])}var $I=(0,m.createContext)(!1);function eL(){return(0,m.useContext)($I)}function tL(e){return m.createElement($I.Provider,{value:e.force},e.children)}function nL(e){let t=eL(),n=(0,m.useContext)(sL),[r,i]=(0,m.useState)(()=>{if(!t&&n!==null)return n.current??null;if(EP.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,m.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,m.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var rL=m.Fragment,iL=XP(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,m.useRef)(null),a=hF(mF(e=>{i.current=e}),t),o=TI(i.current),s=nL(n??o),c=(0,m.useContext)(lL),l=NP(),u=WP();return QI(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),s?(0,h.createPortal)(m.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},u({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:rL,name:`Portal`})),s):null});function aL(e,t){let n=hF(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=WP();return r?m.createElement(iL,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:rL,name:`Portal`})}var oL=m.Fragment,sL=(0,m.createContext)(null);function cL(e,t){let{target:n,...r}=e,i={ref:hF(t)},a=WP();return m.createElement(sL.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:oL,name:`Popover.Group`}))}var lL=(0,m.createContext)(null);function uL(){let e=(0,m.useContext)(lL),t=(0,m.useRef)([]),n=IP(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=IP(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,m.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,m.useMemo)(()=>function({children:e}){return m.createElement(lL.Provider,{value:i},e)},[i])]}var dL=XP(aL),fL=XP(cL),pL=Object.assign(dL,{Group:fL});function mL(e,t=typeof document<`u`?document.defaultView:null,n){let r=XF(e,`escape`);EI(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===CF.Escape&&n(e))})}function hL(){let[e]=(0,m.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,m.useState)(e?.matches??!1);return PP(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function gL({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=IP(()=>{let r=DP(n),i=[];for(let t of e)t!==null&&(sF(t)?i.push(t):`current`in t&&sF(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&sF(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:IP(e=>r().some(t=>t.contains(e)))}}var _L=(0,m.createContext)(null);function vL({children:e,node:t}){let[n,r]=(0,m.useState)(null),i=yL(t??n);return m.createElement(_L.Provider,{value:i},e,i===null&&m.createElement(aF,{features:rF.Hidden,ref:e=>{if(e){for(let t of DP(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&sF(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function yL(e=null){return(0,m.useContext)(_L)??e}function bL(){let e=typeof document>`u`;return`useSyncExternalStore`in m?(e=>e.useSyncExternalStore)(m)(()=>()=>{},()=>!1,()=>!e):!1}function xL(){let e=bL(),[t,n]=m.useState(EP.isHandoffComplete);return t&&EP.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>EP.handoff(),[]),e?!1:t}function SL(){let e=(0,m.useRef)(!1);return PP(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var CL=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(CL||{});function wL(){let e=(0,m.useRef)(0);return SI(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function TL(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)sF(n.current)&&t.add(n.current);return t}var EL=`div`,DL=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))(DL||{});function OL(e,t){let n=(0,m.useRef)(null),r=hF(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;xL()||(s=0);let l=TI(n.current);ML(s,{ownerDocument:l});let u=NL(s,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});PL(s,{ownerDocument:l,container:n,containers:o,previousActiveElement:u});let d=wL(),f=IP(e=>{if(!cF(n.current))return;let t=n.current;(e=>e())(()=>{VP(d.current,{[CL.Forwards]:()=>{_I(t,aI.First,{skipElements:[e.relatedTarget,a]})},[CL.Backwards]:()=>{_I(t,aI.Last,{skipElements:[e.relatedTarget,a]})}})})}),p=XF(!!(s&2),`focus-trap#tab-lock`),h=NP(),g=(0,m.useRef)(!1),_={ref:r,onKeyDown(e){e.key==`Tab`&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(s&4))return;let t=TL(o);cF(n.current)&&t.add(n.current);let r=e.relatedTarget;lF(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(FL(t,r)||(g.current?_I(n.current,VP(d.current,{[CL.Forwards]:()=>aI.Next,[CL.Backwards]:()=>aI.Previous})|aI.WrapAround,{relativeTo:e.target}):lF(e.target)&&pI(e.target)))}},v=WP();return m.createElement(m.Fragment,null,p&&m.createElement(aF,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:rF.Focusable}),v({ourProps:_,theirProps:c,defaultTag:EL,name:`FocusTrap`}),p&&m.createElement(aF,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:rF.Focusable}))}var kL=XP(OL),AL=Object.assign(kL,{features:DL});function jL(e=!0){let t=(0,m.useRef)(ZI.slice());return WI(([e],[n])=>{n===!0&&e===!1&&jP(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=ZI.slice())},[e,ZI,t]),IP(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function ML(e,{ownerDocument:t}){let n=!!(e&8),r=jL(n);WI(()=>{n||AP(t?.body)&&pI(r())},[n]),QI(()=>{n&&pI(r())})}function NL(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,m.useRef)(null),o=XF(!!(e&1),`focus-trap#initial-focus`),s=SL();return WI(()=>{if(e===0)return;if(!o){i!=null&&i.current&&pI(i.current);return}let c=n.current;c&&jP(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)pI(r.current);else{if(e&16){if(_I(c,aI.First|aI.AutoFocus)!==oI.Error)return}else if(_I(c,aI.First)!==oI.Error)return;if(i!=null&&i.current&&(pI(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the <FocusTrap />`)}a.current=t?.activeElement})},[i,o,e]),a}function PL(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=SL(),o=!!(e&4);EI(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=TL(r);cF(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;cF(c)?FL(t,c)?(i.current=c,pI(c)):(e.preventDefault(),e.stopPropagation(),pI(s)):pI(i.current)},!0)}function FL(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function IL(e){return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!eF(e.as??WL)||m.Children.count(e.children)===1}var LL=(0,m.createContext)(null);LL.displayName=`TransitionContext`;var RL=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(RL||{});function zL(){let e=(0,m.useContext)(LL);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function BL(){let e=(0,m.useContext)(VL);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var VL=(0,m.createContext)(null);VL.displayName=`NestingContext`;function HL(e){return`children`in e?HL(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function UL(e,t){let n=FP(e),r=(0,m.useRef)([]),i=SL(),a=NP(),o=IP((e,t=UP.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(VP(t,{[UP.Unmount](){r.current.splice(o,1)},[UP.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!HL(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=IP(e=>{let t=r.current.find(({el:t})=>t===e);return t?t.state!==`visible`&&(t.state=`visible`):r.current.push({el:e,state:`visible`}),()=>o(e,UP.Unmount)}),c=(0,m.useRef)([]),l=(0,m.useRef)(Promise.resolve()),u=(0,m.useRef)({enter:[],leave:[]}),d=IP((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),t?.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),t?.chains.current[n].push([e,new Promise(e=>{Promise.all(u.current[n].map(([e,t])=>t)).then(()=>e())})]),n===`enter`?l.current=l.current.then(()=>t?.wait.current).then(()=>r(n)):r(n)}),f=IP((e,t,n)=>{Promise.all(u.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;(e=c.current.shift())==null||e()}).then(()=>n(t))});return(0,m.useMemo)(()=>({children:r,register:s,unregister:o,onStart:d,onStop:f,wait:l,chains:u}),[s,o,r,d,f,u,l])}var WL=m.Fragment,GL=HP.RenderStrategy;function KL(e,t){var n;let{transition:r=!0,beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:c,enterFrom:l,enterTo:u,entered:d,leave:f,leaveFrom:p,leaveTo:h,...g}=e,[_,v]=(0,m.useState)(null),y=(0,m.useRef)(null),b=IL(e),x=hF(...b?[y,t,v]:t===null?[]:[t]),S=(n=g.unmount)==null||n?UP.Unmount:UP.Hidden,{show:C,appear:w,initial:T}=zL(),[E,D]=(0,m.useState)(C?`visible`:`hidden`),O=BL(),{register:k,unregister:A}=O;PP(()=>k(y),[k,y]),PP(()=>{if(S===UP.Hidden&&y.current){if(C&&E!==`visible`){D(`visible`);return}return VP(E,{hidden:()=>A(y),visible:()=>k(y)})}},[E,y,k,A,C,S]);let ee=xL();PP(()=>{if(b&&ee&&E===`visible`&&y.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,E,ee,b]);let te=T&&!w,j=w&&C&&T,ne=(0,m.useRef)(!1),re=UL(()=>{ne.current||(D(`hidden`),A(y))},O),ie=IP(e=>{ne.current=!0;let t=e?`enter`:`leave`;re.onStart(y,t,e=>{e===`enter`?i?.():e===`leave`&&o?.()})}),ae=IP(e=>{let t=e?`enter`:`leave`;ne.current=!1,re.onStop(y,t,e=>{e===`enter`?a?.():e===`leave`&&s?.()}),t===`leave`&&!HL(re)&&(D(`hidden`),A(y))});(0,m.useEffect)(()=>{b&&r||(ie(C),ae(C))},[C,b,r]);let[,M]=zI(!(!r||!b||!ee||te),_,C,{start:ie,end:ae}),oe=ZP({ref:x,className:BP(g.className,j&&c,j&&l,M.enter&&c,M.enter&&M.closed&&l,M.enter&&!M.closed&&u,M.leave&&f,M.leave&&!M.closed&&p,M.leave&&M.closed&&h,!M.transition&&C&&d)?.trim()||void 0,...RI(M)}),se=0;E===`visible`&&(se|=KI.Open),E===`hidden`&&(se|=KI.Closed),C&&E===`hidden`&&(se|=KI.Opening),!C&&E===`visible`&&(se|=KI.Closing);let ce=WP();return m.createElement(VL.Provider,{value:re},m.createElement(JI,{value:se},ce({ourProps:oe,theirProps:g,defaultTag:WL,features:GL,visible:E===`visible`,name:`Transition.Child`})))}function qL(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=(0,m.useRef)(null),s=hF(...IL(e)?[o,t]:t===null?[]:[t]);xL();let c=qI();if(n===void 0&&c!==null&&(n=(c&KI.Open)===KI.Open),n===void 0)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=(0,m.useState)(n?`visible`:`hidden`),d=UL(()=>{n||u(`hidden`)}),[f,p]=(0,m.useState)(!0),h=(0,m.useRef)([n]);PP(()=>{f!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let g=(0,m.useMemo)(()=>({show:n,appear:r,initial:f}),[n,r,f]);PP(()=>{n?u(`visible`):!HL(d)&&o.current!==null&&u(`hidden`)},[n,d]);let _={unmount:i},v=IP(()=>{var t;f&&p(!1),(t=e.beforeEnter)==null||t.call(e)}),y=IP(()=>{var t;f&&p(!1),(t=e.beforeLeave)==null||t.call(e)}),b=WP();return m.createElement(VL.Provider,{value:d},m.createElement(LL.Provider,{value:g},b({ourProps:{..._,as:m.Fragment,children:m.createElement(XL,{ref:s,..._,...a,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:m.Fragment,features:GL,visible:l===`visible`,name:`Transition`})))}function JL(e,t){let n=(0,m.useContext)(LL)!==null,r=qI()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(YL,{ref:t,...e}):m.createElement(XL,{ref:t,...e}))}var YL=XP(qL),XL=XP(KL),ZL=XP(JL),QL=Object.assign(YL,{Child:ZL,Root:YL}),$L=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))($L||{}),eR=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(eR||{}),tR={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},nR=(0,m.createContext)(null);nR.displayName=`DialogContext`;function rR(e){let t=(0,m.useContext)(nR);if(t===null){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,rR),t}return t}function iR(e,t){return VP(t.type,tR,e,t)}var aR=XP(function(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:c=!0,__demoMode:l=!1,unmount:u=!1,...d}=e,f=(0,m.useRef)(!1);s=(function(){return s===`dialog`||s===`alertdialog`?s:(f.current||(f.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)})();let p=qI();i===void 0&&p!==null&&(i=(p&KI.Open)===KI.Open);let h=(0,m.useRef)(null),g=hF(h,t),_=TI(h.current),v=+!i,[y,b]=(0,m.useReducer)(iR,{titleId:null,descriptionId:null,panelRef:(0,m.createRef)()}),x=IP(()=>a(!1)),S=IP(e=>b({type:0,id:e})),C=xL()?v===0:!1,[w,T]=uL(),E={get current(){return y.panelRef.current??h.current}},D=yL(),{resolveContainers:O}=gL({mainTreeNode:D,portals:w,defaultContainers:[E]}),k=p===null?!1:(p&KI.Closing)===KI.Closing;tI(l||k?!1:C,{allowed:IP(()=>[h.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:IP(()=>[D?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let A=qF.get(null);PP(()=>{if(C)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,C]);let ee=JF(A,(0,m.useCallback)(e=>A.selectors.isTop(e,r),[A,r]));wI(ee,O,e=>{e.preventDefault(),x()}),mL(ee,_?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),x()}),FI(l||k?!1:C,_,O),nI(C,h,x);let[te,j]=vF(),ne=(0,m.useMemo)(()=>[{dialogState:v,close:x,setTitleId:S,unmount:u},y],[v,x,S,u,y]),re=LP({open:v===0}),ie={ref:g,id:r,role:s,tabIndex:-1,"aria-modal":l?void 0:v===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":te,unmount:u},ae=!hL(),M=DL.None;C&&!l&&(M|=DL.RestoreFocus,M|=DL.TabLock,c&&(M|=DL.AutoFocus),ae&&(M|=DL.InitialFocus));let oe=WP();return m.createElement(YI,null,m.createElement(tL,{force:!0},m.createElement(pL,null,m.createElement(nR.Provider,{value:ne},m.createElement(fL,{target:h},m.createElement(tL,{force:!1},m.createElement(j,{slot:re},m.createElement(T,null,m.createElement(AL,{initialFocus:o,initialFocusFallback:h,containers:O,features:M},m.createElement(TF,{value:x},oe({ourProps:ie,theirProps:d,slot:re,defaultTag:oR,features:sR,visible:v===0,name:`Dialog`})))))))))))}),oR=`div`,sR=HP.RenderStrategy|HP.Static;function cR(e,t){let{transition:n=!1,open:r,...i}=e,a=qI(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?m.createElement(vL,null,m.createElement(QL,{show:r,transition:n,unmount:i.unmount},m.createElement(aR,{ref:t,...i}))):m.createElement(vL,null,m.createElement(aR,{ref:t,open:r,...i}))}var lR=`div`;function uR(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=rR(`Dialog.Panel`),l=hF(t,c.panelRef),u=LP({open:o===0}),d={ref:l,id:r,onClick:IP(e=>{e.stopPropagation()})},f=i?ZL:m.Fragment,p=i?{unmount:s}:{},h=WP();return m.createElement(f,{...p},h({ourProps:d,theirProps:a,slot:u,defaultTag:lR,name:`Dialog.Panel`}))}var dR=`div`;function fR(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=rR(`Dialog.Backdrop`),o=LP({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?ZL:m.Fragment,l=n?{unmount:a}:{},u=WP();return m.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:dR,name:`Dialog.Backdrop`}))}var pR=`h2`;function mR(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=rR(`Dialog.Title`),s=hF(t);(0,m.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=LP({open:a===0}),l={ref:s,id:r};return WP()({ourProps:l,theirProps:i,slot:c,defaultTag:pR,name:`Dialog.Title`})}var hR=XP(cR),gR=XP(uR);XP(fR);var _R=XP(mR),vR=Object.assign(hR,{Panel:gR,Title:_R,Description:SF});function yR({children:e,position:t,onClose:n,isOpen:r,wide:i=!1}){let a=i?800:400,o=i?700:500,s={position:`fixed`,left:`${Math.min(t.x,typeof window<`u`?window.innerWidth-a:t.x)}px`,top:`${Math.min(t.y,typeof window<`u`?window.innerHeight-o:t.y)}px`};return(0,P.jsx)(QL,{appear:!0,show:r,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-popup-overlay`,onClose:n,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-popup-backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-popup-container`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsx)(gR,{className:`semiont-popup-panel`,style:s,"data-annotation-ui":!0,"data-wide":i?`true`:`false`,children:(0,P.jsx)(P.Fragment,{children:e})})})})]})})}function bR(e){return no(e)?{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`}:ro(e)?{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`}:io(e)?{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`}:ao(e)?{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`}:oo(e)?{stroke:`rgb(234, 88, 12)`,fill:`rgba(234, 88, 12, 0.2)`}:{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}function xR(e){return ao(e)?`Comment`:no(e)?`Highlight`:io(e)?`Assessment`:oo(e)?`Tag`:co(e)?`Resolved Reference`:ro(e)?`Unresolved Reference`:`Annotation`}function SR({annotations:e,imageWidth:t,imageHeight:n,displayWidth:r,displayHeight:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s,hoverDelayMs:c}){let l=r/t,u=i/n,{handleMouseEnter:d,handleMouseLeave:f}=(0,m.useMemo)(()=>Hu(e=>a?.client.beckon.hover(e),c),[a,c]);return(0,P.jsx)(`svg`,{className:`semiont-annotation-overlay`,style:{width:r,height:i},children:e.map(e=>{if(typeof e.target==`string`)return null;let t=Za(e.target.selector);if(!t)return null;let n=Ao(t.value);if(!n)return null;let r=e.id===o,i=e.id===s,c=bR(e),p=ro(e),m=p&&eo(e.body),h=p?m?`🔗`:`❓`:null;switch(n.type){case`rect`:{let{x:t,y:o,width:s,height:p}=n.data,m=(t+s)*l+8,g=(o+p)*u+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`rect`,{x:t*l,y:o*u,width:s*l,height:p*u,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}case`circle`:{let{cx:t,cy:o,r:s}=n.data,p=s*Math.min(l,u),m=Math.PI/4,g=t*l+p*Math.cos(m)+8,_=o*u+p*Math.sin(m)+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`circle`,{cx:t*l,cy:o*u,r:p,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:g,y:_,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}case`polygon`:{let t=n.data.points.map(e=>`${e.x*l},${e.y*u}`).join(` `),o=[...n.data.points.map(e=>({x:e.x*l,y:e.y*u,sum:e.x*l+e.y*u}))].sort((e,t)=>t.sum-e.sum),s=o[0],p=o[1],m=(s.x+p.x)/2+8,g=(s.y+p.y)/2+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`polygon`,{points:t,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}default:return null}})})}function CR(e){if(!e)return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`};switch(e){case`highlighting`:return{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`};case`linking`:return{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`};case`assessing`:return{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`};case`commenting`:return{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`};default:return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}}function wR({imageUrl:e,existingAnnotations:t=[],drawingMode:n,selectedMotivation:r,session:i,hoveredAnnotationId:a,selectedAnnotationId:o}){let{hoverDelayMs:s}=dE(),c=(0,m.useRef)(null),l=(0,m.useRef)(null),[u,d]=(0,m.useState)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let t=new Image;t.onload=()=>{d({width:t.naturalWidth,height:t.naturalHeight})},t.src=e},[e]),(0,m.useEffect)(()=>{let e=()=>{l.current&&p({width:l.current.clientWidth,height:l.current.clientHeight})};e();let t=null;try{t=new ResizeObserver(e),l.current&&t.observe(l.current)}catch{console.warn(`ResizeObserver not supported, falling back to window resize listener`),window.addEventListener(`resize`,e)}return()=>{t?t.disconnect():window.removeEventListener(`resize`,e)}},[]);let x=(0,m.useCallback)(e=>{if(!l.current)return null;let t=l.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},[]);return(0,P.jsxs)(`div`,{ref:c,className:`semiont-svg-drawing-canvas`,onMouseDown:(0,m.useCallback)(e=>{if(!n)return;let t=x(e);t&&(g(!0),v(t),b(t))},[n,x]),onMouseMove:(0,m.useCallback)(e=>{if(!h||!_)return;let t=x(e);t&&b(t)},[h,_,x]),onMouseUp:(0,m.useCallback)(e=>{if(!h||!_||!n)return;let a=x(e);if(!a||!f||!u)return;if(Math.sqrt((a.x-_.x)**2+(a.y-_.y)**2)<10){if(t.length>0){let e=t.find(e=>{if(typeof e.target==`string`)return!1;let t=e.target.selector;if(!t)return!1;let n=(Array.isArray(t)?t:[t]).find(e=>e.type===`SvgSelector`);if(!n||n.type!==`SvgSelector`)return!1;let r=Ao(n.value);if(!r)return!1;let i=f.width/u.width,o=f.height/u.height;if(r.type===`rect`){let{x:e,y:t,width:n,height:s}=r.data,c=e*i,l=t*o,u=n*i,d=s*o;return a.x>=c&&a.x<=c+u&&a.y>=l&&a.y<=l+d}return!1});if(e){i?.client.browse.click(e.id,e.motivation),g(!1),v(null),b(null);return}}g(!1),v(null),b(null);return}let o;switch(n){case`circle`:o=ko(_,Math.sqrt((a.x-_.x)**2+(a.y-_.y)**2));break;case`polygon`:{let e=(_.x+a.x)/2,t=(_.y+a.y)/2,n=Math.abs(a.x-_.x)/2,r=Math.abs(a.y-_.y)/2;o=Oo([{x:e,y:t-r},{x:e+n,y:t},{x:e,y:t+r},{x:e-n,y:t}]);break}default:o=Do(_,a);break}let s=jo(o,f.width,f.height,u.width,u.height);i&&r&&i.client.mark.request({type:`SvgSelector`,value:s},r),g(!1),v(null),b(null)},[h,_,n,f,u,x,r,t]),onMouseLeave:(0,m.useCallback)(()=>{h&&(g(!1),v(null),b(null))},[h]),"data-drawing-mode":n||`none`,children:[(0,P.jsx)(`img`,{ref:l,src:e,alt:`Annotatable content`,className:`semiont-svg-drawing-canvas__image`,draggable:!1}),f&&u&&(0,P.jsx)(`div`,{className:`semiont-svg-drawing-canvas__overlay-container`,children:(0,P.jsxs)(`div`,{className:`semiont-svg-drawing-canvas__overlay`,style:{width:f.width,height:f.height},children:[(0,P.jsx)(SR,{annotations:t,imageWidth:u.width,imageHeight:u.height,displayWidth:f.width,displayHeight:f.height,hoverDelayMs:s,...i&&{session:i},...a!==void 0&&{hoveredAnnotationId:a},...o!==void 0&&{selectedAnnotationId:o}}),h&&_&&y&&(()=>{let e=CR(r||null);return(0,P.jsxs)(`svg`,{className:`semiont-svg-drawing-canvas__preview`,style:{width:f.width,height:f.height},children:[n===`circle`&&(()=>{let t=Math.sqrt((y.x-_.x)**2+(y.y-_.y)**2);return(0,P.jsx)(`circle`,{cx:_.x,cy:_.y,r:t,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),n===`polygon`&&(()=>{let t=(_.x+y.x)/2,n=(_.y+y.y)/2,r=Math.abs(y.x-_.x)/2,i=Math.abs(y.y-_.y)/2;return(0,P.jsx)(`polygon`,{points:[{x:t,y:n-i},{x:t+r,y:n},{x:t,y:n+i},{x:t-r,y:n}].map(e=>`${e.x},${e.y}`).join(` `),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),n===`rectangle`&&(0,P.jsx)(`rect`,{x:Math.min(_.x,y.x),y:Math.min(_.y,y.y),width:Math.abs(y.x-_.x),height:Math.abs(y.y-_.y),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})]})})()]})})]})}var TR=[{titleKey:`navigationTitle`,shortcuts:[{keys:[`⌘K`,`Ctrl K`],descriptionKey:`navOpenSearch`},{keys:[`/`],descriptionKey:`navOpenSearchAlt`},{keys:[`⌘N`,`Ctrl N`],descriptionKey:`navCreateResource`},{keys:[`Esc Esc`],descriptionKey:`navCloseOverlays`},{keys:[`?`],descriptionKey:`navShowHelp`}]},{titleKey:`sidebarTitle`,shortcuts:[{keys:[`Click <`],descriptionKey:`sidebarCollapse`},{keys:[`Click ☰`],descriptionKey:`sidebarExpand`},{keys:[`Space`],descriptionKey:`sidebarPickup`},{keys:[`↑`,`↓`],descriptionKey:`sidebarMove`},{keys:[`Space`],descriptionKey:`sidebarDrop`},{keys:[`Esc`],descriptionKey:`sidebarCancel`}]},{titleKey:`annotationsTitle`,shortcuts:[{keys:[`H`],descriptionKey:`annotHighlight`},{keys:[`R`],descriptionKey:`annotReference`},{keys:[`Delete`],descriptionKey:`annotDelete`},{keys:[`Tab`],descriptionKey:`annotNavigate`},{keys:[`Shift Tab`],descriptionKey:`annotNavigateBack`}]},{titleKey:`listsTitle`,shortcuts:[{keys:[`←`,`→`],descriptionKey:`listsFilterNav`},{keys:[`↑`,`↓`,`←`,`→`],descriptionKey:`listsGridNav`},{keys:[`Home`],descriptionKey:`listsJumpFirst`},{keys:[`End`],descriptionKey:`listsJumpLast`}]},{titleKey:`searchModalTitle`,shortcuts:[{keys:[`↑`,`↓`],descriptionKey:`searchNav`},{keys:[`Enter`],descriptionKey:`searchSelect`},{keys:[`Esc`],descriptionKey:`searchClose`}]},{titleKey:`modalTitle`,shortcuts:[{keys:[`Esc`],descriptionKey:`modalClose`},{keys:[`Tab`],descriptionKey:`modalNavForward`},{keys:[`Shift Tab`],descriptionKey:`modalNavBackward`},{keys:[`Enter`],descriptionKey:`modalActivate`},{keys:[`Space`],descriptionKey:`modalActivate`}]},{titleKey:`accessibilityTitle`,shortcuts:[{keys:[`Tab`],descriptionKey:`a11ySkipLinks`},{keys:[`Enter`],descriptionKey:`a11yFollowLink`}]}];function ER({isOpen:e,onClose:t}){let n=hh(`KeyboardShortcuts`),r=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;return(0,P.jsx)(QL,{appear:!0,show:e,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:t,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--large`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__header`,children:(0,P.jsxs)(`div`,{className:`semiont-modal__header-content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title`,children:n(`title`)}),(0,P.jsx)(`button`,{onClick:t,"aria-label":n(`closeDialog`),className:`semiont-modal__close`,children:(0,P.jsx)(`svg`,{className:`semiont-modal__close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}),(0,P.jsxs)(`div`,{className:`semiont-modal__body`,children:[(0,P.jsx)(`div`,{className:`semiont-shortcuts`,children:TR.map(e=>(0,P.jsxs)(`div`,{className:`semiont-shortcuts__group`,children:[(0,P.jsx)(`h3`,{className:`semiont-shortcuts__group-title`,children:n(e.titleKey)}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__list`,children:e.shortcuts.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-shortcuts__item`,children:[(0,P.jsx)(`span`,{className:`semiont-shortcuts__description`,children:n(e.descriptionKey)}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__keys`,children:e.keys.map((e,t)=>e.includes(`⌘`)&&!r||e.includes(`Ctrl`)&&r?null:(0,P.jsxs)(m.Fragment,{children:[t>0&&!e.includes(`⌘`)&&!e.includes(`Ctrl`)&&(0,P.jsx)(`span`,{className:`semiont-shortcuts__separator`,children:n(`or`)}),(0,P.jsx)(`kbd`,{className:`semiont-shortcuts__key`,children:e})]},t))})]},t))})]},e.titleKey))}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__note`,children:(0,P.jsx)(`p`,{className:`semiont-shortcuts__note-text`,children:n(r?`macNote`:`windowsNote`)})})]}),(0,P.jsx)(`div`,{className:`semiont-modal__footer`,children:(0,P.jsxs)(`div`,{className:`semiont-modal__footer-content`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__hint`,children:n(`footerHint`,{key:`?`}).split(`?`).map((e,t,n)=>(0,P.jsxs)(m.Fragment,{children:[e,t<n.length-1&&(0,P.jsx)(`kbd`,{className:`semiont-modal__hint-key`,children:`?`})]},t))}),(0,P.jsx)(`button`,{onClick:t,className:`semiont-button semiont-button--secondary`,children:n(`close`)})]})})]})})})})]})})}function DR(){let e=K(R().activeSignals$),t=K(e?.permissionDeniedAt$)??null,n=K(e?.permissionDeniedMessage$)??null,r=()=>e?.acknowledgePermissionDenied(),i=t!==null,a=n??`You do not have permission to perform this action.`,o=()=>{r(),window.history.back()};return(0,P.jsx)(QL,{appear:!0,show:i,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-modal__icon`,children:(0,P.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-amber-600, #d97706)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})})}),(0,P.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Access Denied`}),(0,P.jsx)(`p`,{className:`semiont-modal__description`,children:a})]}),(0,P.jsxs)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md, 0.375rem)`,border:`1px solid var(--semiont-border-primary)`,fontSize:`var(--semiont-text-sm, 0.875rem)`,marginBottom:`1rem`},children:[(0,P.jsx)(`p`,{style:{color:`var(--semiont-text-secondary)`,marginBottom:`0.5rem`},children:`This could be because:`}),(0,P.jsxs)(`ul`,{style:{listStyle:`disc`,listStylePosition:`inside`,color:`var(--semiont-text-tertiary)`,display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,P.jsx)(`li`,{children:`You don't have the required permissions`}),(0,P.jsx)(`li`,{children:`The resource is restricted to specific users or teams`}),(0,P.jsx)(`li`,{children:`Your account type doesn't include this feature`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--primary semiont-button--flex`,children:`Go Back`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/`},className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`})]}),(0,P.jsx)(`div`,{className:`semiont-modal__actions`,style:{marginTop:`0.5rem`,paddingTop:`0.5rem`,borderTop:`1px solid var(--semiont-border-primary)`},children:(0,P.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},className:`semiont-button--secondary semiont-button--flex`,style:{fontSize:`var(--semiont-text-sm, 0.875rem)`},children:`Switch Account`})})]})})})})]})})}function OR(){let e=K(R().activeSignals$),t=K(e?.sessionExpiredAt$)??null,n=K(e?.sessionExpiredMessage$)??null,r=()=>e?.acknowledgeSessionExpired(),i=t!==null,a=()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},o=()=>{r(),window.location.href=`/`};return(0,P.jsx)(QL,{appear:!0,show:i,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-modal__icon`,style:{background:`linear-gradient(to bottom right, var(--semiont-color-red-100, #fee2e2), var(--semiont-color-red-300, #fca5a5))`},children:(0,P.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-red-600, #dc2626)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})})}),(0,P.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Session Expired`}),(0,P.jsx)(`p`,{className:`semiont-modal__description`,children:n??`Your session has expired for security reasons. Please sign in again to continue working.`})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`}),(0,P.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button--primary semiont-button--flex`,children:`Sign In Again`})]})]})})})})]})})}function kR(e,t){if(!e)return[{exact:``,start:0,end:0}];let n=bo(e),r=t.map(t=>{let r=to(t.target),i=Xa(r),a=r?fo(r):null,o;return a&&(o=So(e,a.exact,a.prefix,a.suffix,i?.start,n)),{annotation:t,start:o?.start??i?.start??0,end:o?.end??i?.end??0}}).filter(t=>t.start>=0&&t.end<=e.length&&t.start<t.end).sort((e,t)=>e.start-t.start);if(r.length===0)return[{exact:e,start:0,end:e.length}];let i=[],a=0;for(let{annotation:t,start:n,end:o}of r)n<a||(n>a&&i.push({exact:e.slice(a,n),start:a,end:n}),i.push({exact:e.slice(n,o),annotation:t,start:n,end:o}),a=o);return a<e.length&&i.push({exact:e.slice(a),start:a,end:e.length}),i}function AR(e,t,n,r){if(!t||n<0||r<=n||r>e.length)return null;let i=Mo(e,n,r);return[{type:`TextPositionSelector`,start:n,end:r},{type:`TextQuoteSelector`,exact:t,...i.prefix&&{prefix:i.prefix},...i.suffix&&{suffix:i.suffix}}]}function jR(e,t){let n=e.indexOf(t);return n===-1?null:{start:n,end:n+t.length}}var MR=(0,m.lazy)(()=>b(()=>import(`./PdfAnnotationCanvas.client-CN3C3S55-DsCya3j0.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([2,3,4,5])));function NR({content:e,mimeType:t=`text/plain`,resourceUri:n,annotations:r,uiState:i,onUIStateChange:a,enableWidgets:o=!1,getTargetResourceName:s,generatingReferenceId:c,showLineNumbers:l=!1,hoverDelayMs:u=150,annotateMode:d}){let{newAnnotationIds:f}=jE(),p=(0,m.useRef)(null),h=K(R().activeSession$),g=Ro(t),{highlights:_,references:v,assessments:y,comments:b,tags:x}=r,S=[..._,...v,...y,...b,...x],C=kR(e,S),{selectedMotivation:w,selectedClick:T,selectedShape:E,hoveredAnnotationId:D,scrollToAnnotationId:O}=i,k=(0,m.useRef)(a);switch(k.current=a,SE({"mark:selection-changed":(0,m.useCallback)(({motivation:e})=>{k.current?.({selectedMotivation:e})},[]),"mark:click-changed":(0,m.useCallback)(({action:e})=>{k.current?.({selectedClick:e})},[]),"mark:shape-changed":(0,m.useCallback)(({shape:e})=>{k.current?.({selectedShape:e})},[]),"beckon:hover":(0,m.useCallback)(({annotationId:e})=>{k.current?.({hoveredAnnotationId:e})},[])}),(0,m.useEffect)(()=>{let t=p.current;if(!t)return;let n=!1,r=e=>{let t=e.target;n=!!t.closest(`[data-annotation-id]`),t.closest(`[data-annotation-ui]`)},i=r=>{let i=r.target;if(i.closest(`.semiont-pdf-annotation-canvas`)||i.closest(`.semiont-svg-drawing-canvas`))return;let a=window.getSelection();if(!a||a.isCollapsed||!a.toString()){n=!1;return}if(n){n=!1;return}n=!1;let o=a.getRangeAt(0),s=a.toString(),c=t.querySelector(`.codemirror-renderer`)?.__cmView,l,u;if(!c||!c.posAtDOM){let t=jR(e,s);if(!t)return;l=t.start,u=t.end}else l=c.posAtDOM(o.startContainer,o.startOffset),u=l+s.length;if(l>=0&&w){let t=AR(e,s,l,u);if(!t)return;h?.client.mark.request(t,w),a.removeAllRanges()}};return t.addEventListener(`mouseup`,i),t.addEventListener(`mousedown`,r),()=>{t.removeEventListener(`mouseup`,i),t.removeEventListener(`mousedown`,r)}},[w,e]),g){case`text`:return(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`text`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:(0,P.jsx)(WN,{content:e,segments:C,editable:!1,newAnnotationIds:f,...D!==void 0&&{hoveredAnnotationId:D},...O!==void 0&&{scrollToAnnotationId:O},sourceView:!0,showLineNumbers:l,hoverDelayMs:u,enableWidgets:o,session:h,...s&&{getTargetResourceName:s},...c!==void 0&&{generatingReferenceId:c}})})]});case`image`:return Lo(t)?(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`pdf`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,showShapeGroup:!0,selectedShape:E,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,P.jsx)(m.Suspense,{fallback:(0,P.jsx)(`div`,{className:`semiont-annotate-view__loading`,children:`Loading PDF viewer...`}),children:(0,P.jsx)(MR,{pdfUrl:e,existingAnnotations:S,drawingMode:w?E:null,selectedMotivation:w,session:h,hoveredAnnotationId:D||null,hoverDelayMs:u})})})]}):(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`image`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,showShapeGroup:!0,selectedShape:E,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,P.jsx)(wR,{imageUrl:e,existingAnnotations:S,drawingMode:w?E:null,selectedMotivation:w,session:h,hoveredAnnotationId:D||null,hoverDelayMs:u})})]});default:return(0,P.jsx)(`div`,{ref:p,className:`semiont-annotate-view semiont-annotate-view--unsupported`,"data-mime-type":`unsupported`,children:(0,P.jsxs)(`div`,{className:`semiont-annotate-view__empty`,children:[(0,P.jsxs)(`p`,{className:`semiont-annotate-view__empty-message`,children:[`Annotation not supported for `,t]}),n&&(0,P.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})}}function PR(e){if(!e.startsWith(`did:`))return e;let t=e.match(/^did:web:system:(.+)$/);if(t){let e=t[1];return e.charAt(0).toUpperCase()+e.slice(1)}let n=e.match(/^did:web:[^:]+:users:(.+)$/);return n?decodeURIComponent(n[1]):e}function FR(e,t,n){switch(e){case`yield:created`:return t(`resourceCreated`);case`yield:cloned`:return t(`resourceCloned`);case`mark:archived`:return t(`resourceArchived`);case`mark:unarchived`:return t(`resourceUnarchived`);case`mark:added`:{let e=n?.annotation?.motivation;return t(e===`highlighting`?`highlightAdded`:e===`linking`?`referenceCreated`:e===`assessing`?`assessmentAdded`:`annotationAdded`)}case`mark:removed`:return t(`annotationRemoved`);case`mark:body-updated`:return t(`annotationBodyUpdated`);case`mark:entity-tag-added`:return t(`entitytagAdded`);case`mark:entity-tag-removed`:return t(`entitytagRemoved`);case`job:completed`:case`job:started`:case`job:progress`:case`job:failed`:return t(`jobEvent`);case`yield:representation-added`:case`yield:representation-removed`:return t(`representationEvent`);default:return e}}function IR(e,t){switch(e){case`yield:created`:case`yield:cloned`:case`mark:archived`:case`mark:unarchived`:return`📄`;case`mark:added`:{let e=t?.annotation?.motivation;return e===`highlighting`?Ih.highlight.iconEmoji||`📝`:e===`linking`?Ih.reference.iconEmoji||`📝`:e===`assessing`&&Ih.assessment.iconEmoji||`📝`}case`mark:removed`:return`🗑️`;case`mark:body-updated`:return`✏️`;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return`🏷️`;case`job:completed`:return`🔗`;case`job:started`:case`job:progress`:return`⚙️`;case`job:failed`:return`❌`;case`yield:representation-added`:case`yield:representation-removed`:return`📄`;default:return`📝`}}function LR(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`justNow`):i<60?t(`minutesAgo`,{count:i}):a<24?t(`hoursAgo`,{count:a}):o<7?t(`daysAgo`,{count:o}):n.toLocaleDateString()}function RR(e,t=50){let n=e.trim();return n.length>t?n.substring(0,t)+`...`:n}function zR(e,t,n){let r=e,i=r.payload;switch(r.type){case`yield:created`:case`yield:cloned`:return{exact:i.name,isQuoted:!1,isTag:!1};case`mark:body-updated`:{let e=t.find(e=>e.id.endsWith(`/annotations/${i.annotationId}`));if(e?.target)try{let t=lo(to(e.target));if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}catch{}return null}case`mark:removed`:{let e=n.find(e=>e.type===`mark:added`&&e.payload.annotation.id.endsWith(`/annotations/${i.annotationId}`));if(e&&e.type===`mark:added`)try{let t=e.payload.annotation.target;if(typeof t!=`string`&&t.selector){let e=lo(t.selector);if(e)return{exact:RR(e),isQuoted:!0,isTag:!1}}}catch{}return null}case`mark:added`:try{let e=i.annotation.target;if(typeof e!=`string`&&e.selector){let t=lo(e.selector);if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}}catch{}return null;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return{exact:i.entityType,isQuoted:!1,isTag:!0};case`job:completed`:if(i.annotationUri){let e=t.find(e=>e.id===i.annotationUri);if(e?.target)try{let t=lo(to(e.target));if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}catch{}}return null;case`job:started`:case`job:progress`:case`job:failed`:case`yield:representation-added`:case`yield:representation-removed`:return null;default:return null}}function BR(e){let t=e,n=t.payload;if(t.type===`mark:added`){let e=n.annotation.motivation,t=n.annotation.body;if(e===`linking`&&t&&`entityTypes`in t)return t.entityTypes??[]}return[]}function VR(e){let t=e,n=t.payload;return t.type===`yield:created`?{type:`created`,userId:t.userId,metadata:void 0}:t.type===`yield:cloned`?{type:`cloned`,userId:t.userId,sourceDocId:n.parentResourceId,parentResourceId:n.parentResourceId,metadata:void 0}:null}function HR({event:e,annotations:t,allEvents:n,isRelated:r,t:i,Link:a,routes:o,onEventRef:s,onEventClick:c,onEventHover:l}){let u=zR(e,t,n),d=Ha(e),f=VR(e),p=BR(e),h=(0,m.useRef)(null),g=(0,m.useRef)(l);(0,m.useEffect)(()=>{g.current=l});let _=(0,m.useCallback)(()=>{!d||!g.current||(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{g.current?.(d)},300))},[d]),v=(0,m.useCallback)(()=>{h.current&&=(clearTimeout(h.current),null),g.current&&g.current(null)},[]);return(0,P.jsxs)(d?`button`:`div`,{ref:e=>{s&&s(d,e)},...d?{type:`button`,onClick:()=>c?.(d),"aria-label":i(`viewAnnotation`,{content:u?.exact||FR(e.type,i)}),className:`semiont-history-event`,"data-related":r?`true`:`false`,"data-interactive":`true`}:{className:`semiont-history-event`,"data-related":r?`true`:`false`},children:[(0,P.jsxs)(`div`,{className:`semiont-history-event__content`,children:[(0,P.jsx)(`span`,{className:`semiont-history-event__emoji`,onMouseEnter:_,onMouseLeave:v,children:IR(e.type,e.payload)}),u?u.isTag?(0,P.jsx)(`span`,{className:`semiont-history-event__tag`,children:u.exact}):u.isQuoted?(0,P.jsxs)(`span`,{className:`semiont-history-event__text semiont-history-event__text--quoted`,children:[`“`,u.exact,`”`]}):(0,P.jsx)(`span`,{className:`semiont-history-event__text`,children:u.exact}):(0,P.jsx)(`span`,{className:`semiont-history-event__text`,children:FR(e.type,i,e.payload)}),e.userId&&(0,P.jsx)(`span`,{className:`semiont-history-event__user`,children:PR(e.userId)}),(0,P.jsx)(`span`,{className:`semiont-history-event__timestamp`,children:LR(e.timestamp,i)})]}),p.length>0&&(0,P.jsx)(`div`,{className:`semiont-history-event__entity-types`,children:p.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--small`,"data-variant":`blue`,children:e},e))}),f&&(0,P.jsxs)(`div`,{className:`semiont-history-event__details`,children:[(0,P.jsxs)(`span`,{className:`semiont-history-event__detail`,children:[i(`user`),`: `,(0,P.jsx)(`span`,{className:`semiont-history-event__detail-value`,children:f.userId?PR(f.userId):``})]}),f.type===`cloned`&&f.sourceDocId&&(0,P.jsx)(a,{href:o.resourceDetail(f.sourceDocId),className:`semiont-history-event__link`,onClick:e=>e.stopPropagation(),children:i(`viewOriginal`)})]})]})}function UR({rUri:e,hoveredAnnotationId:t,onEventHover:n,onEventClick:r,Link:i,routes:a}){let o=hh(`AnnotationHistory`),s=K(R().activeSession$)?.client,c=K(s?.browse.events(e)),l=K(s?.browse.annotations(e)),u=c===void 0,d=l??[],f=(0,m.useRef)(new Map),p=(0,m.useRef)(null),h=c?c.filter(e=>e.type!==`job:started`&&e.type!==`job:progress`&&e.type!==`job:completed`).sort((e,t)=>e.metadata.sequenceNumber-t.metadata.sequenceNumber):[];return(0,m.useEffect)(()=>{p.current&&h.length>0&&requestAnimationFrame(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)})},[h.length]),(0,m.useEffect)(()=>{if(!t)return;let e=f.current.get(t);e&&p.current&&(e.scrollIntoView({behavior:`smooth`,block:`nearest`}),e.classList.add(`bg-blue-100`,`dark:bg-blue-900/30`),setTimeout(()=>{e.classList.remove(`bg-blue-100`,`dark:bg-blue-900/30`)},1500))},[t]),u?(0,P.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,P.jsx)(`div`,{className:`semiont-history-panel__loading`,children:o(`loading`)})]}):h.length===0?null:(0,P.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,P.jsx)(`div`,{ref:p,className:`semiont-history-panel__list`,children:h.map(e=>(0,P.jsx)(HR,{event:e,annotations:d,allEvents:h,isRelated:t?(()=>{let n=Ha(e);return n?n===t:!1})():!1,t:o,Link:i,routes:a,onEventRef:(e,t)=>{t&&e?f.current.set(e,t):!t&&e&&f.current.delete(e)},...r&&{onEventClick:r},...n&&{onEventHover:n}},e.id))})]})}function WR(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var GR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qR={};function JR(e,t){return((t||qR).jsx?KR:GR).test(e)}var YR=/[ \t\n\f\r]/g;function XR(e){return typeof e==`object`?e.type===`text`?ZR(e.value):!1:ZR(e)}function ZR(e){return e.replace(YR,``)===``}var QR=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};QR.prototype.normal={},QR.prototype.property={},QR.prototype.space=void 0;function $R(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new QR(n,r,t)}function ez(e){return e.toLowerCase()}var tz=class{constructor(e,t){this.attribute=t,this.property=e}};tz.prototype.attribute=``,tz.prototype.booleanish=!1,tz.prototype.boolean=!1,tz.prototype.commaOrSpaceSeparated=!1,tz.prototype.commaSeparated=!1,tz.prototype.defined=!1,tz.prototype.mustUseProperty=!1,tz.prototype.number=!1,tz.prototype.overloadedBoolean=!1,tz.prototype.property=``,tz.prototype.spaceSeparated=!1,tz.prototype.space=void 0;var nz={};d(nz,{boolean:()=>X,booleanish:()=>iz,commaOrSpaceSeparated:()=>cz,commaSeparated:()=>sz,number:()=>Z,overloadedBoolean:()=>az,spaceSeparated:()=>oz});var rz=0,X=lz(),iz=lz(),az=lz(),Z=lz(),oz=lz(),sz=lz(),cz=lz();function lz(){return 2**++rz}var uz=Object.keys(nz),dz=class extends tz{constructor(e,t,n,r){let i=-1;if(super(e,t),fz(this,`space`,r),typeof n==`number`)for(;++i<uz.length;){let e=uz[i];fz(this,uz[i],(n&nz[e])===nz[e])}}};dz.prototype.defined=!0;function fz(e,t,n){n&&(e[t]=n)}function pz(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new dz(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ez(r)]=r,n[ez(a.attribute)]=r}return new QR(t,n,e.space)}var mz=pz({properties:{ariaActiveDescendant:null,ariaAtomic:iz,ariaAutoComplete:null,ariaBusy:iz,ariaChecked:iz,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:oz,ariaCurrent:null,ariaDescribedBy:oz,ariaDetails:null,ariaDisabled:iz,ariaDropEffect:oz,ariaErrorMessage:null,ariaExpanded:iz,ariaFlowTo:oz,ariaGrabbed:iz,ariaHasPopup:null,ariaHidden:iz,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oz,ariaLevel:Z,ariaLive:null,ariaModal:iz,ariaMultiLine:iz,ariaMultiSelectable:iz,ariaOrientation:null,ariaOwns:oz,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:iz,ariaReadOnly:iz,ariaRelevant:null,ariaRequired:iz,ariaRoleDescription:oz,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:iz,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function hz(e,t){return t in e?e[t]:t}function gz(e,t){return hz(e,t.toLowerCase())}var _z=pz({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:sz,acceptCharset:oz,accessKey:oz,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:oz,autoFocus:X,autoPlay:X,blocking:oz,capture:null,charSet:null,checked:X,cite:null,className:oz,cols:Z,colSpan:null,content:null,contentEditable:iz,controls:X,controlsList:oz,coords:Z|sz,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:az,draggable:iz,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:oz,height:Z,hidden:az,high:Z,href:null,hrefLang:null,htmlFor:oz,httpEquiv:oz,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:oz,itemRef:oz,itemScope:X,itemType:oz,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:oz,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:oz,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:oz,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:iz,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:iz,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oz,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:iz,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:gz}),vz=pz({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`,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:cz,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:oz,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:sz,g2:sz,glyphName:sz,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:cz,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:oz,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cz,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cz,rev:cz,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cz,requiredFeatures:cz,requiredFonts:cz,requiredFormats:cz,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:cz,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cz,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cz,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:hz}),yz=pz({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()}}),bz=pz({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:gz}),xz=pz({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Sz={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`},Cz=/[A-Z]/g,wz=/-[a-z]/g,Tz=/^data[-\w.:]+$/i;function Ez(e,t){let n=ez(t),r=t,i=tz;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Tz.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(wz,Oz);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!wz.test(e)){let n=e.replace(Cz,Dz);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=dz}return new i(r,t)}function Dz(e){return`-`+e.toLowerCase()}function Oz(e){return e.charAt(1).toUpperCase()}var kz=$R([mz,_z,yz,bz,xz],`html`),Az=$R([mz,vz,yz,bz,xz],`svg`);function jz(e){return e.join(` `).trim()}var Mz=u(jh(),1),Nz=Fz(`end`),Pz=Fz(`start`);function Fz(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 Iz(e){let t=Pz(e),n=Nz(e);if(t&&n)return{start:t,end:n}}function Lz(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?zz(e.position):`start`in e||`end`in e?zz(e):`line`in e||`column`in e?Rz(e):``}function Rz(e){return Bz(e&&e.line)+`:`+Bz(e&&e.column)}function zz(e){return Rz(e&&e.start)+`-`+Rz(e&&e.end)}function Bz(e){return e&&typeof e==`number`?e:1}var Vz=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=Lz(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}};Vz.prototype.file=``,Vz.prototype.name=``,Vz.prototype.reason=``,Vz.prototype.message=``,Vz.prototype.stack=``,Vz.prototype.column=void 0,Vz.prototype.line=void 0,Vz.prototype.ancestors=void 0,Vz.prototype.cause=void 0,Vz.prototype.fatal=void 0,Vz.prototype.place=void 0,Vz.prototype.ruleId=void 0,Vz.prototype.source=void 0;var Hz={}.hasOwnProperty,Uz=new Map,Wz=/[A-Z]/g,Gz=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Kz=new Set([`td`,`th`]),qz=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Jz(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=aB(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=iB(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`?Az:kz,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Yz(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Yz(e,t,n){if(t.type===`element`)return Xz(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Zz(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return $z(e,t,n);if(t.type===`mdxjsEsm`)return Qz(e,t);if(t.type===`root`)return eB(e,t,n);if(t.type===`text`)return tB(e,t)}function Xz(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Az,e.schema=i),e.ancestors.push(t);let a=dB(e,t.tagName,!1),o=oB(e,t),s=cB(e,t);return Gz.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!XR(e):!0})),nB(e,o,a,t),rB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zz(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)}fB(e,t.position)}function Qz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fB(e,t.position)}function $z(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Az,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:dB(e,t.name,!0),o=sB(e,t),s=cB(e,t);return nB(e,o,a,t),rB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function eB(e,t,n){let r={};return rB(r,cB(e,t)),e.create(t,e.Fragment,r,n)}function tB(e,t){return t.value}function nB(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rB(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function iB(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 aB(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Pz(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 oB(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Hz.call(t.properties,i)){let a=lB(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Kz.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 sB(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 fB(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 fB(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function cB(e,t){let n=[],r=-1,i=e.passKeys?new Map:Uz;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=Yz(e,a,o);s!==void 0&&n.push(s)}return n}function lB(e,t,n){let r=Ez(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WR(n):jz(n)),r.property===`style`){let t=typeof n==`object`?n:uB(e,String(n));return e.stylePropertyNameCase===`css`&&(t=pB(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Sz[r.property]||r.property:r.attribute,n]}}function uB(e,t){try{return(0,Mz.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Vz("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=qz+`#cannot-parse-style-attribute`,r}}function dB(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=JR(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=JR(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Hz.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);fB(e)}function fB(e,t){let n=new Vz("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=qz+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function pB(e){let t={},n;for(n in e)Hz.call(e,n)&&(t[mB(n)]=e[n]);return t}function mB(e){let t=e.replace(Wz,hB);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function hB(e){return`-`+e.toLowerCase()}var gB={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`]},_B={};function vB(e,t){let n=t||_B;return yB(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function yB(e,t,n){if(xB(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 bB(e.children,t,n)}return Array.isArray(e)?bB(e,t,n):``}function bB(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=yB(e[i],t,n);return r.join(``)}function xB(e){return!!(e&&typeof e==`object`)}var SB={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:``,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:``,InvisibleTimes:``,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
107
|
+
`)),[]});var LI=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(LI||{});function RI(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function zI(e,t,n,r){let[i,a]=(0,m.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=II(e&&i?3:0),l=(0,m.useRef)(!1),u=(0,m.useRef)(!1);return PP(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),BI(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(s(3),c(4)):(s(4),c(2)))},run(){u.current?n?(c(3),s(4)):(c(4),s(3)):n?c(1):s(1)},done(){var e;u.current&&UI(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,NP()]),e?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function BI(e,{prepare:t,run:n,done:r,inFlight:i}){let a=MP();return HI(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(VI(e,r))})}),a.dispose}function VI(e,t){let n=MP();if(!e)return n.dispose;let r=!1;n.add(()=>{r=!0});let i=e.getAnimations?.call(e).filter(e=>e instanceof CSSTransition)??[];return i.length===0?(t(),n.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{r||t()}),n.dispose)}function HI(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition=`none`,n(),e.offsetHeight,e.style.transition=r}function UI(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function WI(e,t){let n=(0,m.useRef)([]),r=IP(e);(0,m.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}var GI=(0,m.createContext)(null);GI.displayName=`OpenClosedContext`;var KI=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(KI||{});function qI(){return(0,m.useContext)(GI)}function JI({value:e,children:t}){return m.createElement(GI.Provider,{value:e},t)}function YI({children:e}){return m.createElement(GI.Provider,{value:null},e)}function XI(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var ZI=[];XI(()=>{function e(e){if(!lF(e.target)||e.target===document.body||ZI[0]===e.target)return;let t=e.target;t=t.closest(rI),ZI.unshift(t??e.target),ZI=ZI.filter(e=>e!=null&&e.isConnected),ZI.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function QI(e){let t=IP(e),n=(0,m.useRef)(!1);(0,m.useEffect)(()=>(n.current=!1,()=>{n.current=!0,jP(()=>{n.current&&t()})}),[t])}var $I=(0,m.createContext)(!1);function eL(){return(0,m.useContext)($I)}function tL(e){return m.createElement($I.Provider,{value:e.force},e.children)}function nL(e){let t=eL(),n=(0,m.useContext)(sL),[r,i]=(0,m.useState)(()=>{if(!t&&n!==null)return n.current??null;if(EP.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,m.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,m.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var rL=m.Fragment,iL=XP(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,m.useRef)(null),a=hF(mF(e=>{i.current=e}),t),o=TI(i.current),s=nL(n??o),c=(0,m.useContext)(lL),l=NP(),u=WP();return QI(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),s?(0,h.createPortal)(m.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},u({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:rL,name:`Portal`})),s):null});function aL(e,t){let n=hF(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=WP();return r?m.createElement(iL,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:rL,name:`Portal`})}var oL=m.Fragment,sL=(0,m.createContext)(null);function cL(e,t){let{target:n,...r}=e,i={ref:hF(t)},a=WP();return m.createElement(sL.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:oL,name:`Popover.Group`}))}var lL=(0,m.createContext)(null);function uL(){let e=(0,m.useContext)(lL),t=(0,m.useRef)([]),n=IP(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=IP(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,m.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,m.useMemo)(()=>function({children:e}){return m.createElement(lL.Provider,{value:i},e)},[i])]}var dL=XP(aL),fL=XP(cL),pL=Object.assign(dL,{Group:fL});function mL(e,t=typeof document<`u`?document.defaultView:null,n){let r=XF(e,`escape`);EI(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===CF.Escape&&n(e))})}function hL(){let[e]=(0,m.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,m.useState)(e?.matches??!1);return PP(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function gL({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=IP(()=>{let r=DP(n),i=[];for(let t of e)t!==null&&(sF(t)?i.push(t):`current`in t&&sF(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&sF(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:IP(e=>r().some(t=>t.contains(e)))}}var _L=(0,m.createContext)(null);function vL({children:e,node:t}){let[n,r]=(0,m.useState)(null),i=yL(t??n);return m.createElement(_L.Provider,{value:i},e,i===null&&m.createElement(aF,{features:rF.Hidden,ref:e=>{if(e){for(let t of DP(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&sF(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function yL(e=null){return(0,m.useContext)(_L)??e}function bL(){let e=typeof document>`u`;return`useSyncExternalStore`in m?(e=>e.useSyncExternalStore)(m)(()=>()=>{},()=>!1,()=>!e):!1}function xL(){let e=bL(),[t,n]=m.useState(EP.isHandoffComplete);return t&&EP.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>EP.handoff(),[]),e?!1:t}function SL(){let e=(0,m.useRef)(!1);return PP(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var CL=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(CL||{});function wL(){let e=(0,m.useRef)(0);return SI(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function TL(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)sF(n.current)&&t.add(n.current);return t}var EL=`div`,DL=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))(DL||{});function OL(e,t){let n=(0,m.useRef)(null),r=hF(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;xL()||(s=0);let l=TI(n.current);ML(s,{ownerDocument:l});let u=NL(s,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});PL(s,{ownerDocument:l,container:n,containers:o,previousActiveElement:u});let d=wL(),f=IP(e=>{if(!cF(n.current))return;let t=n.current;(e=>e())(()=>{VP(d.current,{[CL.Forwards]:()=>{_I(t,aI.First,{skipElements:[e.relatedTarget,a]})},[CL.Backwards]:()=>{_I(t,aI.Last,{skipElements:[e.relatedTarget,a]})}})})}),p=XF(!!(s&2),`focus-trap#tab-lock`),h=NP(),g=(0,m.useRef)(!1),_={ref:r,onKeyDown(e){e.key==`Tab`&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(s&4))return;let t=TL(o);cF(n.current)&&t.add(n.current);let r=e.relatedTarget;lF(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(FL(t,r)||(g.current?_I(n.current,VP(d.current,{[CL.Forwards]:()=>aI.Next,[CL.Backwards]:()=>aI.Previous})|aI.WrapAround,{relativeTo:e.target}):lF(e.target)&&pI(e.target)))}},v=WP();return m.createElement(m.Fragment,null,p&&m.createElement(aF,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:rF.Focusable}),v({ourProps:_,theirProps:c,defaultTag:EL,name:`FocusTrap`}),p&&m.createElement(aF,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:rF.Focusable}))}var kL=XP(OL),AL=Object.assign(kL,{features:DL});function jL(e=!0){let t=(0,m.useRef)(ZI.slice());return WI(([e],[n])=>{n===!0&&e===!1&&jP(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=ZI.slice())},[e,ZI,t]),IP(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function ML(e,{ownerDocument:t}){let n=!!(e&8),r=jL(n);WI(()=>{n||AP(t?.body)&&pI(r())},[n]),QI(()=>{n&&pI(r())})}function NL(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,m.useRef)(null),o=XF(!!(e&1),`focus-trap#initial-focus`),s=SL();return WI(()=>{if(e===0)return;if(!o){i!=null&&i.current&&pI(i.current);return}let c=n.current;c&&jP(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)pI(r.current);else{if(e&16){if(_I(c,aI.First|aI.AutoFocus)!==oI.Error)return}else if(_I(c,aI.First)!==oI.Error)return;if(i!=null&&i.current&&(pI(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the <FocusTrap />`)}a.current=t?.activeElement})},[i,o,e]),a}function PL(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=SL(),o=!!(e&4);EI(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=TL(r);cF(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;cF(c)?FL(t,c)?(i.current=c,pI(c)):(e.preventDefault(),e.stopPropagation(),pI(s)):pI(i.current)},!0)}function FL(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function IL(e){return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!eF(e.as??WL)||m.Children.count(e.children)===1}var LL=(0,m.createContext)(null);LL.displayName=`TransitionContext`;var RL=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(RL||{});function zL(){let e=(0,m.useContext)(LL);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function BL(){let e=(0,m.useContext)(VL);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var VL=(0,m.createContext)(null);VL.displayName=`NestingContext`;function HL(e){return`children`in e?HL(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function UL(e,t){let n=FP(e),r=(0,m.useRef)([]),i=SL(),a=NP(),o=IP((e,t=UP.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(VP(t,{[UP.Unmount](){r.current.splice(o,1)},[UP.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!HL(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=IP(e=>{let t=r.current.find(({el:t})=>t===e);return t?t.state!==`visible`&&(t.state=`visible`):r.current.push({el:e,state:`visible`}),()=>o(e,UP.Unmount)}),c=(0,m.useRef)([]),l=(0,m.useRef)(Promise.resolve()),u=(0,m.useRef)({enter:[],leave:[]}),d=IP((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),t?.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),t?.chains.current[n].push([e,new Promise(e=>{Promise.all(u.current[n].map(([e,t])=>t)).then(()=>e())})]),n===`enter`?l.current=l.current.then(()=>t?.wait.current).then(()=>r(n)):r(n)}),f=IP((e,t,n)=>{Promise.all(u.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;(e=c.current.shift())==null||e()}).then(()=>n(t))});return(0,m.useMemo)(()=>({children:r,register:s,unregister:o,onStart:d,onStop:f,wait:l,chains:u}),[s,o,r,d,f,u,l])}var WL=m.Fragment,GL=HP.RenderStrategy;function KL(e,t){var n;let{transition:r=!0,beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:c,enterFrom:l,enterTo:u,entered:d,leave:f,leaveFrom:p,leaveTo:h,...g}=e,[_,v]=(0,m.useState)(null),y=(0,m.useRef)(null),b=IL(e),x=hF(...b?[y,t,v]:t===null?[]:[t]),S=(n=g.unmount)==null||n?UP.Unmount:UP.Hidden,{show:C,appear:w,initial:T}=zL(),[E,D]=(0,m.useState)(C?`visible`:`hidden`),O=BL(),{register:k,unregister:A}=O;PP(()=>k(y),[k,y]),PP(()=>{if(S===UP.Hidden&&y.current){if(C&&E!==`visible`){D(`visible`);return}return VP(E,{hidden:()=>A(y),visible:()=>k(y)})}},[E,y,k,A,C,S]);let ee=xL();PP(()=>{if(b&&ee&&E===`visible`&&y.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,E,ee,b]);let te=T&&!w,j=w&&C&&T,ne=(0,m.useRef)(!1),re=UL(()=>{ne.current||(D(`hidden`),A(y))},O),ie=IP(e=>{ne.current=!0;let t=e?`enter`:`leave`;re.onStart(y,t,e=>{e===`enter`?i?.():e===`leave`&&o?.()})}),ae=IP(e=>{let t=e?`enter`:`leave`;ne.current=!1,re.onStop(y,t,e=>{e===`enter`?a?.():e===`leave`&&s?.()}),t===`leave`&&!HL(re)&&(D(`hidden`),A(y))});(0,m.useEffect)(()=>{b&&r||(ie(C),ae(C))},[C,b,r]);let[,M]=zI(!(!r||!b||!ee||te),_,C,{start:ie,end:ae}),oe=ZP({ref:x,className:BP(g.className,j&&c,j&&l,M.enter&&c,M.enter&&M.closed&&l,M.enter&&!M.closed&&u,M.leave&&f,M.leave&&!M.closed&&p,M.leave&&M.closed&&h,!M.transition&&C&&d)?.trim()||void 0,...RI(M)}),se=0;E===`visible`&&(se|=KI.Open),E===`hidden`&&(se|=KI.Closed),C&&E===`hidden`&&(se|=KI.Opening),!C&&E===`visible`&&(se|=KI.Closing);let ce=WP();return m.createElement(VL.Provider,{value:re},m.createElement(JI,{value:se},ce({ourProps:oe,theirProps:g,defaultTag:WL,features:GL,visible:E===`visible`,name:`Transition.Child`})))}function qL(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=(0,m.useRef)(null),s=hF(...IL(e)?[o,t]:t===null?[]:[t]);xL();let c=qI();if(n===void 0&&c!==null&&(n=(c&KI.Open)===KI.Open),n===void 0)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=(0,m.useState)(n?`visible`:`hidden`),d=UL(()=>{n||u(`hidden`)}),[f,p]=(0,m.useState)(!0),h=(0,m.useRef)([n]);PP(()=>{f!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let g=(0,m.useMemo)(()=>({show:n,appear:r,initial:f}),[n,r,f]);PP(()=>{n?u(`visible`):!HL(d)&&o.current!==null&&u(`hidden`)},[n,d]);let _={unmount:i},v=IP(()=>{var t;f&&p(!1),(t=e.beforeEnter)==null||t.call(e)}),y=IP(()=>{var t;f&&p(!1),(t=e.beforeLeave)==null||t.call(e)}),b=WP();return m.createElement(VL.Provider,{value:d},m.createElement(LL.Provider,{value:g},b({ourProps:{..._,as:m.Fragment,children:m.createElement(XL,{ref:s,..._,...a,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:m.Fragment,features:GL,visible:l===`visible`,name:`Transition`})))}function JL(e,t){let n=(0,m.useContext)(LL)!==null,r=qI()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(YL,{ref:t,...e}):m.createElement(XL,{ref:t,...e}))}var YL=XP(qL),XL=XP(KL),ZL=XP(JL),QL=Object.assign(YL,{Child:ZL,Root:YL}),$L=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))($L||{}),eR=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(eR||{}),tR={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},nR=(0,m.createContext)(null);nR.displayName=`DialogContext`;function rR(e){let t=(0,m.useContext)(nR);if(t===null){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,rR),t}return t}function iR(e,t){return VP(t.type,tR,e,t)}var aR=XP(function(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:c=!0,__demoMode:l=!1,unmount:u=!1,...d}=e,f=(0,m.useRef)(!1);s=(function(){return s===`dialog`||s===`alertdialog`?s:(f.current||(f.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)})();let p=qI();i===void 0&&p!==null&&(i=(p&KI.Open)===KI.Open);let h=(0,m.useRef)(null),g=hF(h,t),_=TI(h.current),v=+!i,[y,b]=(0,m.useReducer)(iR,{titleId:null,descriptionId:null,panelRef:(0,m.createRef)()}),x=IP(()=>a(!1)),S=IP(e=>b({type:0,id:e})),C=xL()?v===0:!1,[w,T]=uL(),E={get current(){return y.panelRef.current??h.current}},D=yL(),{resolveContainers:O}=gL({mainTreeNode:D,portals:w,defaultContainers:[E]}),k=p===null?!1:(p&KI.Closing)===KI.Closing;tI(l||k?!1:C,{allowed:IP(()=>[h.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:IP(()=>[D?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let A=qF.get(null);PP(()=>{if(C)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,C]);let ee=JF(A,(0,m.useCallback)(e=>A.selectors.isTop(e,r),[A,r]));wI(ee,O,e=>{e.preventDefault(),x()}),mL(ee,_?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),x()}),FI(l||k?!1:C,_,O),nI(C,h,x);let[te,j]=vF(),ne=(0,m.useMemo)(()=>[{dialogState:v,close:x,setTitleId:S,unmount:u},y],[v,x,S,u,y]),re=LP({open:v===0}),ie={ref:g,id:r,role:s,tabIndex:-1,"aria-modal":l?void 0:v===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":te,unmount:u},ae=!hL(),M=DL.None;C&&!l&&(M|=DL.RestoreFocus,M|=DL.TabLock,c&&(M|=DL.AutoFocus),ae&&(M|=DL.InitialFocus));let oe=WP();return m.createElement(YI,null,m.createElement(tL,{force:!0},m.createElement(pL,null,m.createElement(nR.Provider,{value:ne},m.createElement(fL,{target:h},m.createElement(tL,{force:!1},m.createElement(j,{slot:re},m.createElement(T,null,m.createElement(AL,{initialFocus:o,initialFocusFallback:h,containers:O,features:M},m.createElement(TF,{value:x},oe({ourProps:ie,theirProps:d,slot:re,defaultTag:oR,features:sR,visible:v===0,name:`Dialog`})))))))))))}),oR=`div`,sR=HP.RenderStrategy|HP.Static;function cR(e,t){let{transition:n=!1,open:r,...i}=e,a=qI(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?m.createElement(vL,null,m.createElement(QL,{show:r,transition:n,unmount:i.unmount},m.createElement(aR,{ref:t,...i}))):m.createElement(vL,null,m.createElement(aR,{ref:t,open:r,...i}))}var lR=`div`;function uR(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=rR(`Dialog.Panel`),l=hF(t,c.panelRef),u=LP({open:o===0}),d={ref:l,id:r,onClick:IP(e=>{e.stopPropagation()})},f=i?ZL:m.Fragment,p=i?{unmount:s}:{},h=WP();return m.createElement(f,{...p},h({ourProps:d,theirProps:a,slot:u,defaultTag:lR,name:`Dialog.Panel`}))}var dR=`div`;function fR(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=rR(`Dialog.Backdrop`),o=LP({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?ZL:m.Fragment,l=n?{unmount:a}:{},u=WP();return m.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:dR,name:`Dialog.Backdrop`}))}var pR=`h2`;function mR(e,t){let n=(0,m.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=rR(`Dialog.Title`),s=hF(t);(0,m.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=LP({open:a===0}),l={ref:s,id:r};return WP()({ourProps:l,theirProps:i,slot:c,defaultTag:pR,name:`Dialog.Title`})}var hR=XP(cR),gR=XP(uR);XP(fR);var _R=XP(mR),vR=Object.assign(hR,{Panel:gR,Title:_R,Description:SF});function yR({children:e,position:t,onClose:n,isOpen:r,wide:i=!1}){let a=i?800:400,o=i?700:500,s={position:`fixed`,left:`${Math.min(t.x,typeof window<`u`?window.innerWidth-a:t.x)}px`,top:`${Math.min(t.y,typeof window<`u`?window.innerHeight-o:t.y)}px`};return(0,P.jsx)(QL,{appear:!0,show:r,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-popup-overlay`,onClose:n,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-popup-backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-popup-container`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsx)(gR,{className:`semiont-popup-panel`,style:s,"data-annotation-ui":!0,"data-wide":i?`true`:`false`,children:(0,P.jsx)(P.Fragment,{children:e})})})})]})})}function bR(e){return no(e)?{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`}:ro(e)?{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`}:io(e)?{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`}:ao(e)?{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`}:oo(e)?{stroke:`rgb(234, 88, 12)`,fill:`rgba(234, 88, 12, 0.2)`}:{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}function xR(e){return ao(e)?`Comment`:no(e)?`Highlight`:io(e)?`Assessment`:oo(e)?`Tag`:co(e)?`Resolved Reference`:ro(e)?`Unresolved Reference`:`Annotation`}function SR({annotations:e,imageWidth:t,imageHeight:n,displayWidth:r,displayHeight:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s,hoverDelayMs:c}){let l=r/t,u=i/n,{handleMouseEnter:d,handleMouseLeave:f}=(0,m.useMemo)(()=>Hu(e=>a?.client.beckon.hover(e),c),[a,c]);return(0,P.jsx)(`svg`,{className:`semiont-annotation-overlay`,style:{width:r,height:i},children:e.map(e=>{if(typeof e.target==`string`)return null;let t=Za(e.target.selector);if(!t)return null;let n=Ao(t.value);if(!n)return null;let r=e.id===o,i=e.id===s,c=bR(e),p=ro(e),m=p&&eo(e.body),h=p?m?`🔗`:`❓`:null;switch(n.type){case`rect`:{let{x:t,y:o,width:s,height:p}=n.data,m=(t+s)*l+8,g=(o+p)*u+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`rect`,{x:t*l,y:o*u,width:s*l,height:p*u,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}case`circle`:{let{cx:t,cy:o,r:s}=n.data,p=s*Math.min(l,u),m=Math.PI/4,g=t*l+p*Math.cos(m)+8,_=o*u+p*Math.sin(m)+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`circle`,{cx:t*l,cy:o*u,r:p,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:g,y:_,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}case`polygon`:{let t=n.data.points.map(e=>`${e.x*l},${e.y*u}`).join(` `),o=[...n.data.points.map(e=>({x:e.x*l,y:e.y*u,sum:e.x*l+e.y*u}))].sort((e,t)=>t.sum-e.sum),s=o[0],p=o[1],m=(s.x+p.x)/2+8,g=(s.y+p.y)/2+4;return(0,P.jsxs)(`g`,{children:[(0,P.jsx)(`title`,{children:xR(e)}),(0,P.jsx)(`polygon`,{points:t,fill:r||i?c.fill:`transparent`,stroke:c.stroke,strokeWidth:r||i?3:2,opacity:r||i?1:.7,className:`semiont-annotation-overlay__shape`,"data-hovered":r?`true`:`false`,"data-selected":i?`true`:`false`,onClick:()=>a?.client.browse.click(e.id,e.motivation),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,P.jsx)(`text`,{x:m,y:g,fontSize:`16`,className:`semiont-annotation-overlay__status-indicator`,style:{userSelect:`none`},onClick:t=>{t.stopPropagation(),a?.client.browse.click(e.id,e.motivation)},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}default:return null}})})}function CR(e){if(!e)return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`};switch(e){case`highlighting`:return{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`};case`linking`:return{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`};case`assessing`:return{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`};case`commenting`:return{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`};default:return{stroke:`rgb(156, 163, 175)`,fill:`rgba(156, 163, 175, 0.2)`}}}function wR({imageUrl:e,existingAnnotations:t=[],drawingMode:n,selectedMotivation:r,session:i,hoveredAnnotationId:a,selectedAnnotationId:o}){let{hoverDelayMs:s}=dE(),c=(0,m.useRef)(null),l=(0,m.useRef)(null),[u,d]=(0,m.useState)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let t=new Image;t.onload=()=>{d({width:t.naturalWidth,height:t.naturalHeight})},t.src=e},[e]),(0,m.useEffect)(()=>{let e=()=>{l.current&&p({width:l.current.clientWidth,height:l.current.clientHeight})};e();let t=null;try{t=new ResizeObserver(e),l.current&&t.observe(l.current)}catch{console.warn(`ResizeObserver not supported, falling back to window resize listener`),window.addEventListener(`resize`,e)}return()=>{t?t.disconnect():window.removeEventListener(`resize`,e)}},[]);let x=(0,m.useCallback)(e=>{if(!l.current)return null;let t=l.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},[]);return(0,P.jsxs)(`div`,{ref:c,className:`semiont-svg-drawing-canvas`,onMouseDown:(0,m.useCallback)(e=>{if(!n)return;let t=x(e);t&&(g(!0),v(t),b(t))},[n,x]),onMouseMove:(0,m.useCallback)(e=>{if(!h||!_)return;let t=x(e);t&&b(t)},[h,_,x]),onMouseUp:(0,m.useCallback)(e=>{if(!h||!_||!n)return;let a=x(e);if(!a||!f||!u)return;if(Math.sqrt((a.x-_.x)**2+(a.y-_.y)**2)<10){if(t.length>0){let e=t.find(e=>{if(typeof e.target==`string`)return!1;let t=e.target.selector;if(!t)return!1;let n=(Array.isArray(t)?t:[t]).find(e=>e.type===`SvgSelector`);if(!n||n.type!==`SvgSelector`)return!1;let r=Ao(n.value);if(!r)return!1;let i=f.width/u.width,o=f.height/u.height;if(r.type===`rect`){let{x:e,y:t,width:n,height:s}=r.data,c=e*i,l=t*o,u=n*i,d=s*o;return a.x>=c&&a.x<=c+u&&a.y>=l&&a.y<=l+d}return!1});if(e){i?.client.browse.click(e.id,e.motivation),g(!1),v(null),b(null);return}}g(!1),v(null),b(null);return}let o;switch(n){case`circle`:o=ko(_,Math.sqrt((a.x-_.x)**2+(a.y-_.y)**2));break;case`polygon`:{let e=(_.x+a.x)/2,t=(_.y+a.y)/2,n=Math.abs(a.x-_.x)/2,r=Math.abs(a.y-_.y)/2;o=Oo([{x:e,y:t-r},{x:e+n,y:t},{x:e,y:t+r},{x:e-n,y:t}]);break}default:o=Do(_,a);break}let s=jo(o,f.width,f.height,u.width,u.height);i&&r&&i.client.mark.request({type:`SvgSelector`,value:s},r),g(!1),v(null),b(null)},[h,_,n,f,u,x,r,t]),onMouseLeave:(0,m.useCallback)(()=>{h&&(g(!1),v(null),b(null))},[h]),"data-drawing-mode":n||`none`,children:[(0,P.jsx)(`img`,{ref:l,src:e,alt:`Annotatable content`,className:`semiont-svg-drawing-canvas__image`,draggable:!1}),f&&u&&(0,P.jsx)(`div`,{className:`semiont-svg-drawing-canvas__overlay-container`,children:(0,P.jsxs)(`div`,{className:`semiont-svg-drawing-canvas__overlay`,style:{width:f.width,height:f.height},children:[(0,P.jsx)(SR,{annotations:t,imageWidth:u.width,imageHeight:u.height,displayWidth:f.width,displayHeight:f.height,hoverDelayMs:s,...i&&{session:i},...a!==void 0&&{hoveredAnnotationId:a},...o!==void 0&&{selectedAnnotationId:o}}),h&&_&&y&&(()=>{let e=CR(r||null);return(0,P.jsxs)(`svg`,{className:`semiont-svg-drawing-canvas__preview`,style:{width:f.width,height:f.height},children:[n===`circle`&&(()=>{let t=Math.sqrt((y.x-_.x)**2+(y.y-_.y)**2);return(0,P.jsx)(`circle`,{cx:_.x,cy:_.y,r:t,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),n===`polygon`&&(()=>{let t=(_.x+y.x)/2,n=(_.y+y.y)/2,r=Math.abs(y.x-_.x)/2,i=Math.abs(y.y-_.y)/2;return(0,P.jsx)(`polygon`,{points:[{x:t,y:n-i},{x:t+r,y:n},{x:t,y:n+i},{x:t-r,y:n}].map(e=>`${e.x},${e.y}`).join(` `),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),n===`rectangle`&&(0,P.jsx)(`rect`,{x:Math.min(_.x,y.x),y:Math.min(_.y,y.y),width:Math.abs(y.x-_.x),height:Math.abs(y.y-_.y),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})]})})()]})})]})}var TR=[{titleKey:`navigationTitle`,shortcuts:[{keys:[`⌘K`,`Ctrl K`],descriptionKey:`navOpenSearch`},{keys:[`/`],descriptionKey:`navOpenSearchAlt`},{keys:[`⌘N`,`Ctrl N`],descriptionKey:`navCreateResource`},{keys:[`Esc Esc`],descriptionKey:`navCloseOverlays`},{keys:[`?`],descriptionKey:`navShowHelp`}]},{titleKey:`sidebarTitle`,shortcuts:[{keys:[`Click <`],descriptionKey:`sidebarCollapse`},{keys:[`Click ☰`],descriptionKey:`sidebarExpand`},{keys:[`Space`],descriptionKey:`sidebarPickup`},{keys:[`↑`,`↓`],descriptionKey:`sidebarMove`},{keys:[`Space`],descriptionKey:`sidebarDrop`},{keys:[`Esc`],descriptionKey:`sidebarCancel`}]},{titleKey:`annotationsTitle`,shortcuts:[{keys:[`H`],descriptionKey:`annotHighlight`},{keys:[`R`],descriptionKey:`annotReference`},{keys:[`Delete`],descriptionKey:`annotDelete`},{keys:[`Tab`],descriptionKey:`annotNavigate`},{keys:[`Shift Tab`],descriptionKey:`annotNavigateBack`}]},{titleKey:`listsTitle`,shortcuts:[{keys:[`←`,`→`],descriptionKey:`listsFilterNav`},{keys:[`↑`,`↓`,`←`,`→`],descriptionKey:`listsGridNav`},{keys:[`Home`],descriptionKey:`listsJumpFirst`},{keys:[`End`],descriptionKey:`listsJumpLast`}]},{titleKey:`searchModalTitle`,shortcuts:[{keys:[`↑`,`↓`],descriptionKey:`searchNav`},{keys:[`Enter`],descriptionKey:`searchSelect`},{keys:[`Esc`],descriptionKey:`searchClose`}]},{titleKey:`modalTitle`,shortcuts:[{keys:[`Esc`],descriptionKey:`modalClose`},{keys:[`Tab`],descriptionKey:`modalNavForward`},{keys:[`Shift Tab`],descriptionKey:`modalNavBackward`},{keys:[`Enter`],descriptionKey:`modalActivate`},{keys:[`Space`],descriptionKey:`modalActivate`}]},{titleKey:`accessibilityTitle`,shortcuts:[{keys:[`Tab`],descriptionKey:`a11ySkipLinks`},{keys:[`Enter`],descriptionKey:`a11yFollowLink`}]}];function ER({isOpen:e,onClose:t}){let n=hh(`KeyboardShortcuts`),r=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;return(0,P.jsx)(QL,{appear:!0,show:e,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:t,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--large`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__header`,children:(0,P.jsxs)(`div`,{className:`semiont-modal__header-content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title`,children:n(`title`)}),(0,P.jsx)(`button`,{onClick:t,"aria-label":n(`closeDialog`),className:`semiont-modal__close`,children:(0,P.jsx)(`svg`,{className:`semiont-modal__close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}),(0,P.jsxs)(`div`,{className:`semiont-modal__body`,children:[(0,P.jsx)(`div`,{className:`semiont-shortcuts`,children:TR.map(e=>(0,P.jsxs)(`div`,{className:`semiont-shortcuts__group`,children:[(0,P.jsx)(`h3`,{className:`semiont-shortcuts__group-title`,children:n(e.titleKey)}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__list`,children:e.shortcuts.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-shortcuts__item`,children:[(0,P.jsx)(`span`,{className:`semiont-shortcuts__description`,children:n(e.descriptionKey)}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__keys`,children:e.keys.map((e,t)=>e.includes(`⌘`)&&!r||e.includes(`Ctrl`)&&r?null:(0,P.jsxs)(m.Fragment,{children:[t>0&&!e.includes(`⌘`)&&!e.includes(`Ctrl`)&&(0,P.jsx)(`span`,{className:`semiont-shortcuts__separator`,children:n(`or`)}),(0,P.jsx)(`kbd`,{className:`semiont-shortcuts__key`,children:e})]},t))})]},t))})]},e.titleKey))}),(0,P.jsx)(`div`,{className:`semiont-shortcuts__note`,children:(0,P.jsx)(`p`,{className:`semiont-shortcuts__note-text`,children:n(r?`macNote`:`windowsNote`)})})]}),(0,P.jsx)(`div`,{className:`semiont-modal__footer`,children:(0,P.jsxs)(`div`,{className:`semiont-modal__footer-content`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__hint`,children:n(`footerHint`,{key:`?`}).split(`?`).map((e,t,n)=>(0,P.jsxs)(m.Fragment,{children:[e,t<n.length-1&&(0,P.jsx)(`kbd`,{className:`semiont-modal__hint-key`,children:`?`})]},t))}),(0,P.jsx)(`button`,{onClick:t,className:`semiont-button semiont-button--secondary`,children:n(`close`)})]})})]})})})})]})})}function DR(){let e=K(R().activeSignals$),t=K(e?.permissionDeniedAt$)??null,n=K(e?.permissionDeniedMessage$)??null,r=()=>e?.acknowledgePermissionDenied(),i=t!==null,a=n??`You do not have permission to perform this action.`,o=()=>{r(),window.history.back()};return(0,P.jsx)(QL,{appear:!0,show:i,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-modal__icon`,children:(0,P.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-amber-600, #d97706)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})})}),(0,P.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Access Denied`}),(0,P.jsx)(`p`,{className:`semiont-modal__description`,children:a})]}),(0,P.jsxs)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md, 0.375rem)`,border:`1px solid var(--semiont-border-primary)`,fontSize:`var(--semiont-text-sm, 0.875rem)`,marginBottom:`1rem`},children:[(0,P.jsx)(`p`,{style:{color:`var(--semiont-text-secondary)`,marginBottom:`0.5rem`},children:`This could be because:`}),(0,P.jsxs)(`ul`,{style:{listStyle:`disc`,listStylePosition:`inside`,color:`var(--semiont-text-tertiary)`,display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,P.jsx)(`li`,{children:`You don't have the required permissions`}),(0,P.jsx)(`li`,{children:`The resource is restricted to specific users or teams`}),(0,P.jsx)(`li`,{children:`Your account type doesn't include this feature`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--primary semiont-button--flex`,children:`Go Back`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/`},className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`})]}),(0,P.jsx)(`div`,{className:`semiont-modal__actions`,style:{marginTop:`0.5rem`,paddingTop:`0.5rem`,borderTop:`1px solid var(--semiont-border-primary)`},children:(0,P.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},className:`semiont-button--secondary semiont-button--flex`,style:{fontSize:`var(--semiont-text-sm, 0.875rem)`},children:`Switch Account`})})]})})})})]})})}function OR(){let e=K(R().activeSignals$),t=K(e?.sessionExpiredAt$)??null,n=K(e?.sessionExpiredMessage$)??null,r=()=>e?.acknowledgeSessionExpired(),i=t!==null,a=()=>{r(),window.location.href=`/auth/connect?callbackUrl=${encodeURIComponent(window.location.pathname)}`},o=()=>{r(),window.location.href=`/`};return(0,P.jsx)(QL,{appear:!0,show:i,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-modal__container`,children:(0,P.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,P.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-modal__icon`,style:{background:`linear-gradient(to bottom right, var(--semiont-color-red-100, #fee2e2), var(--semiont-color-red-300, #fca5a5))`},children:(0,P.jsx)(`svg`,{style:{width:`1.5rem`,height:`1.5rem`,color:`var(--semiont-color-red-600, #dc2626)`},fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})})}),(0,P.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,P.jsx)(_R,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Session Expired`}),(0,P.jsx)(`p`,{className:`semiont-modal__description`,children:n??`Your session has expired for security reasons. Please sign in again to continue working.`})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`}),(0,P.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button--primary semiont-button--flex`,children:`Sign In Again`})]})]})})})})]})})}function kR(e,t){if(!e)return[{exact:``,start:0,end:0}];let n=bo(e),r=t.map(t=>{let r=to(t.target),i=Xa(r),a=r?fo(r):null,o;return a&&(o=So(e,a.exact,a.prefix,a.suffix,i?.start,n)),{annotation:t,start:o?.start??i?.start??0,end:o?.end??i?.end??0}}).filter(t=>t.start>=0&&t.end<=e.length&&t.start<t.end).sort((e,t)=>e.start-t.start);if(r.length===0)return[{exact:e,start:0,end:e.length}];let i=[],a=0;for(let{annotation:t,start:n,end:o}of r)n<a||(n>a&&i.push({exact:e.slice(a,n),start:a,end:n}),i.push({exact:e.slice(n,o),annotation:t,start:n,end:o}),a=o);return a<e.length&&i.push({exact:e.slice(a),start:a,end:e.length}),i}function AR(e,t,n,r){if(!t||n<0||r<=n||r>e.length)return null;let i=Mo(e,n,r);return[{type:`TextPositionSelector`,start:n,end:r},{type:`TextQuoteSelector`,exact:t,...i.prefix&&{prefix:i.prefix},...i.suffix&&{suffix:i.suffix}}]}function jR(e,t){let n=e.indexOf(t);return n===-1?null:{start:n,end:n+t.length}}var MR=(0,m.lazy)(()=>b(()=>import(`./PdfAnnotationCanvas.client-CN3C3S55-DZ2osbg-.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([2,3,4,5])));function NR({content:e,mimeType:t=`text/plain`,resourceUri:n,annotations:r,uiState:i,onUIStateChange:a,enableWidgets:o=!1,getTargetResourceName:s,generatingReferenceId:c,showLineNumbers:l=!1,hoverDelayMs:u=150,annotateMode:d}){let{newAnnotationIds:f}=jE(),p=(0,m.useRef)(null),h=K(R().activeSession$),g=Ro(t),{highlights:_,references:v,assessments:y,comments:b,tags:x}=r,S=[..._,...v,...y,...b,...x],C=kR(e,S),{selectedMotivation:w,selectedClick:T,selectedShape:E,hoveredAnnotationId:D,scrollToAnnotationId:O}=i,k=(0,m.useRef)(a);switch(k.current=a,SE({"mark:selection-changed":(0,m.useCallback)(({motivation:e})=>{k.current?.({selectedMotivation:e})},[]),"mark:click-changed":(0,m.useCallback)(({action:e})=>{k.current?.({selectedClick:e})},[]),"mark:shape-changed":(0,m.useCallback)(({shape:e})=>{k.current?.({selectedShape:e})},[]),"beckon:hover":(0,m.useCallback)(({annotationId:e})=>{k.current?.({hoveredAnnotationId:e})},[])}),(0,m.useEffect)(()=>{let t=p.current;if(!t)return;let n=!1,r=e=>{let t=e.target;n=!!t.closest(`[data-annotation-id]`),t.closest(`[data-annotation-ui]`)},i=r=>{let i=r.target;if(i.closest(`.semiont-pdf-annotation-canvas`)||i.closest(`.semiont-svg-drawing-canvas`))return;let a=window.getSelection();if(!a||a.isCollapsed||!a.toString()){n=!1;return}if(n){n=!1;return}n=!1;let o=a.getRangeAt(0),s=a.toString(),c=t.querySelector(`.codemirror-renderer`)?.__cmView,l,u;if(!c||!c.posAtDOM){let t=jR(e,s);if(!t)return;l=t.start,u=t.end}else l=c.posAtDOM(o.startContainer,o.startOffset),u=l+s.length;if(l>=0&&w){let t=AR(e,s,l,u);if(!t)return;h?.client.mark.request(t,w),a.removeAllRanges()}};return t.addEventListener(`mouseup`,i),t.addEventListener(`mousedown`,r),()=>{t.removeEventListener(`mouseup`,i),t.removeEventListener(`mousedown`,r)}},[w,e]),g){case`text`:return(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`text`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:(0,P.jsx)(WN,{content:e,segments:C,editable:!1,newAnnotationIds:f,...D!==void 0&&{hoveredAnnotationId:D},...O!==void 0&&{scrollToAnnotationId:O},sourceView:!0,showLineNumbers:l,hoverDelayMs:u,enableWidgets:o,session:h,...s&&{getTargetResourceName:s},...c!==void 0&&{generatingReferenceId:c}})})]});case`image`:return Lo(t)?(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`pdf`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,showShapeGroup:!0,selectedShape:E,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,P.jsx)(m.Suspense,{fallback:(0,P.jsx)(`div`,{className:`semiont-annotate-view__loading`,children:`Loading PDF viewer...`}),children:(0,P.jsx)(MR,{pdfUrl:e,existingAnnotations:S,drawingMode:w?E:null,selectedMotivation:w,session:h,hoveredAnnotationId:D||null,hoverDelayMs:u})})})]}):(0,P.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":`image`,ref:p,children:[(0,P.jsx)(eP,{selectedMotivation:w,selectedClick:T,showShapeGroup:!0,selectedShape:E,mediaType:t,annotateMode:d,annotators:Ih}),(0,P.jsx)(`div`,{className:`semiont-annotate-view__content`,children:e&&(0,P.jsx)(wR,{imageUrl:e,existingAnnotations:S,drawingMode:w?E:null,selectedMotivation:w,session:h,hoveredAnnotationId:D||null,hoverDelayMs:u})})]});default:return(0,P.jsx)(`div`,{ref:p,className:`semiont-annotate-view semiont-annotate-view--unsupported`,"data-mime-type":`unsupported`,children:(0,P.jsxs)(`div`,{className:`semiont-annotate-view__empty`,children:[(0,P.jsxs)(`p`,{className:`semiont-annotate-view__empty-message`,children:[`Annotation not supported for `,t]}),n&&(0,P.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})}}function PR(e){if(!e.startsWith(`did:`))return e;let t=e.match(/^did:web:system:(.+)$/);if(t){let e=t[1];return e.charAt(0).toUpperCase()+e.slice(1)}let n=e.match(/^did:web:[^:]+:users:(.+)$/);return n?decodeURIComponent(n[1]):e}function FR(e,t,n){switch(e){case`yield:created`:return t(`resourceCreated`);case`yield:cloned`:return t(`resourceCloned`);case`mark:archived`:return t(`resourceArchived`);case`mark:unarchived`:return t(`resourceUnarchived`);case`mark:added`:{let e=n?.annotation?.motivation;return t(e===`highlighting`?`highlightAdded`:e===`linking`?`referenceCreated`:e===`assessing`?`assessmentAdded`:`annotationAdded`)}case`mark:removed`:return t(`annotationRemoved`);case`mark:body-updated`:return t(`annotationBodyUpdated`);case`mark:entity-tag-added`:return t(`entitytagAdded`);case`mark:entity-tag-removed`:return t(`entitytagRemoved`);case`job:completed`:case`job:started`:case`job:progress`:case`job:failed`:return t(`jobEvent`);case`yield:representation-added`:case`yield:representation-removed`:return t(`representationEvent`);default:return e}}function IR(e,t){switch(e){case`yield:created`:case`yield:cloned`:case`mark:archived`:case`mark:unarchived`:return`📄`;case`mark:added`:{let e=t?.annotation?.motivation;return e===`highlighting`?Ih.highlight.iconEmoji||`📝`:e===`linking`?Ih.reference.iconEmoji||`📝`:e===`assessing`&&Ih.assessment.iconEmoji||`📝`}case`mark:removed`:return`🗑️`;case`mark:body-updated`:return`✏️`;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return`🏷️`;case`job:completed`:return`🔗`;case`job:started`:case`job:progress`:return`⚙️`;case`job:failed`:return`❌`;case`yield:representation-added`:case`yield:representation-removed`:return`📄`;default:return`📝`}}function LR(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`justNow`):i<60?t(`minutesAgo`,{count:i}):a<24?t(`hoursAgo`,{count:a}):o<7?t(`daysAgo`,{count:o}):n.toLocaleDateString()}function RR(e,t=50){let n=e.trim();return n.length>t?n.substring(0,t)+`...`:n}function zR(e,t,n){let r=e,i=r.payload;switch(r.type){case`yield:created`:case`yield:cloned`:return{exact:i.name,isQuoted:!1,isTag:!1};case`mark:body-updated`:{let e=t.find(e=>e.id.endsWith(`/annotations/${i.annotationId}`));if(e?.target)try{let t=lo(to(e.target));if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}catch{}return null}case`mark:removed`:{let e=n.find(e=>e.type===`mark:added`&&e.payload.annotation.id.endsWith(`/annotations/${i.annotationId}`));if(e&&e.type===`mark:added`)try{let t=e.payload.annotation.target;if(typeof t!=`string`&&t.selector){let e=lo(t.selector);if(e)return{exact:RR(e),isQuoted:!0,isTag:!1}}}catch{}return null}case`mark:added`:try{let e=i.annotation.target;if(typeof e!=`string`&&e.selector){let t=lo(e.selector);if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}}catch{}return null;case`mark:entity-tag-added`:case`mark:entity-tag-removed`:return{exact:i.entityType,isQuoted:!1,isTag:!0};case`job:completed`:if(i.annotationUri){let e=t.find(e=>e.id===i.annotationUri);if(e?.target)try{let t=lo(to(e.target));if(t)return{exact:RR(t),isQuoted:!0,isTag:!1}}catch{}}return null;case`job:started`:case`job:progress`:case`job:failed`:case`yield:representation-added`:case`yield:representation-removed`:return null;default:return null}}function BR(e){let t=e,n=t.payload;if(t.type===`mark:added`){let e=n.annotation.motivation,t=n.annotation.body;if(e===`linking`&&t&&`entityTypes`in t)return t.entityTypes??[]}return[]}function VR(e){let t=e,n=t.payload;return t.type===`yield:created`?{type:`created`,userId:t.userId,metadata:void 0}:t.type===`yield:cloned`?{type:`cloned`,userId:t.userId,sourceDocId:n.parentResourceId,parentResourceId:n.parentResourceId,metadata:void 0}:null}function HR({event:e,annotations:t,allEvents:n,isRelated:r,t:i,Link:a,routes:o,onEventRef:s,onEventClick:c,onEventHover:l}){let u=zR(e,t,n),d=Ha(e),f=VR(e),p=BR(e),h=(0,m.useRef)(null),g=(0,m.useRef)(l);(0,m.useEffect)(()=>{g.current=l});let _=(0,m.useCallback)(()=>{!d||!g.current||(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{g.current?.(d)},300))},[d]),v=(0,m.useCallback)(()=>{h.current&&=(clearTimeout(h.current),null),g.current&&g.current(null)},[]);return(0,P.jsxs)(d?`button`:`div`,{ref:e=>{s&&s(d,e)},...d?{type:`button`,onClick:()=>c?.(d),"aria-label":i(`viewAnnotation`,{content:u?.exact||FR(e.type,i)}),className:`semiont-history-event`,"data-related":r?`true`:`false`,"data-interactive":`true`}:{className:`semiont-history-event`,"data-related":r?`true`:`false`},children:[(0,P.jsxs)(`div`,{className:`semiont-history-event__content`,children:[(0,P.jsx)(`span`,{className:`semiont-history-event__emoji`,onMouseEnter:_,onMouseLeave:v,children:IR(e.type,e.payload)}),u?u.isTag?(0,P.jsx)(`span`,{className:`semiont-history-event__tag`,children:u.exact}):u.isQuoted?(0,P.jsxs)(`span`,{className:`semiont-history-event__text semiont-history-event__text--quoted`,children:[`“`,u.exact,`”`]}):(0,P.jsx)(`span`,{className:`semiont-history-event__text`,children:u.exact}):(0,P.jsx)(`span`,{className:`semiont-history-event__text`,children:FR(e.type,i,e.payload)}),e.userId&&(0,P.jsx)(`span`,{className:`semiont-history-event__user`,children:PR(e.userId)}),(0,P.jsx)(`span`,{className:`semiont-history-event__timestamp`,children:LR(e.timestamp,i)})]}),p.length>0&&(0,P.jsx)(`div`,{className:`semiont-history-event__entity-types`,children:p.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--small`,"data-variant":`blue`,children:e},e))}),f&&(0,P.jsxs)(`div`,{className:`semiont-history-event__details`,children:[(0,P.jsxs)(`span`,{className:`semiont-history-event__detail`,children:[i(`user`),`: `,(0,P.jsx)(`span`,{className:`semiont-history-event__detail-value`,children:f.userId?PR(f.userId):``})]}),f.type===`cloned`&&f.sourceDocId&&(0,P.jsx)(a,{href:o.resourceDetail(f.sourceDocId),className:`semiont-history-event__link`,onClick:e=>e.stopPropagation(),children:i(`viewOriginal`)})]})]})}function UR({rUri:e,hoveredAnnotationId:t,onEventHover:n,onEventClick:r,Link:i,routes:a}){let o=hh(`AnnotationHistory`),s=K(R().activeSession$)?.client,c=K(s?.browse.events(e)),l=K(s?.browse.annotations(e)),u=c===void 0,d=l??[],f=(0,m.useRef)(new Map),p=(0,m.useRef)(null),h=c?c.filter(e=>e.type!==`job:started`&&e.type!==`job:progress`&&e.type!==`job:completed`).sort((e,t)=>e.metadata.sequenceNumber-t.metadata.sequenceNumber):[];return(0,m.useEffect)(()=>{p.current&&h.length>0&&requestAnimationFrame(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)})},[h.length]),(0,m.useEffect)(()=>{if(!t)return;let e=f.current.get(t);e&&p.current&&(e.scrollIntoView({behavior:`smooth`,block:`nearest`}),e.classList.add(`bg-blue-100`,`dark:bg-blue-900/30`),setTimeout(()=>{e.classList.remove(`bg-blue-100`,`dark:bg-blue-900/30`)},1500))},[t]),u?(0,P.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,P.jsx)(`div`,{className:`semiont-history-panel__loading`,children:o(`loading`)})]}):h.length===0?null:(0,P.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-history-panel__title`,children:o(`history`)}),(0,P.jsx)(`div`,{ref:p,className:`semiont-history-panel__list`,children:h.map(e=>(0,P.jsx)(HR,{event:e,annotations:d,allEvents:h,isRelated:t?(()=>{let n=Ha(e);return n?n===t:!1})():!1,t:o,Link:i,routes:a,onEventRef:(e,t)=>{t&&e?f.current.set(e,t):!t&&e&&f.current.delete(e)},...r&&{onEventClick:r},...n&&{onEventHover:n}},e.id))})]})}function WR(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var GR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qR={};function JR(e,t){return((t||qR).jsx?KR:GR).test(e)}var YR=/[ \t\n\f\r]/g;function XR(e){return typeof e==`object`?e.type===`text`?ZR(e.value):!1:ZR(e)}function ZR(e){return e.replace(YR,``)===``}var QR=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};QR.prototype.normal={},QR.prototype.property={},QR.prototype.space=void 0;function $R(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new QR(n,r,t)}function ez(e){return e.toLowerCase()}var tz=class{constructor(e,t){this.attribute=t,this.property=e}};tz.prototype.attribute=``,tz.prototype.booleanish=!1,tz.prototype.boolean=!1,tz.prototype.commaOrSpaceSeparated=!1,tz.prototype.commaSeparated=!1,tz.prototype.defined=!1,tz.prototype.mustUseProperty=!1,tz.prototype.number=!1,tz.prototype.overloadedBoolean=!1,tz.prototype.property=``,tz.prototype.spaceSeparated=!1,tz.prototype.space=void 0;var nz={};d(nz,{boolean:()=>X,booleanish:()=>iz,commaOrSpaceSeparated:()=>cz,commaSeparated:()=>sz,number:()=>Z,overloadedBoolean:()=>az,spaceSeparated:()=>oz});var rz=0,X=lz(),iz=lz(),az=lz(),Z=lz(),oz=lz(),sz=lz(),cz=lz();function lz(){return 2**++rz}var uz=Object.keys(nz),dz=class extends tz{constructor(e,t,n,r){let i=-1;if(super(e,t),fz(this,`space`,r),typeof n==`number`)for(;++i<uz.length;){let e=uz[i];fz(this,uz[i],(n&nz[e])===nz[e])}}};dz.prototype.defined=!0;function fz(e,t,n){n&&(e[t]=n)}function pz(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new dz(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ez(r)]=r,n[ez(a.attribute)]=r}return new QR(t,n,e.space)}var mz=pz({properties:{ariaActiveDescendant:null,ariaAtomic:iz,ariaAutoComplete:null,ariaBusy:iz,ariaChecked:iz,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:oz,ariaCurrent:null,ariaDescribedBy:oz,ariaDetails:null,ariaDisabled:iz,ariaDropEffect:oz,ariaErrorMessage:null,ariaExpanded:iz,ariaFlowTo:oz,ariaGrabbed:iz,ariaHasPopup:null,ariaHidden:iz,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oz,ariaLevel:Z,ariaLive:null,ariaModal:iz,ariaMultiLine:iz,ariaMultiSelectable:iz,ariaOrientation:null,ariaOwns:oz,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:iz,ariaReadOnly:iz,ariaRelevant:null,ariaRequired:iz,ariaRoleDescription:oz,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:iz,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function hz(e,t){return t in e?e[t]:t}function gz(e,t){return hz(e,t.toLowerCase())}var _z=pz({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:sz,acceptCharset:oz,accessKey:oz,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:oz,autoFocus:X,autoPlay:X,blocking:oz,capture:null,charSet:null,checked:X,cite:null,className:oz,cols:Z,colSpan:null,content:null,contentEditable:iz,controls:X,controlsList:oz,coords:Z|sz,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:az,draggable:iz,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:oz,height:Z,hidden:az,high:Z,href:null,hrefLang:null,htmlFor:oz,httpEquiv:oz,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:oz,itemRef:oz,itemScope:X,itemType:oz,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:oz,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:oz,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:oz,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:iz,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:iz,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oz,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:iz,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:gz}),vz=pz({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`,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:cz,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:oz,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:sz,g2:sz,glyphName:sz,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:cz,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:oz,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cz,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cz,rev:cz,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cz,requiredFeatures:cz,requiredFonts:cz,requiredFormats:cz,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:cz,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cz,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cz,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:hz}),yz=pz({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()}}),bz=pz({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:gz}),xz=pz({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Sz={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`},Cz=/[A-Z]/g,wz=/-[a-z]/g,Tz=/^data[-\w.:]+$/i;function Ez(e,t){let n=ez(t),r=t,i=tz;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Tz.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(wz,Oz);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!wz.test(e)){let n=e.replace(Cz,Dz);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=dz}return new i(r,t)}function Dz(e){return`-`+e.toLowerCase()}function Oz(e){return e.charAt(1).toUpperCase()}var kz=$R([mz,_z,yz,bz,xz],`html`),Az=$R([mz,vz,yz,bz,xz],`svg`);function jz(e){return e.join(` `).trim()}var Mz=u(jh(),1),Nz=Fz(`end`),Pz=Fz(`start`);function Fz(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 Iz(e){let t=Pz(e),n=Nz(e);if(t&&n)return{start:t,end:n}}function Lz(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?zz(e.position):`start`in e||`end`in e?zz(e):`line`in e||`column`in e?Rz(e):``}function Rz(e){return Bz(e&&e.line)+`:`+Bz(e&&e.column)}function zz(e){return Rz(e&&e.start)+`-`+Rz(e&&e.end)}function Bz(e){return e&&typeof e==`number`?e:1}var Vz=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=Lz(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}};Vz.prototype.file=``,Vz.prototype.name=``,Vz.prototype.reason=``,Vz.prototype.message=``,Vz.prototype.stack=``,Vz.prototype.column=void 0,Vz.prototype.line=void 0,Vz.prototype.ancestors=void 0,Vz.prototype.cause=void 0,Vz.prototype.fatal=void 0,Vz.prototype.place=void 0,Vz.prototype.ruleId=void 0,Vz.prototype.source=void 0;var Hz={}.hasOwnProperty,Uz=new Map,Wz=/[A-Z]/g,Gz=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Kz=new Set([`td`,`th`]),qz=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Jz(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=aB(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=iB(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`?Az:kz,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Yz(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Yz(e,t,n){if(t.type===`element`)return Xz(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Zz(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return $z(e,t,n);if(t.type===`mdxjsEsm`)return Qz(e,t);if(t.type===`root`)return eB(e,t,n);if(t.type===`text`)return tB(e,t)}function Xz(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Az,e.schema=i),e.ancestors.push(t);let a=dB(e,t.tagName,!1),o=oB(e,t),s=cB(e,t);return Gz.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!XR(e):!0})),nB(e,o,a,t),rB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zz(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)}fB(e,t.position)}function Qz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fB(e,t.position)}function $z(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Az,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:dB(e,t.name,!0),o=sB(e,t),s=cB(e,t);return nB(e,o,a,t),rB(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function eB(e,t,n){let r={};return rB(r,cB(e,t)),e.create(t,e.Fragment,r,n)}function tB(e,t){return t.value}function nB(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rB(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function iB(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 aB(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Pz(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 oB(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Hz.call(t.properties,i)){let a=lB(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Kz.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 sB(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 fB(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 fB(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function cB(e,t){let n=[],r=-1,i=e.passKeys?new Map:Uz;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=Yz(e,a,o);s!==void 0&&n.push(s)}return n}function lB(e,t,n){let r=Ez(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WR(n):jz(n)),r.property===`style`){let t=typeof n==`object`?n:uB(e,String(n));return e.stylePropertyNameCase===`css`&&(t=pB(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Sz[r.property]||r.property:r.attribute,n]}}function uB(e,t){try{return(0,Mz.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Vz("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=qz+`#cannot-parse-style-attribute`,r}}function dB(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=JR(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=JR(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Hz.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);fB(e)}function fB(e,t){let n=new Vz("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=qz+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function pB(e){let t={},n;for(n in e)Hz.call(e,n)&&(t[mB(n)]=e[n]);return t}function mB(e){let t=e.replace(Wz,hB);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function hB(e){return`-`+e.toLowerCase()}var gB={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`]},_B={};function vB(e,t){let n=t||_B;return yB(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function yB(e,t,n){if(xB(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 bB(e.children,t,n)}return Array.isArray(e)?bB(e,t,n):``}function bB(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=yB(e[i],t,n);return r.join(``)}function xB(e){return!!(e&&typeof e==`object`)}var SB={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:``,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:``,InvisibleTimes:``,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
108
108
|
`,Nfr:`𝔑`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,Not:`⫬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,Nscr:`𝒩`,Ntilde:`Ñ`,Nu:`Ν`,OElig:`Œ`,Oacute:`Ó`,Ocirc:`Ô`,Ocy:`О`,Odblac:`Ő`,Ofr:`𝔒`,Ograve:`Ò`,Omacr:`Ō`,Omega:`Ω`,Omicron:`Ο`,Oopf:`𝕆`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,Or:`⩔`,Oscr:`𝒪`,Oslash:`Ø`,Otilde:`Õ`,Otimes:`⨷`,Ouml:`Ö`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,PartialD:`∂`,Pcy:`П`,Pfr:`𝔓`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Poincareplane:`ℌ`,Popf:`ℙ`,Pr:`⪻`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Prime:`″`,Product:`∏`,Proportion:`∷`,Proportional:`∝`,Pscr:`𝒫`,Psi:`Ψ`,QUOT:`"`,Qfr:`𝔔`,Qopf:`ℚ`,Qscr:`𝒬`,RBarr:`⤐`,REG:`®`,Racute:`Ŕ`,Rang:`⟫`,Rarr:`↠`,Rarrtl:`⤖`,Rcaron:`Ř`,Rcedil:`Ŗ`,Rcy:`Р`,Re:`ℜ`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,Rfr:`ℜ`,Rho:`Ρ`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,Rightarrow:`⇒`,Ropf:`ℝ`,RoundImplies:`⥰`,Rrightarrow:`⇛`,Rscr:`ℛ`,Rsh:`↱`,RuleDelayed:`⧴`,SHCHcy:`Щ`,SHcy:`Ш`,SOFTcy:`Ь`,Sacute:`Ś`,Sc:`⪼`,Scaron:`Š`,Scedil:`Ş`,Scirc:`Ŝ`,Scy:`С`,Sfr:`𝔖`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,ShortRightArrow:`→`,ShortUpArrow:`↑`,Sigma:`Σ`,SmallCircle:`∘`,Sopf:`𝕊`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Sscr:`𝒮`,Star:`⋆`,Sub:`⋐`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Sup:`⋑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,THORN:`Þ`,TRADE:`™`,TSHcy:`Ћ`,TScy:`Ц`,Tab:` `,Tau:`Τ`,Tcaron:`Ť`,Tcedil:`Ţ`,Tcy:`Т`,Tfr:`𝔗`,Therefore:`∴`,Theta:`Θ`,ThickSpace:` `,ThinSpace:` `,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,Topf:`𝕋`,TripleDot:`⃛`,Tscr:`𝒯`,Tstrok:`Ŧ`,Uacute:`Ú`,Uarr:`↟`,Uarrocir:`⥉`,Ubrcy:`Ў`,Ubreve:`Ŭ`,Ucirc:`Û`,Ucy:`У`,Udblac:`Ű`,Ufr:`𝔘`,Ugrave:`Ù`,Umacr:`Ū`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,Uopf:`𝕌`,UpArrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,UpEquilibrium:`⥮`,UpTee:`⊥`,UpTeeArrow:`↥`,Uparrow:`⇑`,Updownarrow:`⇕`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,Upsilon:`Υ`,Uring:`Ů`,Uscr:`𝒰`,Utilde:`Ũ`,Uuml:`Ü`,VDash:`⊫`,Vbar:`⫫`,Vcy:`В`,Vdash:`⊩`,Vdashl:`⫦`,Vee:`⋁`,Verbar:`‖`,Vert:`‖`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,Vopf:`𝕍`,Vscr:`𝒱`,Vvdash:`⊪`,Wcirc:`Ŵ`,Wedge:`⋀`,Wfr:`𝔚`,Wopf:`𝕎`,Wscr:`𝒲`,Xfr:`𝔛`,Xi:`Ξ`,Xopf:`𝕏`,Xscr:`𝒳`,YAcy:`Я`,YIcy:`Ї`,YUcy:`Ю`,Yacute:`Ý`,Ycirc:`Ŷ`,Ycy:`Ы`,Yfr:`𝔜`,Yopf:`𝕐`,Yscr:`𝒴`,Yuml:`Ÿ`,ZHcy:`Ж`,Zacute:`Ź`,Zcaron:`Ž`,Zcy:`З`,Zdot:`Ż`,ZeroWidthSpace:``,Zeta:`Ζ`,Zfr:`ℨ`,Zopf:`ℤ`,Zscr:`𝒵`,aacute:`á`,abreve:`ă`,ac:`∾`,acE:`∾̳`,acd:`∿`,acirc:`â`,acute:`´`,acy:`а`,aelig:`æ`,af:``,afr:`𝔞`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,alpha:`α`,amacr:`ā`,amalg:`⨿`,amp:`&`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,aogon:`ą`,aopf:`𝕒`,ap:`≈`,apE:`⩰`,apacir:`⩯`,ape:`≊`,apid:`≋`,apos:`'`,approx:`≈`,approxeq:`≊`,aring:`å`,ascr:`𝒶`,ast:`*`,asymp:`≈`,asympeq:`≍`,atilde:`ã`,auml:`ä`,awconint:`∳`,awint:`⨑`,bNot:`⫭`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,barvee:`⊽`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,bcy:`б`,bdquo:`„`,becaus:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,beta:`β`,beth:`ℶ`,between:`≬`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bnot:`⌐`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxDL:`╗`,boxDR:`╔`,boxDl:`╖`,boxDr:`╓`,boxH:`═`,boxHD:`╦`,boxHU:`╩`,boxHd:`╤`,boxHu:`╧`,boxUL:`╝`,boxUR:`╚`,boxUl:`╜`,boxUr:`╙`,boxV:`║`,boxVH:`╬`,boxVL:`╣`,boxVR:`╠`,boxVh:`╫`,boxVl:`╢`,boxVr:`╟`,boxbox:`⧉`,boxdL:`╕`,boxdR:`╒`,boxdl:`┐`,boxdr:`┌`,boxh:`─`,boxhD:`╥`,boxhU:`╨`,boxhd:`┬`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxuL:`╛`,boxuR:`╘`,boxul:`┘`,boxur:`└`,boxv:`│`,boxvH:`╪`,boxvL:`╡`,boxvR:`╞`,boxvh:`┼`,boxvl:`┤`,boxvr:`├`,bprime:`‵`,breve:`˘`,brvbar:`¦`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,bumpeq:`≏`,cacute:`ć`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,ccaps:`⩍`,ccaron:`č`,ccedil:`ç`,ccirc:`ĉ`,ccups:`⩌`,ccupssm:`⩐`,cdot:`ċ`,cedil:`¸`,cemptyv:`⦲`,cent:`¢`,centerdot:`·`,cfr:`𝔠`,chcy:`ч`,check:`✓`,checkmark:`✓`,chi:`χ`,cir:`○`,cirE:`⧃`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,clubs:`♣`,clubsuit:`♣`,colon:`:`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,conint:`∮`,copf:`𝕔`,coprod:`∐`,copy:`©`,copysr:`℗`,crarr:`↵`,cross:`✗`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,cup:`∪`,cupbrcap:`⩈`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,dArr:`⇓`,dHar:`⥥`,dagger:`†`,daleth:`ℸ`,darr:`↓`,dash:`‐`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,dcaron:`ď`,dcy:`д`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,ddotseq:`⩷`,deg:`°`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,dfr:`𝔡`,dharl:`⇃`,dharr:`⇂`,diam:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,dopf:`𝕕`,dot:`˙`,doteq:`≐`,doteqdot:`≑`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,downarrow:`↓`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,dscr:`𝒹`,dscy:`ѕ`,dsol:`⧶`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,dzcy:`џ`,dzigrarr:`⟿`,eDDot:`⩷`,eDot:`≑`,eacute:`é`,easter:`⩮`,ecaron:`ě`,ecir:`≖`,ecirc:`ê`,ecolon:`≕`,ecy:`э`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,efr:`𝔢`,eg:`⪚`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,emacr:`ē`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,emsp13:` `,emsp14:` `,emsp:` `,eng:`ŋ`,ensp:` `,eogon:`ę`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,equals:`=`,equest:`≟`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erDot:`≓`,erarr:`⥱`,escr:`ℯ`,esdot:`≐`,esim:`≂`,eta:`η`,eth:`ð`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,expectation:`ℰ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,ffr:`𝔣`,filig:`fi`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,fopf:`𝕗`,forall:`∀`,fork:`⋔`,forkv:`⫙`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,fscr:`𝒻`,gE:`≧`,gEl:`⪌`,gacute:`ǵ`,gamma:`γ`,gammad:`ϝ`,gap:`⪆`,gbreve:`ğ`,gcirc:`ĝ`,gcy:`г`,gdot:`ġ`,ge:`≥`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,gfr:`𝔤`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,gjcy:`ѓ`,gl:`≷`,glE:`⪒`,gla:`⪥`,glj:`⪤`,gnE:`≩`,gnap:`⪊`,gnapprox:`⪊`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,gopf:`𝕘`,grave:"`",gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,hArr:`⇔`,hairsp:` `,half:`½`,hamilt:`ℋ`,hardcy:`ъ`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,hbar:`ℏ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,hfr:`𝔥`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,hopf:`𝕙`,horbar:`―`,hscr:`𝒽`,hslash:`ℏ`,hstrok:`ħ`,hybull:`⁃`,hyphen:`‐`,iacute:`í`,ic:``,icirc:`î`,icy:`и`,iecy:`е`,iexcl:`¡`,iff:`⇔`,ifr:`𝔦`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,ijlig:`ij`,imacr:`ī`,image:`ℑ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,int:`∫`,intcal:`⊺`,integers:`ℤ`,intercal:`⊺`,intlarhk:`⨗`,intprod:`⨼`,iocy:`ё`,iogon:`į`,iopf:`𝕚`,iota:`ι`,iprod:`⨼`,iquest:`¿`,iscr:`𝒾`,isin:`∈`,isinE:`⋹`,isindot:`⋵`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,itilde:`ĩ`,iukcy:`і`,iuml:`ï`,jcirc:`ĵ`,jcy:`й`,jfr:`𝔧`,jmath:`ȷ`,jopf:`𝕛`,jscr:`𝒿`,jsercy:`ј`,jukcy:`є`,kappa:`κ`,kappav:`ϰ`,kcedil:`ķ`,kcy:`к`,kfr:`𝔨`,kgreen:`ĸ`,khcy:`х`,kjcy:`ќ`,kopf:`𝕜`,kscr:`𝓀`,lAarr:`⇚`,lArr:`⇐`,lAtail:`⤛`,lBarr:`⤎`,lE:`≦`,lEg:`⪋`,lHar:`⥢`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,lambda:`λ`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,laquo:`«`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,lcaron:`ľ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,le:`≤`,leftarrow:`←`,leftarrowtail:`↢`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,leftthreetimes:`⋋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,lessgtr:`≶`,lesssim:`≲`,lfisht:`⥼`,lfloor:`⌊`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,ljcy:`љ`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,llhard:`⥫`,lltri:`◺`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnE:`≨`,lnap:`⪉`,lnapprox:`⪉`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,longleftarrow:`⟵`,longleftrightarrow:`⟷`,longmapsto:`⟼`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,lscr:`𝓁`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,lstrok:`ł`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltrPar:`⦖`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,mDDot:`∺`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,mcy:`м`,mdash:`—`,measuredangle:`∡`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,mopf:`𝕞`,mp:`∓`,mscr:`𝓂`,mstpos:`∾`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nGg:`⋙̸`,nGt:`≫⃒`,nGtv:`≫̸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nLl:`⋘̸`,nLt:`≪⃒`,nLtv:`≪̸`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,nabla:`∇`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,ncaron:`ň`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,ncy:`н`,ndash:`–`,ne:`≠`,neArr:`⇗`,nearhk:`⤤`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,nexist:`∄`,nexists:`∄`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,ngsim:`≵`,ngt:`≯`,ngtr:`≯`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,njcy:`њ`,nlArr:`⇍`,nlE:`≦̸`,nlarr:`↚`,nldr:`‥`,nle:`≰`,nleftarrow:`↚`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nlsim:`≴`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nmid:`∤`,nopf:`𝕟`,not:`¬`,notin:`∉`,notinE:`⋹̸`,notindot:`⋵̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvDash:`⊭`,nvHarr:`⤄`,nvap:`≍⃒`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwArr:`⇖`,nwarhk:`⤣`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,oS:`Ⓢ`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,ocirc:`ô`,ocy:`о`,odash:`⊝`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,oelig:`œ`,ofcir:`⦿`,ofr:`𝔬`,ogon:`˛`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,omacr:`ō`,omega:`ω`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,oopf:`𝕠`,opar:`⦷`,operp:`⦹`,oplus:`⊕`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oscr:`ℴ`,oslash:`ø`,osol:`⊘`,otilde:`õ`,otimes:`⊗`,otimesas:`⨶`,ouml:`ö`,ovbar:`⌽`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,pfr:`𝔭`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,pointint:`⨕`,popf:`𝕡`,pound:`£`,pr:`≺`,prE:`⪳`,prap:`⪷`,prcue:`≼`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,prime:`′`,primes:`ℙ`,prnE:`⪵`,prnap:`⪹`,prnsim:`⋨`,prod:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,pscr:`𝓅`,psi:`ψ`,puncsp:` `,qfr:`𝔮`,qint:`⨌`,qopf:`𝕢`,qprime:`⁗`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,quot:`"`,rAarr:`⇛`,rArr:`⇒`,rAtail:`⤜`,rBarr:`⤏`,rHar:`⥤`,race:`∽̱`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,rarrtl:`↣`,rarrw:`↝`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,rcaron:`ř`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,reg:`®`,rfisht:`⥽`,rfloor:`⌋`,rfr:`𝔯`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,rho:`ρ`,rhov:`ϱ`,rightarrow:`→`,rightarrowtail:`↣`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,rightthreetimes:`⋌`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,rsaquo:`›`,rscr:`𝓇`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,ruluhar:`⥨`,rx:`℞`,sacute:`ś`,sbquo:`‚`,sc:`≻`,scE:`⪴`,scap:`⪸`,scaron:`š`,sccue:`≽`,sce:`⪰`,scedil:`ş`,scirc:`ŝ`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,seArr:`⇘`,searhk:`⤥`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,shchcy:`щ`,shcy:`ш`,shortmid:`∣`,shortparallel:`∥`,shy:``,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,square:`□`,squarf:`▪`,squf:`▪`,srarr:`→`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,sub:`⊂`,subE:`⫅`,subdot:`⪽`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,sum:`∑`,sung:`♪`,sup1:`¹`,sup2:`²`,sup3:`³`,sup:`⊃`,supE:`⫆`,supdot:`⪾`,supdsub:`⫘`,supe:`⊇`,supedot:`⫄`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swArr:`⇙`,swarhk:`⤦`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,target:`⌖`,tau:`τ`,tbrk:`⎴`,tcaron:`ť`,tcedil:`ţ`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,tfr:`𝔱`,there4:`∴`,therefore:`∴`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,thinsp:` `,thkap:`≈`,thksim:`∼`,thorn:`þ`,tilde:`˜`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,tscr:`𝓉`,tscy:`ц`,tshcy:`ћ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,uArr:`⇑`,uHar:`⥣`,uacute:`ú`,uarr:`↑`,ubrcy:`ў`,ubreve:`ŭ`,ucirc:`û`,ucy:`у`,udarr:`⇅`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,ufr:`𝔲`,ugrave:`ù`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,umacr:`ū`,uml:`¨`,uogon:`ų`,uopf:`𝕦`,uparrow:`↑`,updownarrow:`↕`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,upsi:`υ`,upsih:`ϒ`,upsilon:`υ`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,uring:`ů`,urtri:`◹`,uscr:`𝓊`,utdot:`⋰`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,uuml:`ü`,uwangle:`⦧`,vArr:`⇕`,vBar:`⫨`,vBarv:`⫩`,vDash:`⊨`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,vcy:`в`,vdash:`⊢`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,verbar:`|`,vert:`|`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,vzigzag:`⦚`,wcirc:`ŵ`,wedbar:`⩟`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,wfr:`𝔴`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,yacute:`ý`,yacy:`я`,ycirc:`ŷ`,ycy:`ы`,yen:`¥`,yfr:`𝔶`,yicy:`ї`,yopf:`𝕪`,yscr:`𝓎`,yucy:`ю`,yuml:`ÿ`,zacute:`ź`,zcaron:`ž`,zcy:`з`,zdot:`ż`,zeetrf:`ℨ`,zeta:`ζ`,zfr:`𝔷`,zhcy:`ж`,zigrarr:`⇝`,zopf:`𝕫`,zscr:`𝓏`,zwj:``,zwnj:``},CB={}.hasOwnProperty;function wB(e){return CB.call(SB,e)?SB[e]:!1}function TB(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 EB(e,t){return e.length>0?(TB(e,e.length,0,t),e):t}var DB={}.hasOwnProperty;function OB(e){let t={},n=-1;for(;++n<e.length;)kB(t,e[n]);return t}function kB(e,t){let n;for(n in t){let r=(DB.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){DB.call(r,a)||(r[a]=[]);let e=i[a];AB(r[a],Array.isArray(e)?e:e?[e]:[])}}}function AB(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);TB(e,0,0,r)}function jB(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 MB(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var NB=UB(/[A-Za-z]/),PB=UB(/[\dA-Za-z]/),FB=UB(/[#-'*+\--9=?A-Z^-~]/);function IB(e){return e!==null&&(e<32||e===127)}var LB=UB(/\d/),RB=UB(/[\dA-Fa-f]/),zB=UB(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function BB(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var VB=UB(/\p{P}|\p{S}/u),HB=UB(/\s/);function UB(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function WB(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&PB(e.charCodeAt(n+1))&&PB(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 GB(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var KB={tokenize:qB};function qB(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GB(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);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var JB={tokenize:XB},YB={tokenize:ZB};function XB(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++;return TB(t.events,a+1,0,t.events.slice(n)),t.events.length=s,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(YB,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(YB,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);return}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);return}return Q(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++;TB(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}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 ZB(e,t,n){return GB(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function QB(e){if(e===null||BB(e)||HB(e))return 1;if(VB(e))return 2}function $B(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 eV={name:`attention`,resolveAll:tV,tokenize:nV};function tV(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};rV(d,-c),rV(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=EB(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=EB(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=EB(l,$B(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=EB(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=EB(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,TB(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function nV(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=QB(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=QB(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function rV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var iV={name:`autolink`,tokenize:aV};function aV(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 NB(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||PB(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||PB(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||IB(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):FB(t)?(e.consume(t),l):n(t)}function u(e){return PB(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||PB(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var oV={partial:!0,tokenize:sV};function sV(e,t,n){return r;function r(t){return $(t)?GB(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var cV={continuation:{tokenize:uV},exit:dV,name:`blockQuote`,tokenize:lV};function lV(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 $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function uV(e,t,n){let r=this;return i;function i(t){return $(t)?GB(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(cV,t,n)(r)}}function dV(e){e.exit(`blockQuote`)}var fV={name:`characterEscape`,tokenize:pV};function pV(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 zB(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var mV={name:`characterReference`,tokenize:hV};function hV(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=PB,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=RB,u):(e.enter(`characterReferenceValue`),a=7,o=LB,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===PB&&!wB(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 gV={partial:!0,tokenize:yV},_V={concrete:!0,name:`codeFenced`,tokenize:vV};function vV(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`),$(t)?GB(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(gV,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),GB(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(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&&$(t)?GB(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(gV,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(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`),$(t)?GB(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`),$(t)?GB(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function yV(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 bV={name:`codeIndented`,tokenize:SV},xV={partial:!0,tokenize:CV};function SV(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),GB(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Q(t)?e.attempt(xV,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function CV(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):GB(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Q(e)?i(e):n(e)}}var wV={name:`codeText`,previous:EV,resolve:TV,tokenize:DV};function TV(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 EV(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function DV(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)):Q(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||Q(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 OV=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&&kV(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),kV(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),kV(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);kV(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);kV(this.left,t.reverse())}}};function kV(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 AV(e){let t={},n=-1,r,i,a,o,s,c,l,u=new OV(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,jV(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 TB(e,0,1/0,u.slice(0)),!l}function jV(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 MV={resolve:PV,tokenize:FV},NV={partial:!0,tokenize:IV};function PV(e){return AV(e),e}function FV(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):Q(t)?e.check(NV,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 IV(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GB(e,a,`linePrefix`)}function a(i){if(i===null||Q(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 LV(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||IB(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||Q(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||BB(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||IB(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 RV(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):Q(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||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function zV(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):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GB(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(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 BV(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?GB(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var VV={name:`definition`,tokenize:UV},HV={partial:!0,tokenize:WV};function UV(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return RV.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=MB(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 BB(t)?BV(e,l)(t):l(t)}function l(t){return LV(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(HV,d,d)(t)}function d(t){return $(t)?GB(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function WV(e,t,n){return r;function r(t){return BB(t)?BV(e,i)(t):n(t)}function i(t){return zV(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?GB(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var GV={name:`hardBreakEscape`,tokenize:KV};function KV(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var qV={name:`headingAtx`,resolve:JV,tokenize:YV};function JV(e,t){let n=e.length-2,r=3,i,a;return 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&&(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`},TB(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function YV(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||BB(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?GB(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||BB(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var XV=`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(`.`),ZV=[`pre`,`script`,`style`,`textarea`],QV={concrete:!0,name:`htmlFlow`,resolveTo:tH,tokenize:nH},$V={partial:!0,tokenize:iH},eH={partial:!0,tokenize:rH};function tH(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 nH(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:ie):NB(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):NB(a)?(e.consume(a),i=4,r.interrupt?t:ie):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ie):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 NB(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||BB(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ZV.includes(l)?(i=1,r.interrupt?t(s):O(s)):XV.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||PB(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 $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||NB(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||PB(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(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):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(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||BB(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):$(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),ie):t===93&&i===5?(e.consume(t),re):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check($V,M,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(eH,A,M)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),ie):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return ZV.includes(n)?(e.consume(t),ae):O(t)}return NB(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),ie):O(t)}function ie(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),ie):O(t)}function ae(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),M(t)):(e.consume(t),ae)}function M(n){return e.exit(`htmlFlow`),t(n)}}function rH(e,t,n){let r=this;return i;function i(t){return Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function iH(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(oV,t,n)}}var aH={name:`htmlText`,tokenize:oH};function oH(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):NB(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):NB(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):Q(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(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):Q(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):Q(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return NB(t)?(e.consume(t),S):n(t)}function S(t){return t===45||PB(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,j(t)):$(t)?(e.consume(t),C):te(t)}function w(t){return t===45||PB(t)?(e.consume(t),w):t===47||t===62||BB(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||NB(t)?(e.consume(t),E):Q(t)?(o=T,j(t)):$(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||PB(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,j(t)):$(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):Q(t)?(o=O,j(t)):$(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Q(t)?(o=k,j(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||BB(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||BB(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return $(t)?GB(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var sH={name:`labelEnd`,resolveAll:dH,resolveTo:fH,tokenize:pH},cH={tokenize:mH},lH={tokenize:hH},uH={tokenize:gH};function dH(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&&TB(e,0,e.length,n),e}function fH(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=EB(s,e.slice(a+1,a+r+3)),s=EB(s,[[`enter`,u,t]]),s=EB(s,$B(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=EB(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=EB(s,e.slice(o+1)),s=EB(s,[[`exit`,c,t]]),TB(e,a,e.length,s),e}function pH(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(MB(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(cH,u,o?u:d)(t):t===91?e.attempt(lH,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(uH,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function mH(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 BB(t)?BV(e,a)(t):a(t)}function a(t){return t===41?u(t):LV(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return BB(t)?BV(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?zV(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return BB(t)?BV(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 hH(e,t,n){let r=this;return i;function i(t){return RV.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(MB(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function gH(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 _H={name:`labelStartImage`,resolveAll:sH.resolveAll,tokenize:vH};function vH(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var yH={name:`labelStartLink`,resolveAll:sH.resolveAll,tokenize:bH};function bH(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var xH={name:`lineEnding`,tokenize:SH};function SH(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GB(e,t,`linePrefix`)}}var CH={name:`thematicBreak`,tokenize:wH};function wH(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||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?GB(e,s,`whitespace`)(t):s(t))}}var TH={continuation:{tokenize:kH},exit:jH,name:`list`,tokenize:OH},EH={partial:!0,tokenize:MH},DH={partial:!0,tokenize:AH};function OH(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:LB(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(CH,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 LB(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(oV,r.interrupt?n:u,e.attempt(EH,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(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 kH(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(oV,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,GB(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(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(DH,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,GB(e,e.attempt(TH,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function AH(e,t,n){let r=this;return GB(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 jH(e){e.exit(this.containerState.type)}function MH(e,t,n){let r=this;return GB(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!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var NH={name:`setextUnderline`,resolveTo:PH,tokenize:FH};function PH(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function FH(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`),$(t)?GB(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var IH={tokenize:LH};function LH(e){let t=this,n=e.attempt(oV,r,e.attempt(this.parser.constructs.flowInitial,i,GB(e,e.attempt(this.parser.constructs.flow,i,e.attempt(MV,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var RH={resolveAll:HH()},zH=VH(`string`),BH=VH(`text`);function VH(e){return{resolveAll:HH(e===`text`?UH: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);return}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 HH(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 UH(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var WH={};d(WH,{attentionMarkers:()=>QH,contentInitial:()=>KH,disable:()=>$H,document:()=>GH,flow:()=>JH,flowInitial:()=>qH,insideSpan:()=>ZH,string:()=>YH,text:()=>XH});var GH={42:TH,43:TH,45:TH,48:TH,49:TH,50:TH,51:TH,52:TH,53:TH,54:TH,55:TH,56:TH,57:TH,62:cV},KH={91:VV},qH={[-2]:bV,[-1]:bV,32:bV},JH={35:qV,42:CH,45:[NH,CH],60:QV,61:NH,95:CH,96:_V,126:_V},YH={38:mV,92:fV},XH={[-5]:xH,[-4]:xH,[-3]:xH,33:_H,38:mV,42:eV,60:[iV,aH],91:yH,92:[GV,fV],93:sH,95:eV,96:wV},ZH={null:[eV,RH]},QH={null:[42,95]},$H={null:[]};function eU(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=EB(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=$B(a,l.events,l),l.events):[]}function f(e,t){return nU(p(e),t)}function p(e){return tU(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(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Q(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&&TB(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 tU(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 nU(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=`
|
|
109
109
|
`;break;case-3:o=`\r
|
|
110
110
|
`;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 rU(e){let t={constructs:OB([WH,...(e||{}).extensions||[]]),content:n(KB),defined:[],document:n(JB),flow:n(IH),lazy:{},string:n(zH),text:n(BH)};return t;function n(e){return n;function n(n){return eU(t,e,n)}}}function iU(e){for(;!AV(e););return e}var aU=/[\0\t\n\r]/g;function oU(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(aU.lastIndex=u,c=aU.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var sU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cU(e){return e.replace(sU,lU)}function lU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jB(n.slice(t?2:1),t?16:10)}return wB(n)||e}var uU={}.hasOwnProperty;function dU(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),fU(n)(iU(rU(n).document().write(oU()(e,t,!0))))}function fU(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:N,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(j),label:re,labelText:ne,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:ie,resourceTitleString:ae,resource:M,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};mU(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];uU.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||gU).call(a,void 0,e[0])}for(r.position={start:pU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:pU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;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 i=r;for(s=void 0;i--;){let t=e[i];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=i}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),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(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:pU(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||gU).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Lz({start:e.start,end:e.end})+`): it’s not open`);n.position.end=pU(e.end)}function u(){return vB(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(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 p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){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 _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=MB(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:pU(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=pU(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=pU(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){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 j(){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 ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=cU(t),n.identifier=MB(t).toLowerCase()}function re(){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 ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function M(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=MB(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jB(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=wB(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=pU(e.end)}function N(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function pU(e){return{line:e.line,column:e.column,offset:e.offset}}function mU(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?mU(e,r):hU(e,r)}}function hU(e,t){let n;for(n in t)if(uU.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`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function gU(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Lz({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lz({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Lz({start:t.start,end:t.end})+`) is still open`)}function _U(e){let t=this;t.parser=n;function n(n){return dU(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function vU(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 yU(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -132,10 +132,10 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
132
132
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
133
133
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=jK(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}LK.peek=RK;function LK(e){return e.value||``}function RK(){return`<`}zK.peek=BK;function zK(e,t,n,r){let i=OK(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 BK(){return`!`}VK.peek=HK;function VK(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=[],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 HK(){return`!`}UK.peek=WK;function UK(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)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 WK(){return"`"}function GK(e,t){let n=vB(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))}KK.peek=qK;function KK(e,t,n,r){let i=OK(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(GK(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(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:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function qK(e,t,n){return GK(e,n)?`<`:`[`}JK.peek=YK;function JK(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=[],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 YK(){return`[`}function XK(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 ZK(e){let t=XK(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 QK(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $K(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 eq(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?QK(n):XK(n),s=e.ordered?o===`.`?`)`:`.`:ZK(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),$K(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 tq(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 nq(e,t,n,r){let i=tq(n),a=n.bulletCurrent||XK(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 rq(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var iq=bW([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function aq(e,t,n,r){return(e.children.some(function(e){return iq(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oq(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sq.peek=cq;function sq(e,t,n,r){let i=oq(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=MK(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=jK(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=MK(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+jK(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function cq(e,t,n){return n.options.strong||`*`}function lq(e,t,n,r){return n.safe(e.value,r)}function uq(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 dq(e,t,n){let r=($K(n)+(n.options.ruleSpaces?` `:``)).repeat(uq(n));return n.options.ruleSpaces?r.slice(0,-1):r}var fq={blockquote:vK,break:SK,code:EK,definition:kK,emphasis:NK,hardBreak:SK,heading:IK,html:LK,image:zK,imageReference:VK,inlineCode:UK,link:KK,linkReference:JK,list:eq,listItem:nq,paragraph:rq,root:aq,strong:sq,text:lq,thematicBreak:dq};function pq(){return{enter:{table:mq,tableData:vq,tableHeader:vq,tableRow:gq},exit:{codeText:yq,table:hq,tableData:_q,tableHeader:_q,tableRow:_q}}}function mq(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 hq(e){this.exit(e),this.data.inTable=void 0}function gq(e){this.enter({type:`tableRow`,children:[]},e)}function _q(e){this.exit(e)}function vq(e){this.enter({type:`tableCell`,children:[]},e)}function yq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,bq));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function bq(e,t){return t===`|`?t:e}function xq(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
134
134
|
`,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(`
|
|
135
|
-
`))}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 hK(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=fq.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Sq(){return{exit:{taskListCheckValueChecked:wq,taskListCheckValueUnchecked:wq,paragraph:Tq}}}function Cq(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Eq}}}function wq(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Tq(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 Eq(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=fq.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 Dq(){return[NG(),rK(),cK(),pq(),Sq()]}function Oq(e){return{extensions:[PG(),iK(e),lK(),xq(e),Cq()]}}var kq={tokenize:Uq,partial:!0},Aq={tokenize:Wq,partial:!0},jq={tokenize:Gq,partial:!0},Mq={tokenize:Kq,partial:!0},Nq={tokenize:qq,partial:!0},Pq={name:`wwwAutolink`,tokenize:Vq,previous:Jq},Fq={name:`protocolAutolink`,tokenize:Hq,previous:Yq},Iq={name:`emailAutolink`,tokenize:Bq,previous:Xq},Lq={};function Rq(){return{text:Lq}}for(var zq=48;zq<123;)Lq[zq]=Iq,zq++,zq===58?zq=65:zq===91&&(zq=97);Lq[43]=Iq,Lq[45]=Iq,Lq[46]=Iq,Lq[95]=Iq,Lq[72]=[Iq,Fq],Lq[104]=[Iq,Fq],Lq[87]=[Iq,Pq],Lq[119]=[Iq,Pq];function Bq(e,t,n){let r=this,i,a;return o;function o(t){return!Zq(t)||!Xq.call(r,r.previous)||Qq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Zq(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Nq,u,l)(t):t===45||t===95||PB(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&&NB(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Vq(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Jq.call(r,r.previous)||Qq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(kq,e.attempt(Aq,e.attempt(jq,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Hq(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Yq.call(r,r.previous)&&!Qq(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(NB(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||IB(t)||BB(t)||HB(t)||VB(t)?n(t):e.attempt(Aq,e.attempt(jq,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Uq(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 Wq(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Mq,c,s)(t):t===null||BB(t)||HB(t)||t!==45&&VB(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 Gq(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(Mq,t,a)(o):o===null||BB(o)||HB(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Kq(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||BB(o)||HB(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||BB(e)||HB(e)?t(e):r(e)}function a(e){return NB(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):NB(t)?(e.consume(t),o):n(t)}}function qq(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return PB(e)?n(e):t(e)}}function Jq(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||BB(e)}function Yq(e){return!NB(e)}function Xq(e){return!(e===47||Zq(e))}function Zq(e){return e===43||e===45||e===46||e===95||PB(e)}function Qq(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 $q={tokenize:sJ,partial:!0};function eJ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:iJ,continuation:{tokenize:aJ},exit:oJ}},text:{91:{name:`gfmFootnoteCall`,tokenize:rJ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tJ,resolveTo:nJ}}}}function tJ(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=MB(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 nJ(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 rJ(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||BB(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(MB(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return BB(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 iJ(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||BB(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=MB(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return BB(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),GB(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function aJ(e,t,n){return e.check(oV,t,e.attempt($q,t,n))}function oJ(e){e.exit(`gfmFootnoteDefinition`)}function sJ(e,t,n){let r=this;return GB(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 cJ(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&&TB(o,o.length,0,$B(s,e.slice(r+1,n),t)),TB(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),TB(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=QB(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=QB(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var lJ=class{constructor(){this.map=[]}add(e,t,n){uJ(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}};function uJ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dJ(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 fJ(){return{flow:{null:{name:`table`,tokenize:pJ,resolveAll:mJ}}}}function pJ(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 e=r.events[t][1].type;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?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?GB(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||BB(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,$(t)?GB(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 $(t)?GB(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||Q(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 $(t)?GB(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(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||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?GB(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||BB(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 mJ(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 lJ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(gJ(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=hJ(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=hJ(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=hJ(f,t,o,i,n,d)):(o[0]=o[1],d=hJ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&gJ(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=dJ(t.events,n))}return e}function hJ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},_J(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=_J(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=_J(t.events,n[2]),a=_J(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({},_J(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function gJ(e,t,n,r,i){let a=[],o=_J(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 _J(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vJ={name:`tasklistCheck`,tokenize:bJ};function yJ(){return{text:{91:vJ}}}function bJ(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 BB(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 Q(r)?t(r):$(r)?e.check({tokenize:xJ},t,n)(r):n(r)}}function xJ(e,t,n){return GB(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function SJ(e){return OB([Rq(),eJ(),cJ(e),fJ(),yJ()])}var CJ={};function wJ(e){let t=this,n=e||CJ,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SJ(n)),a.push(Dq()),o.push(Oq(n))}function TJ({imageUrl:e,alt:t=`Resource image`}){return(0,P.jsx)(`div`,{className:`semiont-image-viewer`,children:(0,P.jsx)(`img`,{src:e,alt:t,className:`semiont-image-viewer__image`,style:{imageRendering:`auto`}})})}var EJ=(0,m.lazy)(()=>b(()=>import(`./PdfAnnotationCanvas.client-CN3C3S55-DsCya3j0.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([2,3,4,5]))),DJ=(0,m.memo)(function({content:e}){return(0,P.jsx)(bG,{remarkPlugins:[wJ],children:e})}),OJ=(0,m.memo)(function({content:e,mimeType:t,resourceUri:n,annotations:r,selectedClick:i=`detail`,annotateMode:a,hoverDelayMs:o=150}){let{newAnnotationIds:s}=jE(),c=K(R().activeSession$),l=(0,m.useRef)(null),u=Ro(t),{highlights:d,references:f,assessments:p,comments:h,tags:g}=r,_=(0,m.useMemo)(()=>[...d,...f,...p,...h,...g],[d,f,p,h,g]),v=(0,m.useMemo)(()=>eE(_),[_]),y=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current&&(y.current=qT(e,l.current))},[e]),(0,m.useEffect)(()=>{if(!l.current||!y.current||v.length===0)return;let e=l.current,t=JT(e);return ZT(XT(v,y.current,t)),()=>$T(e)},[v]),(0,m.useEffect)(()=>{if(!l.current||!c)return;let e=l.current,t=e=>{let t=e.target.closest(`[data-annotation-id]`);if(!t)return;let n=t.getAttribute(`data-annotation-id`),r=t.getAttribute(`data-annotation-type`);if(n&&r===`reference`){let e=_.find(e=>e.id===n);e&&c.client.browse.click(e.id,e.motivation)}},{handleMouseEnter:n,handleMouseLeave:r,cleanup:i}=Hu(e=>c.client.beckon.hover(e),o),a=e=>{let t=e.target.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`);t&&n(za(t))},u=e=>{e.target.closest(`[data-annotation-id]`)&&r()};return s&&e.querySelectorAll(`[data-annotation-id]`).forEach(e=>{let t=e.getAttribute(`data-annotation-id`);t&&s.has(t)&&e.classList.add(`annotation-sparkle`)}),e.addEventListener(`click`,t),e.addEventListener(`mouseover`,a),e.addEventListener(`mouseout`,u),()=>{e.removeEventListener(`click`,t),e.removeEventListener(`mouseover`,a),e.removeEventListener(`mouseout`,u),i()}},[e,_,s,o,c]);let b=(0,m.useCallback)((e,t=!1)=>{l.current&&DN(e,l.current,{pulse:t})},[]);switch(SE({"beckon:hover":(0,m.useCallback)(({annotationId:e})=>{b(e)},[b]),"beckon:focus":(0,m.useCallback)(({annotationId:e})=>{b(e??null,!0)},[b])}),u){case`text`:return(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`text`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(DJ,{content:e})})]});case`image`:return Lo(t)?(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`pdf`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(m.Suspense,{fallback:(0,P.jsx)(`div`,{className:`semiont-browse-view__loading`,children:`Loading PDF viewer...`}),children:(0,P.jsx)(EJ,{pdfUrl:e,existingAnnotations:_,drawingMode:null,selectedMotivation:null})})})]}):(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`image`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(TJ,{imageUrl:e,mimeType:t,alt:`Resource content`})})]});case`unsupported`:return(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view semiont-browse-view--unsupported`,"data-mime-type":`unsupported`,children:(0,P.jsxs)(`div`,{className:`semiont-browse-view__empty`,children:[(0,P.jsxs)(`p`,{className:`semiont-browse-view__empty-message`,children:[`Preview not available for `,t]}),(0,P.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})}});function kJ({resource:e,annotations:t,generatingReferenceId:n,showLineNumbers:r=!1,hoverDelayMs:i,hoveredAnnotationId:a}){let o=hh(`ResourceViewer`),s=(0,m.useRef)(null),c=R(),l=K(c.activeSession$),u=fE(),{highlights:d,references:f,assessments:p,comments:h,tags:g}=t;if(!e[`@id`])throw Error(`Resource has no @id`);let _=e[`@id`],v=(()=>{let t=e.representations;return Array.isArray(t)&&t.length>0&&t[0]?t[0].mediaType:`text/plain`})(),[y,b]=(0,m.useState)(()=>typeof window<`u`?localStorage.getItem(`annotateMode`)===`true`:!1);(0,m.useEffect)(()=>{typeof window<`u`&&localStorage.setItem(`annotateMode`,y.toString())},[y]);let x=(0,m.useCallback)(()=>{b(e=>!e)},[]),S=y?`annotate`:`browse`,C=l?.client,w=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),T=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),E=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),[D,O]=(0,m.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(`semiont-toolbar-selection`);if(e===`null`)return null;if(e&&[`linking`,`highlighting`,`assessing`,`commenting`,`tagging`].includes(e))return e}return`linking`}),[k,A]=(0,m.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(`semiont-toolbar-click`);if(e&&[`detail`,`follow`,`jsonld`,`deleting`].includes(e))return e}return`detail`}),ee=WT(v),[te,j]=(0,m.useState)(()=>GT(ee)),ne=(0,m.useCallback)(({motivation:e})=>{O(e)},[]),re=(0,m.useCallback)(({action:e})=>{A(e)},[]),ie=(0,m.useCallback)(({shape:e})=>{j(e)},[]);(0,m.useEffect)(()=>{D===null?localStorage.setItem(`semiont-toolbar-selection`,`null`):localStorage.setItem(`semiont-toolbar-selection`,D)},[D]),(0,m.useEffect)(()=>{localStorage.setItem(`semiont-toolbar-click`,k)},[k]),(0,m.useEffect)(()=>{KT(ee,te)},[ee,te]),(0,m.useEffect)(()=>{let e=GT(ee);e!==te&&j(e)},[ee]);let[ae,M]=(0,m.useState)(!1),[oe,se]=(0,m.useState)(null),[ce,le]=(0,m.useState)(null),ue=a??null,[N,de]=(0,m.useState)(null),[fe,pe]=(0,m.useState)(null),me=(0,m.useCallback)(e=>{pe(e),de(e),setTimeout(()=>pe(null),3e3)},[]),he=()=>typeof window>`u`?{x:0,y:0}:{x:Math.max(0,(window.innerWidth-800)/2),y:Math.max(0,(window.innerHeight-700)/2)},ge=(0,m.useCallback)(e=>{l?.client.mark.delete(_,e)},[l,_]),_e=(0,m.useCallback)((e,t)=>{if(Object.values(Ih).find(t=>t.matchesAnnotation(e))?.hasSidePanel){if(k===`detail`){me(e.id);return}if(k!==`deleting`&&k!==`jsonld`&&k!==`follow`)return}let n=no(e)||io(e)||ao(e)||ro(e)||oo(e);if(k===`follow`&&ro(e)){let t=$a(e.body);t&&u(`/know/resource/${t}`,{resourceId:t});return}if(k===`jsonld`&&n){se(e),M(!0);return}if(y&&k===`deleting`&&n){le({annotation:e,position:t?{x:t.clientX,y:t.clientY+10}:{x:window.innerWidth/2-150,y:window.innerHeight/2-75}});return}},[y,k,me]);SE({"mark:mode-toggled":x,"mark:added":w,"mark:removed":T,"mark:body-updated":E,"mark:selection-changed":ne,"mark:click-changed":re,"mark:shape-changed":ie,"browse:click":(0,m.useCallback)(({annotationId:e,motivation:t})=>{if(!Object.values(Ih).find(e=>e.matchesAnnotation({motivation:t}))?.hasSidePanel){let t=[...d,...f,...p,...h,...g].find(t=>t.id===e);t&&_e(t);return}if(k!==`detail`){let t=[...d,...f,...p,...h,...g].find(t=>t.id===e);t&&_e(t);return}c.emit(`panel:open`,{panel:`annotations`,scrollToAnnotationId:e,motivation:t})},[d,f,p,h,g,_e,k,l])});let ve=(0,m.useMemo)(()=>({highlights:d,references:f,assessments:p,comments:h,tags:g}),[d,f,p,h,g]),ye={selectedMotivation:D,selectedClick:k,selectedShape:te,hoveredAnnotationId:ue,scrollToAnnotationId:N},be=(0,m.useCallback)(e=>{let t=f.find(t=>$a(t.body)===e);return t?lo(to(t.target)):void 0},[f]);return(0,P.jsxs)(`div`,{ref:s,className:`semiont-resource-viewer`,children:[S===`annotate`?(0,P.jsx)(NR,{content:e.content,mimeType:v,resourceUri:e[`@id`],annotations:ve,uiState:ye,onUIStateChange:e=>{`selectedMotivation`in e&&O(e.selectedMotivation),`selectedClick`in e&&A(e.selectedClick),`selectedShape`in e&&j(e.selectedShape)},enableWidgets:!0,getTargetResourceName:be,...n!==void 0&&{generatingReferenceId:n},showLineNumbers:r,hoverDelayMs:i,annotateMode:y}):(0,P.jsx)(OJ,{content:e.content,mimeType:v,resourceUri:e[`@id`],annotations:ve,selectedClick:k,hoverDelayMs:i,annotateMode:y}),oe&&(0,P.jsx)(yR,{isOpen:ae,onClose:()=>M(!1),position:he(),wide:!0,children:(0,P.jsx)(SP,{annotation:oe,onBack:()=>{M(!1),se(null)}})}),ce&&(()=>{let e=ce.annotation,t=Object.values(Ih).find(t=>t.matchesAnnotation(e)),n=lo(to(e.target)),r=t?.iconEmoji||`📝`;return(0,P.jsx)(yR,{isOpen:!!ce,onClose:()=>le(null),position:ce.position,children:(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation`,children:[(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation__header`,children:[(0,P.jsx)(`span`,{className:`semiont-delete-confirmation__icon`,children:r}),(0,P.jsx)(`h3`,{className:`semiont-delete-confirmation__title`,children:o(`deleteConfirmationTitle`)})]}),n&&(0,P.jsx)(`div`,{className:`semiont-delete-confirmation__quote`,children:(0,P.jsxs)(`p`,{className:`semiont-delete-confirmation__text`,children:[`"`,n.length>100?n.substring(0,100)+`...`:n,`"`]})}),(0,P.jsx)(`p`,{className:`semiont-delete-confirmation__message`,children:o(`deleteConfirmationMessage`)}),(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>le(null),className:`semiont-button semiont-button--secondary`,children:o(`deleteConfirmationCancel`)}),(0,P.jsx)(`button`,{onClick:()=>{ge(ce.annotation.id),le(null)},className:`semiont-button semiont-button--danger`,children:o(`deleteConfirmationDelete`)})]})]})})})()]})}function AJ(e){if(e[`@type`]===`Software`){let t=e.provider,n=e.model;if(t&&n)return`${t} ${n}`;if(n)return n;if(t)return t}return e.name||e[`@id`]||`unknown`}function jJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function MJ(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`TextualBody`&&`value`in e&&typeof e.value==`string`}function NJ(e){return e.body?MJ(e.body)?e.body.value||null:Array.isArray(e.body)&&e.body.length>0&&e.body.find(MJ)?.value||null:null}function PJ({assessment:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e),s=NJ(e);return(0,P.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`assessment`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`assessment`,children:[`"`,o.substring(0,100),o.length>100?`...`:``,`"`]}),s&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__body`,"data-type":`assessment`,children:s}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,jJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function FJ({annotationType:e,isAssisting:t,locale:n,sourceLanguage:r,progress:i}){let a=hh(e===`highlight`?`HighlightPanel`:e===`assessment`?`AssessmentPanel`:`CommentsPanel`),o=K(R().activeSession$),[s,c]=(0,m.useState)(``),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(e===`comment`?5:e===`assessment`?4:5),[p,h]=(0,m.useState)(!0),[g,_]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let t=localStorage.getItem(`assist-section-expanded-${e}`);return t?t===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-${e}`,String(g))},[g,e]);let v=(0,m.useCallback)(()=>{let t=e===`highlight`?`highlighting`:e===`assessment`?`assessing`:`commenting`;o?.client.mark.requestAssist(t,{instructions:s.trim()||void 0,tone:(e===`comment`||e===`assessment`)&&l?l:void 0,density:(e===`comment`||e===`assessment`||e===`highlight`)&&p?d:void 0,language:e===`comment`||e===`assessment`?n:void 0,sourceLanguage:r}),c(``),u(``)},[e,s,l,p,d,n,r,o]),y=(0,m.useCallback)(()=>{o?.client.mark.dismissProgress()},[o]);return(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>_(!g),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":g,type:`button`,children:[(0,P.jsx)(`span`,{children:a(e===`highlight`?`annotateHighlights`:e===`assessment`?`annotateAssessments`:`annotateComments`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":g,children:`›`})]}),g&&(0,P.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":t&&i?`true`:`false`,"data-type":e,children:[!i&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`instructions`),` `,a(`optional`)]}),(0,P.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),className:`semiont-textarea`,rows:3,placeholder:a(`instructionsPlaceholder`),maxLength:500}),(0,P.jsxs)(`div`,{className:`semiont-form-field__char-count`,children:[s.length,`/500`]})]}),(e===`comment`||e===`assessment`)&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`toneLabel`),` `,a(`toneOptional`)]}),(0,P.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:``,children:`Default`}),e===`comment`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`option`,{value:`scholarly`,children:a(`toneScholarly`)}),(0,P.jsx)(`option`,{value:`explanatory`,children:a(`toneExplanatory`)}),(0,P.jsx)(`option`,{value:`conversational`,children:a(`toneConversational`)}),(0,P.jsx)(`option`,{value:`technical`,children:a(`toneTechnical`)})]}),e===`assessment`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`option`,{value:`analytical`,children:a(`toneAnalytical`)}),(0,P.jsx)(`option`,{value:`critical`,children:a(`toneCritical`)}),(0,P.jsx)(`option`,{value:`balanced`,children:a(`toneBalanced`)}),(0,P.jsx)(`option`,{value:`constructive`,children:a(`toneConstructive`)})]})]})]}),(e===`comment`||e===`assessment`||e===`highlight`)&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`div`,{className:`semiont-form-field__header`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label semiont-form-field__label--with-checkbox`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>h(e.target.checked),className:`semiont-checkbox`,"data-variant":e}),(0,P.jsx)(`span`,{children:a(`densityLabel`)})]}),p&&(0,P.jsxs)(`span`,{className:`semiont-form-field__info`,children:[d,` per 2000 words`]})]}),p&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{type:`range`,min:e===`comment`?`2`:`1`,max:e===`comment`?`12`:e===`assessment`?`10`:`15`,value:d,onChange:e=>f(Number(e.target.value)),className:`semiont-slider`}),(0,P.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,P.jsx)(`span`,{children:a(`densitySparse`)}),(0,P.jsx)(`span`,{children:a(`densityDense`)})]})]})]}),(0,P.jsxs)(`button`,{onClick:v,className:`semiont-button`,"data-variant":`assist`,"data-type":e,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:a(`annotate`)})]})]}),i&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":e,children:[i.requestParams&&i.requestParams.length>0&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":e,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),i.requestParams.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,P.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,P.jsx)(`span`,{children:i.message})]}),!t&&(0,P.jsx)(`button`,{onClick:y,className:`semiont-annotation-progress__close`,"aria-label":a(`closeProgress`),title:a(`closeProgress`),type:`button`,children:`×`})]})]})]})]})}function IJ({count:e,title:t}){return(0,P.jsx)(`div`,{className:`semiont-panel-header`,children:(0,P.jsxs)(`h2`,{className:`semiont-panel-header__title`,children:[(0,P.jsx)(`span`,{className:`semiont-panel-header__text`,children:t}),(0,P.jsxs)(`span`,{className:`semiont-panel-header__count`,children:[`(`,e,`)`]})]})})}function LJ(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function RJ({annotations:e,pendingAnnotation:t,isAssisting:n=!1,progress:r,locale:i,sourceLanguage:a,annotateMode:o=!0,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l}){let u=hh(`AssessmentPanel`),d=K(R().activeSession$),[f,p]=(0,m.useState)(``),[h,g]=(0,m.useState)(null),_=(0,m.useRef)(null),v=(0,m.useRef)(new Map),y=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),b=(0,m.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!s)return;let e=v.current.get(s);if(e&&_.current){let t=e.offsetTop,n=_.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;_.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,m.useEffect)(()=>{if(!l)return;let e=v.current.get(l);if(!e||!_.current)return;let t=_.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[l]),(0,m.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(d?.client.mark.cancelPending(),p(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,d]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`assessment`,count:e.length,title:u(`title`)}),t&&t.motivation===`assessing`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`assessment`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=LJ(t.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()}),(0,P.jsx)(`textarea`,{value:f,onChange:e=>p(e.target.value),className:`semiont-textarea`,rows:3,placeholder:u(`assessmentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[f.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{d?.client.mark.cancelPending(),p(``)},className:`semiont-button semiont-button--secondary`,"data-type":`assessment`,children:u(`cancel`)}),(0,P.jsx)(`button`,{onClick:()=>{if(t){let e=f.trim(),n=e?{type:`TextualBody`,value:e,purpose:`assessing`}:void 0;d?.client.mark.submit({motivation:`assessing`,selector:t.selector,...n===void 0?{}:{body:n}}),p(``)}},className:`semiont-button semiont-button--primary`,"data-type":`assessment`,children:u(`save`)})]})]})]}),(0,P.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[o&&(0,P.jsx)(FJ,{annotationType:`assessment`,isAssisting:n,locale:i,sourceLanguage:a,progress:r}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:y.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noAssessments`)}):y.map(e=>(0,P.jsx)(PJ,{assessment:e,isFocused:e.id===h,isHovered:e.id===l,ref:t=>b(e.id,t)},e.id))})]})]})}function zJ({state:e,eventCount:t,lastEventTimestamp:n,knowledgeBaseName:r}){let i=hh(`CollaborationPanel`),a=e===`open`||e===`reconnecting`||e===`initial`||e===`connecting`,o;if(!n)o=i(`noActivity`);else{let e=new Date,t=new Date(n),r=e.getTime()-t.getTime(),a=Math.floor(r/1e3),s=Math.floor(a/60),c=Math.floor(s/60);o=a<10?i(`justNow`):a<60?i(`secondsAgo`,{count:a}):s===1?i(`minuteAgo`):s<60?i(`minutesAgo`,{count:s}):c===1?i(`hourAgo`):c<24?i(`hoursAgo`,{count:c}):t.toLocaleDateString()}return(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__title`,children:i(`title`)}),r&&(0,P.jsx)(`div`,{style:{padding:`0 0.75rem 0.5rem`,fontSize:`0.8rem`,color:`var(--semiont-color-neutral-400)`},children:r}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`connectionStatus`)}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__status`,children:[(0,P.jsxs)(`span`,{className:`semiont-collaboration-panel__indicator`,children:[(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__dot`,"data-connected":a?`true`:`false`}),(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__status-text`,"data-connected":a?`true`:`false`,children:i(a?`live`:`disconnected`)})]}),a&&t>0&&(0,P.jsxs)(`span`,{className:`semiont-collaboration-panel__event-count`,children:[`(`,i(`events`,{count:t}),`)`]})]}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__details`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__label`,children:i(`lastSync`)}),` `,o]}),(0,P.jsx)(`div`,{children:i(a?`realtimeActive`:`reconnecting`)})]})]}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`sharing`)}),(0,P.jsx)(`p`,{className:`semiont-collaboration-panel__description`,children:i(`collaborationComingSoon`)})]})]})}function BJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function VJ({comment:e,isFocused:t,isHovered:n=!1,annotateMode:r=!0,ref:i}){let a=hh(`CommentsPanel`),o=K(R().activeSession$),s=uE(e.id),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(``),f=(0,m.useRef)(null);(0,m.useImperativeHandle)(i,()=>f.current);let p=so(e)||``,h=uo(e);(0,m.useEffect)(()=>{t&&f.current&&f.current.scrollIntoView({behavior:`smooth`,block:`center`})},[t]);let g=()=>{d(p),l(!0)},_=()=>{l(!1)},v=()=>{l(!1),d(``)};return(0,P.jsxs)(`div`,{ref:f,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`comment`,"data-focused":t?`true`:`false`,onClick:()=>{o?.client.browse.click(e.id,e.motivation)},...s,children:[h&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`comment`,children:[`"`,h.substring(0,100),h.length>100?`...`:``,`"`]}),c?(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__edit`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),className:`semiont-textarea`,rows:3,autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__edit-footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-entry__char-count`,children:[u.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__button-group`,children:[(0,P.jsx)(`button`,{onClick:_,className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:a(`save`)}),(0,P.jsx)(`button`,{onClick:v,className:`semiont-button semiont-button--secondary`,children:a(`cancel`)})]})]})]}):(0,P.jsx)(`div`,{className:`semiont-annotation-entry__body`,children:p}),!c&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__footer`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,BJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]}),r&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__actions`,onClick:e=>e.stopPropagation(),children:(0,P.jsx)(`button`,{onClick:g,className:`semiont-text-button`,"data-variant":`comment`,children:a(`edit`)})})]})]})}function HJ(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function UJ({annotations:e,pendingAnnotation:t,annotateMode:n=!0,isAssisting:r=!1,progress:i,locale:a,sourceLanguage:o,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l}){let u=hh(`CommentsPanel`),d=K(R().activeSession$),[f,p]=(0,m.useState)(``),[h,g]=(0,m.useState)(null),_=(0,m.useRef)(null),v=(0,m.useRef)(new Map),y=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),b=(0,m.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!s)return;let e=v.current.get(s);if(e&&_.current){let t=e.offsetTop,n=_.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;_.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,m.useEffect)(()=>{if(!l)return;let e=v.current.get(l);if(!e||!_.current)return;let t=_.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[l]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,m.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(d?.client.mark.cancelPending(),p(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,d]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`comment`,count:e.length,title:u(`title`)}),t&&t.motivation===`commenting`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`comment`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=HJ(t.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()}),(0,P.jsx)(`textarea`,{value:f,onChange:e=>p(e.target.value),className:`semiont-textarea`,rows:3,placeholder:u(`commentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[f.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{d?.client.mark.cancelPending(),p(``)},className:`semiont-button semiont-button--secondary`,"data-type":`comment`,children:u(`cancel`)}),(0,P.jsx)(`button`,{onClick:()=>{f.trim()&&t&&(d?.client.mark.submit({motivation:`commenting`,selector:t.selector,body:[{type:`TextualBody`,value:f,purpose:`commenting`}]}),p(``))},disabled:!f.trim(),className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:u(`save`)})]})]})]}),(0,P.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[n&&(0,P.jsx)(FJ,{annotationType:`comment`,isAssisting:r,locale:a,sourceLanguage:o,progress:i}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:y.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noComments`)}):y.map(e=>(0,P.jsx)(VJ,{comment:e,isFocused:e.id===h,isHovered:e.id===l,annotateMode:n,ref:t=>b(e.id,t)},e.id))})]})]})}function WJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function GJ({highlight:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e);return(0,P.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`highlight`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`highlight`,children:[`"`,o.substring(0,200),o.length>200?`...`:``,`"`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,WJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function KJ({annotations:e,pendingAnnotation:t,isAssisting:n=!1,progress:r,annotateMode:i=!0,scrollToAnnotationId:a,onScrollCompleted:o,hoveredAnnotationId:s,sourceLanguage:c}){let l=hh(`HighlightPanel`),u=K(R().activeSession$),[d,f]=(0,m.useState)(null),p=(0,m.useRef)(null),h=(0,m.useRef)(new Map),g=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),_=(0,m.useCallback)((e,t)=>{t?h.current.set(e,t):h.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!a)return;let e=h.current.get(a);if(e&&p.current){let t=e.offsetTop,n=p.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;p.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),o&&o()}},[a]),(0,m.useEffect)(()=>{if(!s)return;let e=h.current.get(s);if(!e||!p.current)return;let t=p.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[s]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{f(e),setTimeout(()=>f(null),3e3)},[])}),(0,m.useEffect)(()=>{t&&t.motivation===`highlighting`&&u?.client.mark.submit({motivation:`highlighting`,selector:t.selector})},[t,u]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`highlight`,count:e.length,title:l(`title`)}),(0,P.jsxs)(`div`,{ref:p,className:`semiont-panel__content`,children:[i&&(0,P.jsx)(FJ,{annotationType:`highlight`,isAssisting:n,progress:r,sourceLanguage:c}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:g.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:l(`noHighlights`)}):g.map(e=>(0,P.jsx)(GJ,{highlight:e,isFocused:e.id===d,isHovered:e.id===s,ref:t=>_(e.id,t)},e.id))})]})]})}function qJ({resource:e}){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),{showLineNumbers:r}=lE();return(0,m.useEffect)(()=>{if(!t.current)return;let i=document.documentElement?.classList.contains(`dark`)??!1,a=JSON.stringify(e,null,2),o=[iP(),H.editable.of(!1),p_.readOnly.of(!0)];r&&o.push(TC()),i?o.push(xP):(o.push(RT),o.push(DT(zT)));let s=new H({state:p_.create({doc:a,extensions:o}),parent:t.current});return n.current=s,()=>{s.destroy(),n.current=null}},[e,r]),(0,P.jsxs)(`div`,{className:`semiont-jsonld-panel`,children:[(0,P.jsxs)(`div`,{className:`semiont-jsonld-panel__header`,children:[(0,P.jsx)(`h3`,{className:`semiont-jsonld-panel__title`,children:`JSON-LD`}),(0,P.jsx)(`button`,{onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-button semiont-button--icon`,title:`Copy to clipboard`,children:`📋 Copy`})]}),(0,P.jsx)(`div`,{ref:t,className:`semiont-jsonld-panel__editor`})]})}function JJ(e){if(Array.isArray(e.body)){let t=[];for(let n of e.body)if(typeof n==`object`&&n&&`type`in n&&`value`in n&&`purpose`in n){let e=n.type,r=n.value,i=n.purpose;e===`TextualBody`&&i===`tagging`&&typeof r==`string`&&r.length>0&&t.push(r)}return t}return[]}function YJ(e){return e.motivation===`tagging`}function XJ(e){if(!YJ(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`tagging`);if(t&&`value`in t)return t.value}function ZJ(e){if(!YJ(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`classifying`);if(t&&`value`in t)return t.value}function QJ({reference:e,isFocused:t,isHovered:n=!1,routes:r,annotateMode:i=!0,isGenerating:a=!1,ref:o}){let s=hh(`ReferencesPanel`),c=K(R().activeSession$),l=c?.client,u=fE(),d=uE(e.id),f=uo(e)||``,p=eo(e.body),m=p?$a(e.body):null,h=JJ(e),g=to(e.target),_=Qa(g),v=Za(g),y=_?`Fragment annotation`:v?`Image annotation`:`Annotation`,b=e,x=b._resolvedDocumentName,S=b._resolvedDocumentMediaType,C=tE(S),w=()=>{m&&u(r.resourceDetail(m),{resourceId:m})},T=typeof e.target==`object`&&`source`in e.target?e.target.source:``,E=()=>{T&&m&&l&&l.bind.body(Ra(T),e.id,[{op:`remove`,item:{type:`SpecificResource`,source:m,purpose:`linking`}}]).catch(()=>{})},D=()=>{c?.client.bind.initiate({annotationId:e.id,resourceId:Ra(T),defaultTitle:f,entityTypes:h})},O=e=>{e.stopPropagation(),p?w():i&&D()},k=p||i;return(0,P.jsxs)(`div`,{ref:o,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`reference`,"data-focused":t?`true`:`false`,onClick:()=>{c?.client.browse.click(e.id,e.motivation)},...d,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,P.jsxs)(`div`,{className:`semiont-reference-icon-group`,children:[(0,P.jsx)(`button`,{className:`semiont-reference-icon${k?` semiont-reference-icon--clickable`:``}`,title:s(p?`open`:i?`resolve`:`stub`),onClick:k?O:void 0,"data-generating":!p&&a?`true`:`false`,tabIndex:k?0:-1,children:p?`🔗`:`❓`}),i&&p&&(0,P.jsx)(`button`,{className:`semiont-reference-unlink`,title:s(`unlink`),onClick:e=>{e.stopPropagation(),E()},children:`⛓️💥`})]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__content`,children:[f&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`reference`,children:[`"`,f.substring(0,100),f.length>100?`...`:``,`"`]}),!f&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__meta`,children:y}),x&&(0,P.jsx)(`div`,{className:`semiont-reference-link`,children:(0,P.jsxs)(`span`,{children:[`→ `,C,` `,x]})})]})]}),h.length>0&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__tags`,children:h.map((e,t)=>(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},t))}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function $J(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function eY({annotations:e=[],isAssisting:t,progress:n,annotateMode:r=!0,Link:i,routes:a,allEntityTypes:o,generatingReferenceId:s,referencedBy:c=[],referencedByLoading:l=!1,pendingAnnotation:u,scrollToAnnotationId:d,onScrollCompleted:f,hoveredAnnotationId:p,locale:h,sourceLanguage:g}){let _=hh(`ReferencesPanel`),v=K(R().activeSession$),[y,b]=(0,m.useState)([]),[x,S]=(0,m.useState)(null),[C,w]=(0,m.useState)([]),[T,E]=(0,m.useState)(!1),[D,O]=(0,m.useState)(null),k=(0,m.useRef)(null),[A,ee]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-reference`);return e?e===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-reference`,String(A))},[A]);let te=(0,m.useRef)(new Map),j=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),ne=(0,m.useCallback)((e,t)=>{t?te.current.set(e,t):te.current.delete(e)},[]);(0,m.useEffect)(()=>{if(!d)return;let e=te.current.get(d);if(e&&k.current){let t=e.offsetTop,n=k.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;k.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),f&&f()}else console.warn(`[ReferencesPanel] Element not found for scrollToAnnotationId:`,d)},[d]),(0,m.useEffect)(()=>{if(!p)return;let e=te.current.get(p);if(!e||!k.current)return;let t=k.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[p]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{O(e),setTimeout(()=>O(null),3e3)},[])});let re=()=>{S(null),v?.client.mark.requestAssist(`linking`,{entityTypes:y,includeDescriptiveReferences:T,language:h,sourceLanguage:g})},ie=(0,m.useRef)(!1);(0,m.useEffect)(()=>{if(t){ie.current=!1;return}!t&&!ie.current&&n?.completedEntityTypes&&(ie.current=!0,S(n.completedEntityTypes),b([]))},[t,n?.completedEntityTypes]);let ae=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,m.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&(v?.client.mark.cancelPending(),w([]))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[u,v]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`reference`,count:e.length,title:_(`title`)}),u&&u.motivation===`linking`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`reference`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=$J(u.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:_(`fragmentSelected`)})()}),o.length>0&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`p`,{className:`semiont-form-field__label`,children:_(`entityTypesOptional`)}),(0,P.jsx)(`div`,{className:`semiont-tag-selector`,children:o.map(e=>(0,P.jsx)(`button`,{onClick:()=>ae(e),className:`semiont-tag-selector__item`,"data-selected":C.includes(e)?`true`:`false`,children:e},e))})]}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{v?.client.mark.cancelPending(),w([])},className:`semiont-button semiont-button--secondary`,"data-type":`reference`,children:_(`cancel`)}),(0,P.jsxs)(`button`,{onClick:()=>{if(u){let e=C.join(`,`)||void 0;v?.client.mark.submit({motivation:`linking`,selector:u.selector,body:e?[{type:`TextualBody`,value:e,purpose:`tagging`}]:[]}),w([])}},className:`semiont-button semiont-button--primary`,"data-type":`reference`,children:[`🔗 `,_(`createReference`)]})]})})]}),(0,P.jsxs)(`div`,{ref:k,className:`semiont-panel__content`,children:[r&&(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>ee(!A),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":A,type:`button`,children:[(0,P.jsx)(`span`,{children:_(`annotateReferences`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":A,children:`›`})]}),A&&(0,P.jsxs)(P.Fragment,{children:[!t&&(0,P.jsx)(`div`,{className:`semiont-assist-widget`,"data-type":`reference`,children:(0,P.jsxs)(P.Fragment,{children:[x&&x.length>0&&(0,P.jsx)(`div`,{className:`semiont-assist-widget__log`,children:(0,P.jsx)(`div`,{className:`semiont-assist-widget__log-items`,children:x.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-assist-widget__log-item`,children:[(0,P.jsx)(`span`,{className:`semiont-assist-widget__log-check`,children:`✓`}),(0,P.jsxs)(`span`,{className:`semiont-assist-widget__log-type`,children:[e.entityType,`:`]}),(0,P.jsx)(`span`,{children:_(`found`,{count:e.foundCount})})]},t))})}),(0,P.jsxs)(`div`,{className:`semiont-assist-widget__entity-types`,children:[(0,P.jsx)(`p`,{className:`semiont-assist-widget__label`,children:_(`selectEntityTypes`)}),(0,P.jsx)(`div`,{className:`semiont-assist-widget__chips`,children:o.length>0?o.map(e=>(0,P.jsx)(`button`,{onClick:()=>{b(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":y.includes(e),"aria-label":`${y.includes(e)?_(`deselect`):_(`select`)} ${e}`,className:`semiont-chip semiont-chip--selectable`,"data-selected":y.includes(e),children:e},e)):(0,P.jsx)(`p`,{className:`semiont-assist-widget__no-types`,children:_(`noEntityTypes`)})})]}),y.length>0&&(0,P.jsx)(`p`,{className:`semiont-assist-widget__count`,children:_(`typesSelected`,{count:y.length})}),(0,P.jsxs)(`div`,{className:`semiont-assist-widget__checkbox-group`,children:[(0,P.jsxs)(`label`,{className:`semiont-assist-widget__checkbox-label`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked),className:`semiont-assist-widget__checkbox`}),(0,P.jsx)(`span`,{children:_(`includeDescriptiveReferences`)})]}),(0,P.jsx)(`p`,{className:`semiont-assist-widget__checkbox-hint`,children:_(`descriptiveReferencesTooltip`)})]}),(0,P.jsxs)(`button`,{onClick:re,disabled:y.length===0,title:_(`annotate`),className:`semiont-button`,"data-variant":`assist`,"data-type":`reference`,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:_(`annotate`)})]})]})}),t&&n&&(0,P.jsx)(GN,{progress:n,annotationType:`reference`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,P.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[_(`outgoingReferences`),` (`,j.length,`)`]})}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:j.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty-message`,children:_(`noReferences`)}):j.map(e=>(0,P.jsx)(QJ,{reference:e,isFocused:e.id===D,isHovered:e.id===p,routes:a,annotateMode:r,isGenerating:e.id===s,ref:t=>ne(e.id,t)},e.id))})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,P.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[_(`incomingReferences`),` (`,c.length,`)`,l&&(0,P.jsxs)(`span`,{className:`semiont-panel__loading-indicator`,children:[`(`,_(`loading`),`)`]})]})}),c.length>0?(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:c.map(e=>{let t=e.target.source;return(0,P.jsxs)(`div`,{className:`semiont-reference-item semiont-reference-item--incoming`,children:[(0,P.jsxs)(`div`,{className:`semiont-reference-item__header`,children:[(0,P.jsx)(`span`,{className:`semiont-reference-item__title`,children:e.resourceName||_(`untitledResource`)}),(0,P.jsx)(i,{href:a.resourceDetail(t),className:`semiont-reference-item__link`,title:_(`open`),children:`🔗`})]}),(0,P.jsxs)(`span`,{className:`semiont-reference-item__excerpt`,children:[`"`,e.target.selector?.exact||_(`noText`),`"`]})]},e.id)})}):(0,P.jsx)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:_(l?`loadingEllipsis`:`noIncomingReferences`)})]})]})]})}function tY({resourceId:e,documentEntityTypes:t,documentLocale:n,primaryMediaType:r,primaryByteSize:i,storageUri:a,isArchived:o=!1,dateCreated:s,dateModified:c,wasAttributedTo:l,wasDerivedFrom:u,generator:d}){let f=hh(`ResourceInfoPanel`),p=K(R().activeSession$),m=l?Array.isArray(l)?l:[l]:d?Array.isArray(d)?d:[d]:[];return(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__title`,children:f(`title`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`locale`)}),n?(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__value`,children:Eo(n)}):(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__value semiont-resource-info-panel__value--empty`,children:f(`notSpecified`)})]}),(r||i!==void 0)&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`representation`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[r&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`mediaType`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:r})]}),i!==void 0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`byteSize`)}),(0,P.jsxs)(`span`,{className:`semiont-resource-info-panel__value`,children:[i.toLocaleString(),` bytes`]})]}),a&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`storageUri`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:a})]})]})]}),(s||c||m.length>0||u)&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`provenance`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[s&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`createdAt`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(s).toLocaleString()})]}),c&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`modifiedAt`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(c).toLocaleString()})]}),m.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`attributedTo`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:m.map(AJ).join(`, `)})]}),u&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`derivedFrom`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:(Array.isArray(u)?u:[u]).map((e,t)=>(0,P.jsxs)(`button`,{className:`semiont-resource-info-panel__link`,onClick:()=>p?.client.browse.navigateReference(Ra(e)),children:[t>0&&`, `,e]},e))})]})]})]}),t.length>0&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`entityTypeTags`)}),(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__tag-list`,children:t.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},e))})]}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.yield.clone(),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`🔗 `,f(`clone`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`cloneDescription`)})]}),(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__action-section`,children:o?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.mark.unarchive(Ra(e)),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`📤 `,f(`unarchive`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`unarchiveDescription`)})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.mark.archive(Ra(e)),className:`semiont-resource-button semiont-resource-button--archive`,children:[`📦 `,f(`archive`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`archiveDescription`)})]})})]})}function nY({highlights:e,comments:t,assessments:n,references:r,tags:i}){let a=hh(`StatisticsPanel`),o=r.filter(e=>!eo(e.body)).length,s=r.filter(e=>eo(e.body)).length,c=new Map;r.forEach(e=>{JJ(e).forEach(e=>{c.set(e,(c.get(e)||0)+1)})});let l=Array.from(c.entries()).sort((e,t)=>t[1]-e[1]);return(0,P.jsx)(`div`,{className:`semiont-statistics-panel`,children:(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__content`,children:[(0,P.jsx)(`h2`,{className:`semiont-statistics-panel__title`,children:a(`title`)}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__list`,children:[(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`highlights`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:e.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`comments`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:t.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`assessments`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:n.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`tags`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:i.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`references`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:r.length}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitems`,children:[(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`stub`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:o})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`resolved`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:s})]})]})]}),l.length>0&&(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__entity-types`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`entityTypes`)}),(0,P.jsx)(`div`,{className:`semiont-statistics-panel__entity-list`,children:l.map(([e,t])=>(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__entity-item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__entity-name`,children:e}),(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:t})]},e))})]})]})]})})}function rY({tag:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e),s=XJ(e),c=ZJ(e),l=K((0,m.useMemo)(()=>i?.client.browse.tagSchemas()??null,[i])),u=c&&l?l.find(e=>e.id===c)??null:null;return(0,P.jsxs)(`div`,{ref:r,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`tag`,"data-focused":t?`true`:`false`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,P.jsx)(`span`,{className:`semiont-tag-badge`,"data-variant":`tag`,children:s}),u&&(0,P.jsx)(`span`,{className:`semiont-annotation-entry__meta`,children:u.name})]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`tag`,children:[`"`,o.substring(0,150),o.length>150?`...`:``,`"`]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function iY(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function aY({annotations:e,annotateMode:t=!0,isAssisting:n=!1,progress:r,pendingAnnotation:i,scrollToAnnotationId:a,onScrollCompleted:o,hoveredAnnotationId:s,locale:c,sourceLanguage:l}){let u=hh(`TaggingPanel`),d=K(R().activeSession$),f=K((0,m.useMemo)(()=>d?.client.browse.tagSchemas()??null,[d])),p=f??[],h=f!==void 0&&f.length===0,[g,_]=(0,m.useState)(``),[v,y]=(0,m.useState)(new Set);(0,m.useEffect)(()=>{!g&&p.length>0&&_(p[0].id)},[p,g]);let[b,x]=(0,m.useState)(null),S=(0,m.useRef)(null),[C,w]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-tag`);return e?e===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-tag`,String(C))},[C]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{x(e),setTimeout(()=>x(null),3e3)},[])});let T=(0,m.useRef)(new Map),E=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),D=(0,m.useCallback)((e,t)=>{t?T.current.set(e,t):T.current.delete(e)},[]);(0,m.useEffect)(()=>{if(!a)return;let e=T.current.get(a);if(e&&S.current){let t=e.offsetTop,n=S.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;S.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),o&&o()}},[a]),(0,m.useEffect)(()=>{if(!s)return;let e=T.current.get(s);if(!e||!S.current)return;let t=S.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[s]);let O=p.find(e=>e.id===g),k=e=>{_(e),y(new Set)},A=e=>{let t=new Set(v);t.has(e)?t.delete(e):t.add(e),y(t)};return(0,m.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&d?.client.mark.cancelPending()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,d]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`tag`,count:e.length,title:u(`title`)}),(0,P.jsxs)(`div`,{ref:S,className:`semiont-panel__content`,children:[i&&i.motivation===`tagging`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`tag`,children:[(0,P.jsx)(`h3`,{className:`semiont-annotation-prompt__title`,children:u(`createTagForSelection`)}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(0,P.jsx)(`p`,{className:`semiont-annotation-prompt__text`,children:(()=>{let e=iY(i.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()})}),h&&(0,P.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:u(`noSchemas`)}),!h&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectSchema`)}),(0,P.jsx)(`select`,{value:g,onChange:e=>k(e.target.value),className:`semiont-select`,children:p.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),O&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectCategory`)}),(0,P.jsxs)(`select`,{className:`semiont-select`,onChange:e=>{e.target.value&&i&&d?.client.mark.submit({motivation:`tagging`,selector:i.selector,body:[{type:`TextualBody`,value:e.target.value,purpose:`tagging`},{type:`TextualBody`,value:g,purpose:`classifying`}]})},defaultValue:``,children:[(0,P.jsx)(`option`,{value:``,children:u(`chooseCategory`)}),O.tags.map(e=>(0,P.jsx)(`option`,{value:e.name,children:e.name},e.name))]})]}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,P.jsx)(`button`,{onClick:()=>d?.client.mark.cancelPending(),className:`semiont-button semiont-button--secondary`,"data-type":`tag`,children:u(`cancel`)})})]}),t&&(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>w(!C),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":C,type:`button`,children:[(0,P.jsx)(`span`,{children:u(`annotateTags`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":C,children:`›`})]}),C&&(0,P.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":n&&r?`true`:`false`,"data-type":`tag`,children:[!n&&!r&&(0,P.jsxs)(P.Fragment,{children:[h&&(0,P.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:u(`noSchemas`)}),!h&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectSchema`)}),(0,P.jsx)(`select`,{value:g,onChange:e=>k(e.target.value),className:`semiont-select`,children:p.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))}),O&&(0,P.jsx)(`p`,{className:`semiont-form__help`,children:O.description})]}),O&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectCategories`)}),(0,P.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`,marginBottom:`0.75rem`},children:[(0,P.jsx)(`button`,{onClick:()=>{O&&y(new Set(O.tags.map(e=>e.name)))},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:u(`selectAll`)}),(0,P.jsx)(`button`,{onClick:()=>{y(new Set)},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:u(`deselectAll`)})]}),(0,P.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`0.75rem`},children:O.tags.map(e=>(0,P.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,P.jsx)(`input`,{type:`checkbox`,id:`category-${e.name.replace(/\s+/g,`-`)}`,checked:v.has(e.name),onChange:()=>A(e.name),className:`semiont-checkbox`}),(0,P.jsxs)(`label`,{htmlFor:`category-${e.name.replace(/\s+/g,`-`)}`,className:`semiont-form__checkbox-label`,style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,P.jsx)(`span`,{style:{fontWeight:500},children:e.name}),(0,P.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-secondary)`},children:e.description})]})]},e.name))}),(0,P.jsx)(`p`,{className:`semiont-form__help`,children:u(`categoriesSelected`,{count:v.size})})]})]}),(0,P.jsxs)(`button`,{onClick:()=>{v.size>0&&(d?.client.mark.requestAssist(`tagging`,{schemaId:g,categories:Array.from(v),language:c,sourceLanguage:l}),y(new Set))},disabled:v.size===0||n,className:`semiont-button`,"data-variant":`assist`,"data-type":`tag`,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:u(`annotate`)})]}),n&&r&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":`tag`,children:[r.requestParams&&r.requestParams.length>0&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":`tag`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),r.requestParams.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,P.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,P.jsx)(`span`,{children:r.message})]}),r.currentCategory&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__details`,children:[`Processing: `,r.currentCategory,r.processedCategories!==void 0&&r.totalCategories!==void 0&&(0,P.jsxs)(P.Fragment,{children:[` (`,r.processedCategories,`/`,r.totalCategories,`)`]})]})]}),r.percentage!==void 0&&(0,P.jsx)(`div`,{className:`semiont-progress-bar`,children:(0,P.jsx)(`div`,{className:`semiont-progress-bar__fill`,"data-type":`tag`,style:{width:`${r.percentage}%`}})})]})]})]}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:E.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noTags`)}):E.map(e=>(0,P.jsx)(rY,{tag:e,isFocused:e.id===b,isHovered:e.id===s,ref:t=>D(e.id,t)},e.id))})]})]})}var oY=[`statistics`,`reference`,`highlight`,`assessment`,`comment`,`tag`];function sY(e){let t=hh(`UnifiedAnnotationsPanel`),n={highlight:[],comment:[],assessment:[],reference:[],tag:[]};for(let t of e.annotations){let r=Object.values(e.annotators).find(e=>e.matchesAnnotation(t));r&&(n[r.internalType]||(n[r.internalType]=[]),n[r.internalType].push(t))}let r=n,[i,a]=(0,m.useState)(()=>{if(typeof window>`u`)return e.initialTab||`statistics`;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`,n=localStorage.getItem(t);return n&&oY.includes(n)?n:e.initialTab||`statistics`});(0,m.useEffect)(()=>{if(typeof window>`u`)return;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`;localStorage.setItem(t,i)},[i,e.resourceId]),(0,m.useEffect)(()=>{e.initialTab&&e.initialTabGeneration!==void 0&&a(e.initialTab)},[e.initialTabGeneration]),(0,m.useEffect)(()=>{if(e.pendingAnnotation){let t={linking:`reference`,commenting:`comment`,tagging:`tag`,assessing:`assessment`,highlighting:`highlight`}[e.pendingAnnotation.motivation];t&&a(t)}},[e.pendingAnnotation]);let o=e=>{a(e)},s=e=>`semiont-unified-panel__tab-button${i===e?` semiont-unified-panel__tab-button--active`:``}`;return(0,P.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,P.jsx)(`div`,{className:`semiont-unified-panel__tabs`,children:oY.map(n=>{if(n===`statistics`)return(0,P.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,P.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:`📊`})},n);let r=e.annotators[n];return r?(0,P.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,P.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:r.iconEmoji})},n):null})}),(0,P.jsx)(`div`,{className:`semiont-unified-panel__content`,children:(()=>{if(i===`statistics`)return(0,P.jsx)(nY,{highlights:r.highlight||[],comments:r.comment||[],assessments:r.assessment||[],references:r.reference||[],tags:r.tag||[]});let t=e.annotators[i];if(!t)return null;let n=r[i]||[],a=e.assistingMotivation===t.motivation,o=a?e.progress??null:null,s={annotations:n,pendingAnnotation:e.pendingAnnotation,isAssisting:a,progress:o,annotateMode:e.annotateMode,locale:e.locale,sourceLanguage:e.sourceLanguage,scrollToAnnotationId:e.scrollToAnnotationId,onScrollCompleted:e.onScrollCompleted,hoveredAnnotationId:e.hoveredAnnotationId};return i===`highlight`?(0,P.jsx)(KJ,{...s}):i===`reference`?(0,P.jsx)(eY,{annotations:s.annotations,pendingAnnotation:s.pendingAnnotation,isAssisting:s.isAssisting,progress:s.progress,annotateMode:s.annotateMode,scrollToAnnotationId:s.scrollToAnnotationId,onScrollCompleted:s.onScrollCompleted,hoveredAnnotationId:s.hoveredAnnotationId,locale:s.locale,sourceLanguage:s.sourceLanguage,allEntityTypes:e.allEntityTypes||[],generatingReferenceId:e.generatingReferenceId,referencedBy:e.referencedBy,referencedByLoading:e.referencedByLoading,Link:e.Link,routes:e.routes}):i===`assessment`?(0,P.jsx)(RJ,{...s}):i===`comment`?(0,P.jsx)(UJ,{...s}):i===`tag`?(0,P.jsx)(aY,{...s}):null})()})]})}function cY({Link:e,routes:t,t:n,CookiePreferences:r,onOpenKeyboardHelp:i,sourceCodeUrl:a=`https://github.com/The-AI-Alliance/semiont`,showPolicyLinks:o=!0}){let[s,c]=(0,m.useState)(!1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`footer`,{role:`contentinfo`,className:`semiont-footer`,children:(0,P.jsx)(`div`,{className:`semiont-footer__container`,children:(0,P.jsxs)(`div`,{className:`semiont-footer__content`,children:[(0,P.jsx)(`div`,{className:`semiont-footer__copyright`,children:n(`copyright`,{year:new Date().getFullYear()})}),(0,P.jsxs)(`div`,{className:`semiont-footer__links`,children:[o&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(e,{href:t.about?.()||`/about`,className:`semiont-footer__link`,children:n(`about`)}),(0,P.jsx)(e,{href:t.privacy?.()||`/privacy`,className:`semiont-footer__link`,children:n(`privacyPolicy`)}),r&&(0,P.jsx)(`button`,{onClick:()=>c(!0),className:`semiont-footer__link`,children:n(`cookiePreferences`)}),(0,P.jsx)(e,{href:t.terms?.()||`/terms`,className:`semiont-footer__link`,children:n(`termsOfService`)})]}),i&&(0,P.jsxs)(`button`,{onClick:i,className:`semiont-footer__link semiont-footer__link--keyboard`,children:[n(`keyboardShortcuts`),(0,P.jsx)(`kbd`,{className:`semiont-footer__kbd`,children:`?`})]}),(0,P.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-footer__link`,children:n(`sourceCode`)})]})]})})}),o&&r&&(0,P.jsx)(r,{isOpen:s,onClose:()=>c(!1)})]})}function lY({Link:e,routes:t,t:n,isAdmin:r=!1,isModerator:i=!1,onItemClick:a,className:o=``,currentPath:s}){let c=o?`semiont-navigation-menu ${o}`:`semiont-navigation-menu`,l=e=>s?s===e||s.startsWith(e+`/`):!1;return(0,P.jsxs)(`nav`,{className:c,"aria-label":`Main navigation`,children:[(0,P.jsx)(e,{href:t.knowledge?.()||`/know`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.knowledge?.()||`/know`)?`page`:void 0,children:n(`know`)}),(i||r)&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,P.jsx)(e,{href:t.moderate?.()||`/moderate`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.moderate?.()||`/moderate`)?`page`:void 0,children:n(`moderate`)})]}),r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,P.jsx)(e,{href:t.admin?.()||`/admin`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.admin?.()||`/admin`)?`page`:void 0,children:n(`administer`)})]})]})}function uY({title:e,items:t,currentPath:n,LinkComponent:r,dropdownContent:i,isCollapsed:a,icons:o,collapseSidebarLabel:s,expandSidebarLabel:c}){let l=o.chevronLeft,u=o.bars,[d,f]=(0,m.useState)(!1),p=(0,m.useRef)(null),h=R(),g=()=>f(!d),_=()=>f(!1);return(0,m.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&_()};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,P.jsxs)(`div`,{className:`semiont-simple-nav`,children:[(0,P.jsxs)(`div`,{style:{position:`relative`},ref:i?p:void 0,children:[(0,P.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[i?(0,P.jsx)(`button`,{onClick:g,className:`semiont-nav-section__header-button`,"aria-expanded":d,"aria-haspopup":`true`,type:`button`,children:!a&&(0,P.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e})}):!a&&(0,P.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e}),(0,P.jsx)(`button`,{onClick:()=>h.emit(`shell:sidebar-toggle`,void 0),className:`semiont-nav-section__header-icon`,title:a?c:s,"aria-label":a?c:s,type:`button`,children:a?(0,P.jsx)(u,{}):(0,P.jsx)(l,{})})]}),d&&i&&!a&&(0,P.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:i(_)})]}),!a&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,P.jsxs)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,children:[(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),a&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,P.jsx)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,"aria-label":e.name,children:(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})})]})}function dY(){var e=[...arguments];return(0,m.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var fY=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function pY(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function mY(e){return`nodeType`in e}function hY(e){return e?pY(e)?e:mY(e)?e.ownerDocument?.defaultView??window:window:window}function gY(e){let{Document:t}=hY(e);return e instanceof t}function _Y(e){return pY(e)?!1:e instanceof hY(e).HTMLElement}function vY(e){return e instanceof hY(e).SVGElement}function yY(e){return e?pY(e)?e.document:mY(e)?gY(e)?e:_Y(e)||vY(e)?e.ownerDocument:document:document:document}var bY=fY?m.useLayoutEffect:m.useEffect;function xY(e){let t=(0,m.useRef)(e);return bY(()=>{t.current=e}),(0,m.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function SY(){let e=(0,m.useRef)(null);return[(0,m.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,m.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function CY(e,t){t===void 0&&(t=[e]);let n=(0,m.useRef)(e);return bY(()=>{n.current!==e&&(n.current=e)},t),n}function wY(e,t){let n=(0,m.useRef)();return(0,m.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function TY(e){let t=xY(e),n=(0,m.useRef)(null);return[n,(0,m.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function EY(e){let t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e},[e]),t.current}var DY={};function OY(e,t){return(0,m.useMemo)(()=>{if(t)return t;let n=DY[e]==null?0:DY[e]+1;return DY[e]=n,e+`-`+n},[e,t])}function kY(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var AY=kY(1),jY=kY(-1);function MY(e){return`clientX`in e&&`clientY`in e}function NY(e){if(!e)return!1;let{KeyboardEvent:t}=hY(e.target);return t&&e instanceof t}function PY(e){if(!e)return!1;let{TouchEvent:t}=hY(e.target);return t&&e instanceof t}function FY(e){if(PY(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return MY(e)?{x:e.clientX,y:e.clientY}:null}var IY=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[IY.Translate.toString(e),IY.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),LY=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function RY(e){return e.matches(LY)?e:e.querySelector(LY)}var zY={display:`none`};function BY(e){let{id:t,value:n}=e;return m.createElement(`div`,{id:t,style:zY},n)}function VY(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return m.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function HY(){let[e,t]=(0,m.useState)(``);return{announce:(0,m.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var UY=(0,m.createContext)(null);function WY(e){let t=(0,m.useContext)(UY);(0,m.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function GY(){let[e]=(0,m.useState)(()=>new Set),t=(0,m.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,m.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var KY={draggable:`
|
|
135
|
+
`))}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 hK(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=fq.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Sq(){return{exit:{taskListCheckValueChecked:wq,taskListCheckValueUnchecked:wq,paragraph:Tq}}}function Cq(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Eq}}}function wq(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Tq(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 Eq(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=fq.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 Dq(){return[NG(),rK(),cK(),pq(),Sq()]}function Oq(e){return{extensions:[PG(),iK(e),lK(),xq(e),Cq()]}}var kq={tokenize:Uq,partial:!0},Aq={tokenize:Wq,partial:!0},jq={tokenize:Gq,partial:!0},Mq={tokenize:Kq,partial:!0},Nq={tokenize:qq,partial:!0},Pq={name:`wwwAutolink`,tokenize:Vq,previous:Jq},Fq={name:`protocolAutolink`,tokenize:Hq,previous:Yq},Iq={name:`emailAutolink`,tokenize:Bq,previous:Xq},Lq={};function Rq(){return{text:Lq}}for(var zq=48;zq<123;)Lq[zq]=Iq,zq++,zq===58?zq=65:zq===91&&(zq=97);Lq[43]=Iq,Lq[45]=Iq,Lq[46]=Iq,Lq[95]=Iq,Lq[72]=[Iq,Fq],Lq[104]=[Iq,Fq],Lq[87]=[Iq,Pq],Lq[119]=[Iq,Pq];function Bq(e,t,n){let r=this,i,a;return o;function o(t){return!Zq(t)||!Xq.call(r,r.previous)||Qq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Zq(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Nq,u,l)(t):t===45||t===95||PB(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&&NB(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Vq(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Jq.call(r,r.previous)||Qq(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(kq,e.attempt(Aq,e.attempt(jq,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Hq(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Yq.call(r,r.previous)&&!Qq(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(NB(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||IB(t)||BB(t)||HB(t)||VB(t)?n(t):e.attempt(Aq,e.attempt(jq,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Uq(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 Wq(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Mq,c,s)(t):t===null||BB(t)||HB(t)||t!==45&&VB(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 Gq(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(Mq,t,a)(o):o===null||BB(o)||HB(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Kq(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||BB(o)||HB(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||BB(e)||HB(e)?t(e):r(e)}function a(e){return NB(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):NB(t)?(e.consume(t),o):n(t)}}function qq(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return PB(e)?n(e):t(e)}}function Jq(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||BB(e)}function Yq(e){return!NB(e)}function Xq(e){return!(e===47||Zq(e))}function Zq(e){return e===43||e===45||e===46||e===95||PB(e)}function Qq(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 $q={tokenize:sJ,partial:!0};function eJ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:iJ,continuation:{tokenize:aJ},exit:oJ}},text:{91:{name:`gfmFootnoteCall`,tokenize:rJ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tJ,resolveTo:nJ}}}}function tJ(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=MB(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 nJ(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 rJ(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||BB(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(MB(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return BB(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 iJ(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||BB(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=MB(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return BB(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),GB(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function aJ(e,t,n){return e.check(oV,t,e.attempt($q,t,n))}function oJ(e){e.exit(`gfmFootnoteDefinition`)}function sJ(e,t,n){let r=this;return GB(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 cJ(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&&TB(o,o.length,0,$B(s,e.slice(r+1,n),t)),TB(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),TB(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=QB(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=QB(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var lJ=class{constructor(){this.map=[]}add(e,t,n){uJ(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}};function uJ(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dJ(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 fJ(){return{flow:{null:{name:`table`,tokenize:pJ,resolveAll:mJ}}}}function pJ(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 e=r.events[t][1].type;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?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?GB(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||BB(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,$(t)?GB(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 $(t)?GB(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||Q(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 $(t)?GB(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(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||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?GB(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||BB(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 mJ(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 lJ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(gJ(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=hJ(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=hJ(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=hJ(f,t,o,i,n,d)):(o[0]=o[1],d=hJ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&gJ(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=dJ(t.events,n))}return e}function hJ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},_J(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=_J(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=_J(t.events,n[2]),a=_J(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({},_J(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function gJ(e,t,n,r,i){let a=[],o=_J(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 _J(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vJ={name:`tasklistCheck`,tokenize:bJ};function yJ(){return{text:{91:vJ}}}function bJ(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 BB(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 Q(r)?t(r):$(r)?e.check({tokenize:xJ},t,n)(r):n(r)}}function xJ(e,t,n){return GB(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function SJ(e){return OB([Rq(),eJ(),cJ(e),fJ(),yJ()])}var CJ={};function wJ(e){let t=this,n=e||CJ,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SJ(n)),a.push(Dq()),o.push(Oq(n))}function TJ({imageUrl:e,alt:t=`Resource image`}){return(0,P.jsx)(`div`,{className:`semiont-image-viewer`,children:(0,P.jsx)(`img`,{src:e,alt:t,className:`semiont-image-viewer__image`,style:{imageRendering:`auto`}})})}var EJ=(0,m.lazy)(()=>b(()=>import(`./PdfAnnotationCanvas.client-CN3C3S55-DZ2osbg-.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([2,3,4,5]))),DJ=(0,m.memo)(function({content:e}){return(0,P.jsx)(bG,{remarkPlugins:[wJ],children:e})}),OJ=(0,m.memo)(function({content:e,mimeType:t,resourceUri:n,annotations:r,selectedClick:i=`detail`,annotateMode:a,hoverDelayMs:o=150}){let{newAnnotationIds:s}=jE(),c=K(R().activeSession$),l=(0,m.useRef)(null),u=Ro(t),{highlights:d,references:f,assessments:p,comments:h,tags:g}=r,_=(0,m.useMemo)(()=>[...d,...f,...p,...h,...g],[d,f,p,h,g]),v=(0,m.useMemo)(()=>eE(_),[_]),y=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current&&(y.current=qT(e,l.current))},[e]),(0,m.useEffect)(()=>{if(!l.current||!y.current||v.length===0)return;let e=l.current,t=JT(e);return ZT(XT(v,y.current,t)),()=>$T(e)},[v]),(0,m.useEffect)(()=>{if(!l.current||!c)return;let e=l.current,t=e=>{let t=e.target.closest(`[data-annotation-id]`);if(!t)return;let n=t.getAttribute(`data-annotation-id`),r=t.getAttribute(`data-annotation-type`);if(n&&r===`reference`){let e=_.find(e=>e.id===n);e&&c.client.browse.click(e.id,e.motivation)}},{handleMouseEnter:n,handleMouseLeave:r,cleanup:i}=Hu(e=>c.client.beckon.hover(e),o),a=e=>{let t=e.target.closest(`[data-annotation-id]`)?.getAttribute(`data-annotation-id`);t&&n(za(t))},u=e=>{e.target.closest(`[data-annotation-id]`)&&r()};return s&&e.querySelectorAll(`[data-annotation-id]`).forEach(e=>{let t=e.getAttribute(`data-annotation-id`);t&&s.has(t)&&e.classList.add(`annotation-sparkle`)}),e.addEventListener(`click`,t),e.addEventListener(`mouseover`,a),e.addEventListener(`mouseout`,u),()=>{e.removeEventListener(`click`,t),e.removeEventListener(`mouseover`,a),e.removeEventListener(`mouseout`,u),i()}},[e,_,s,o,c]);let b=(0,m.useCallback)((e,t=!1)=>{l.current&&DN(e,l.current,{pulse:t})},[]);switch(SE({"beckon:hover":(0,m.useCallback)(({annotationId:e})=>{b(e)},[b]),"beckon:focus":(0,m.useCallback)(({annotationId:e})=>{b(e??null,!0)},[b])}),u){case`text`:return(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`text`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(DJ,{content:e})})]});case`image`:return Lo(t)?(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`pdf`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(m.Suspense,{fallback:(0,P.jsx)(`div`,{className:`semiont-browse-view__loading`,children:`Loading PDF viewer...`}),children:(0,P.jsx)(EJ,{pdfUrl:e,existingAnnotations:_,drawingMode:null,selectedMotivation:null})})})]}):(0,P.jsxs)(`div`,{className:`semiont-browse-view`,"data-mime-type":`image`,children:[(0,P.jsx)(eP,{selectedMotivation:null,selectedClick:i,showSelectionGroup:!1,showDeleteButton:!1,annotateMode:a,annotators:Ih}),(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view__content`,children:(0,P.jsx)(TJ,{imageUrl:e,mimeType:t,alt:`Resource content`})})]});case`unsupported`:return(0,P.jsx)(`div`,{ref:l,className:`semiont-browse-view semiont-browse-view--unsupported`,"data-mime-type":`unsupported`,children:(0,P.jsxs)(`div`,{className:`semiont-browse-view__empty`,children:[(0,P.jsxs)(`p`,{className:`semiont-browse-view__empty-message`,children:[`Preview not available for `,t]}),(0,P.jsx)(`a`,{href:`/api/resources/${n}`,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`})]})})}});function kJ({resource:e,annotations:t,generatingReferenceId:n,showLineNumbers:r=!1,hoverDelayMs:i,hoveredAnnotationId:a}){let o=hh(`ResourceViewer`),s=(0,m.useRef)(null),c=R(),l=K(c.activeSession$),u=fE(),{highlights:d,references:f,assessments:p,comments:h,tags:g}=t;if(!e[`@id`])throw Error(`Resource has no @id`);let _=e[`@id`],v=(()=>{let t=e.representations;return Array.isArray(t)&&t.length>0&&t[0]?t[0].mediaType:`text/plain`})(),[y,b]=(0,m.useState)(()=>typeof window<`u`?localStorage.getItem(`annotateMode`)===`true`:!1);(0,m.useEffect)(()=>{typeof window<`u`&&localStorage.setItem(`annotateMode`,y.toString())},[y]);let x=(0,m.useCallback)(()=>{b(e=>!e)},[]),S=y?`annotate`:`browse`,C=l?.client,w=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),T=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),E=(0,m.useCallback)(()=>{C?.browse.invalidateAnnotationList(_)},[C,_]),[D,O]=(0,m.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(`semiont-toolbar-selection`);if(e===`null`)return null;if(e&&[`linking`,`highlighting`,`assessing`,`commenting`,`tagging`].includes(e))return e}return`linking`}),[k,A]=(0,m.useState)(()=>{if(typeof window<`u`){let e=localStorage.getItem(`semiont-toolbar-click`);if(e&&[`detail`,`follow`,`jsonld`,`deleting`].includes(e))return e}return`detail`}),ee=WT(v),[te,j]=(0,m.useState)(()=>GT(ee)),ne=(0,m.useCallback)(({motivation:e})=>{O(e)},[]),re=(0,m.useCallback)(({action:e})=>{A(e)},[]),ie=(0,m.useCallback)(({shape:e})=>{j(e)},[]);(0,m.useEffect)(()=>{D===null?localStorage.setItem(`semiont-toolbar-selection`,`null`):localStorage.setItem(`semiont-toolbar-selection`,D)},[D]),(0,m.useEffect)(()=>{localStorage.setItem(`semiont-toolbar-click`,k)},[k]),(0,m.useEffect)(()=>{KT(ee,te)},[ee,te]),(0,m.useEffect)(()=>{let e=GT(ee);e!==te&&j(e)},[ee]);let[ae,M]=(0,m.useState)(!1),[oe,se]=(0,m.useState)(null),[ce,le]=(0,m.useState)(null),ue=a??null,[N,de]=(0,m.useState)(null),[fe,pe]=(0,m.useState)(null),me=(0,m.useCallback)(e=>{pe(e),de(e),setTimeout(()=>pe(null),3e3)},[]),he=()=>typeof window>`u`?{x:0,y:0}:{x:Math.max(0,(window.innerWidth-800)/2),y:Math.max(0,(window.innerHeight-700)/2)},ge=(0,m.useCallback)(e=>{l?.client.mark.delete(_,e)},[l,_]),_e=(0,m.useCallback)((e,t)=>{if(Object.values(Ih).find(t=>t.matchesAnnotation(e))?.hasSidePanel){if(k===`detail`){me(e.id);return}if(k!==`deleting`&&k!==`jsonld`&&k!==`follow`)return}let n=no(e)||io(e)||ao(e)||ro(e)||oo(e);if(k===`follow`&&ro(e)){let t=$a(e.body);t&&u(`/know/resource/${t}`,{resourceId:t});return}if(k===`jsonld`&&n){se(e),M(!0);return}if(y&&k===`deleting`&&n){le({annotation:e,position:t?{x:t.clientX,y:t.clientY+10}:{x:window.innerWidth/2-150,y:window.innerHeight/2-75}});return}},[y,k,me]);SE({"mark:mode-toggled":x,"mark:added":w,"mark:removed":T,"mark:body-updated":E,"mark:selection-changed":ne,"mark:click-changed":re,"mark:shape-changed":ie,"browse:click":(0,m.useCallback)(({annotationId:e,motivation:t})=>{if(!Object.values(Ih).find(e=>e.matchesAnnotation({motivation:t}))?.hasSidePanel){let t=[...d,...f,...p,...h,...g].find(t=>t.id===e);t&&_e(t);return}if(k!==`detail`){let t=[...d,...f,...p,...h,...g].find(t=>t.id===e);t&&_e(t);return}c.emit(`panel:open`,{panel:`annotations`,scrollToAnnotationId:e,motivation:t})},[d,f,p,h,g,_e,k,l])});let ve=(0,m.useMemo)(()=>({highlights:d,references:f,assessments:p,comments:h,tags:g}),[d,f,p,h,g]),ye={selectedMotivation:D,selectedClick:k,selectedShape:te,hoveredAnnotationId:ue,scrollToAnnotationId:N},be=(0,m.useCallback)(e=>{let t=f.find(t=>$a(t.body)===e);return t?lo(to(t.target)):void 0},[f]);return(0,P.jsxs)(`div`,{ref:s,className:`semiont-resource-viewer`,children:[S===`annotate`?(0,P.jsx)(NR,{content:e.content,mimeType:v,resourceUri:e[`@id`],annotations:ve,uiState:ye,onUIStateChange:e=>{`selectedMotivation`in e&&O(e.selectedMotivation),`selectedClick`in e&&A(e.selectedClick),`selectedShape`in e&&j(e.selectedShape)},enableWidgets:!0,getTargetResourceName:be,...n!==void 0&&{generatingReferenceId:n},showLineNumbers:r,hoverDelayMs:i,annotateMode:y}):(0,P.jsx)(OJ,{content:e.content,mimeType:v,resourceUri:e[`@id`],annotations:ve,selectedClick:k,hoverDelayMs:i,annotateMode:y}),oe&&(0,P.jsx)(yR,{isOpen:ae,onClose:()=>M(!1),position:he(),wide:!0,children:(0,P.jsx)(SP,{annotation:oe,onBack:()=>{M(!1),se(null)}})}),ce&&(()=>{let e=ce.annotation,t=Object.values(Ih).find(t=>t.matchesAnnotation(e)),n=lo(to(e.target)),r=t?.iconEmoji||`📝`;return(0,P.jsx)(yR,{isOpen:!!ce,onClose:()=>le(null),position:ce.position,children:(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation`,children:[(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation__header`,children:[(0,P.jsx)(`span`,{className:`semiont-delete-confirmation__icon`,children:r}),(0,P.jsx)(`h3`,{className:`semiont-delete-confirmation__title`,children:o(`deleteConfirmationTitle`)})]}),n&&(0,P.jsx)(`div`,{className:`semiont-delete-confirmation__quote`,children:(0,P.jsxs)(`p`,{className:`semiont-delete-confirmation__text`,children:[`"`,n.length>100?n.substring(0,100)+`...`:n,`"`]})}),(0,P.jsx)(`p`,{className:`semiont-delete-confirmation__message`,children:o(`deleteConfirmationMessage`)}),(0,P.jsxs)(`div`,{className:`semiont-delete-confirmation__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>le(null),className:`semiont-button semiont-button--secondary`,children:o(`deleteConfirmationCancel`)}),(0,P.jsx)(`button`,{onClick:()=>{ge(ce.annotation.id),le(null)},className:`semiont-button semiont-button--danger`,children:o(`deleteConfirmationDelete`)})]})]})})})()]})}function AJ(e){if(e[`@type`]===`Software`){let t=e.provider,n=e.model;if(t&&n)return`${t} ${n}`;if(n)return n;if(t)return t}return e.name||e[`@id`]||`unknown`}function jJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function MJ(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`TextualBody`&&`value`in e&&typeof e.value==`string`}function NJ(e){return e.body?MJ(e.body)?e.body.value||null:Array.isArray(e.body)&&e.body.length>0&&e.body.find(MJ)?.value||null:null}function PJ({assessment:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e),s=NJ(e);return(0,P.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`assessment`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`assessment`,children:[`"`,o.substring(0,100),o.length>100?`...`:``,`"`]}),s&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__body`,"data-type":`assessment`,children:s}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,jJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function FJ({annotationType:e,isAssisting:t,locale:n,sourceLanguage:r,progress:i}){let a=hh(e===`highlight`?`HighlightPanel`:e===`assessment`?`AssessmentPanel`:`CommentsPanel`),o=K(R().activeSession$),[s,c]=(0,m.useState)(``),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(e===`comment`?5:e===`assessment`?4:5),[p,h]=(0,m.useState)(!0),[g,_]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let t=localStorage.getItem(`assist-section-expanded-${e}`);return t?t===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-${e}`,String(g))},[g,e]);let v=(0,m.useCallback)(()=>{let t=e===`highlight`?`highlighting`:e===`assessment`?`assessing`:`commenting`;o?.client.mark.requestAssist(t,{instructions:s.trim()||void 0,tone:(e===`comment`||e===`assessment`)&&l?l:void 0,density:(e===`comment`||e===`assessment`||e===`highlight`)&&p?d:void 0,language:e===`comment`||e===`assessment`?n:void 0,sourceLanguage:r}),c(``),u(``)},[e,s,l,p,d,n,r,o]),y=(0,m.useCallback)(()=>{o?.client.mark.dismissProgress()},[o]);return(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>_(!g),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":g,type:`button`,children:[(0,P.jsx)(`span`,{children:a(e===`highlight`?`annotateHighlights`:e===`assessment`?`annotateAssessments`:`annotateComments`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":g,children:`›`})]}),g&&(0,P.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":t&&i?`true`:`false`,"data-type":e,children:[!i&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`instructions`),` `,a(`optional`)]}),(0,P.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),className:`semiont-textarea`,rows:3,placeholder:a(`instructionsPlaceholder`),maxLength:500}),(0,P.jsxs)(`div`,{className:`semiont-form-field__char-count`,children:[s.length,`/500`]})]}),(e===`comment`||e===`assessment`)&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label`,children:[a(`toneLabel`),` `,a(`toneOptional`)]}),(0,P.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:``,children:`Default`}),e===`comment`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`option`,{value:`scholarly`,children:a(`toneScholarly`)}),(0,P.jsx)(`option`,{value:`explanatory`,children:a(`toneExplanatory`)}),(0,P.jsx)(`option`,{value:`conversational`,children:a(`toneConversational`)}),(0,P.jsx)(`option`,{value:`technical`,children:a(`toneTechnical`)})]}),e===`assessment`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`option`,{value:`analytical`,children:a(`toneAnalytical`)}),(0,P.jsx)(`option`,{value:`critical`,children:a(`toneCritical`)}),(0,P.jsx)(`option`,{value:`balanced`,children:a(`toneBalanced`)}),(0,P.jsx)(`option`,{value:`constructive`,children:a(`toneConstructive`)})]})]})]}),(e===`comment`||e===`assessment`||e===`highlight`)&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsxs)(`div`,{className:`semiont-form-field__header`,children:[(0,P.jsxs)(`label`,{className:`semiont-form-field__label semiont-form-field__label--with-checkbox`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>h(e.target.checked),className:`semiont-checkbox`,"data-variant":e}),(0,P.jsx)(`span`,{children:a(`densityLabel`)})]}),p&&(0,P.jsxs)(`span`,{className:`semiont-form-field__info`,children:[d,` per 2000 words`]})]}),p&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{type:`range`,min:e===`comment`?`2`:`1`,max:e===`comment`?`12`:e===`assessment`?`10`:`15`,value:d,onChange:e=>f(Number(e.target.value)),className:`semiont-slider`}),(0,P.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,P.jsx)(`span`,{children:a(`densitySparse`)}),(0,P.jsx)(`span`,{children:a(`densityDense`)})]})]})]}),(0,P.jsxs)(`button`,{onClick:v,className:`semiont-button`,"data-variant":`assist`,"data-type":e,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:a(`annotate`)})]})]}),i&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":e,children:[i.requestParams&&i.requestParams.length>0&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":e,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),i.requestParams.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,P.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,P.jsx)(`span`,{children:i.message})]}),!t&&(0,P.jsx)(`button`,{onClick:y,className:`semiont-annotation-progress__close`,"aria-label":a(`closeProgress`),title:a(`closeProgress`),type:`button`,children:`×`})]})]})]})]})}function IJ({count:e,title:t}){return(0,P.jsx)(`div`,{className:`semiont-panel-header`,children:(0,P.jsxs)(`h2`,{className:`semiont-panel-header__title`,children:[(0,P.jsx)(`span`,{className:`semiont-panel-header__text`,children:t}),(0,P.jsxs)(`span`,{className:`semiont-panel-header__count`,children:[`(`,e,`)`]})]})})}function LJ(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function RJ({annotations:e,pendingAnnotation:t,isAssisting:n=!1,progress:r,locale:i,sourceLanguage:a,annotateMode:o=!0,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l}){let u=hh(`AssessmentPanel`),d=K(R().activeSession$),[f,p]=(0,m.useState)(``),[h,g]=(0,m.useState)(null),_=(0,m.useRef)(null),v=(0,m.useRef)(new Map),y=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),b=(0,m.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!s)return;let e=v.current.get(s);if(e&&_.current){let t=e.offsetTop,n=_.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;_.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,m.useEffect)(()=>{if(!l)return;let e=v.current.get(l);if(!e||!_.current)return;let t=_.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[l]),(0,m.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(d?.client.mark.cancelPending(),p(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,d]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`assessment`,count:e.length,title:u(`title`)}),t&&t.motivation===`assessing`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`assessment`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=LJ(t.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()}),(0,P.jsx)(`textarea`,{value:f,onChange:e=>p(e.target.value),className:`semiont-textarea`,rows:3,placeholder:u(`assessmentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[f.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{d?.client.mark.cancelPending(),p(``)},className:`semiont-button semiont-button--secondary`,"data-type":`assessment`,children:u(`cancel`)}),(0,P.jsx)(`button`,{onClick:()=>{if(t){let e=f.trim(),n=e?{type:`TextualBody`,value:e,purpose:`assessing`}:void 0;d?.client.mark.submit({motivation:`assessing`,selector:t.selector,...n===void 0?{}:{body:n}}),p(``)}},className:`semiont-button semiont-button--primary`,"data-type":`assessment`,children:u(`save`)})]})]})]}),(0,P.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[o&&(0,P.jsx)(FJ,{annotationType:`assessment`,isAssisting:n,locale:i,sourceLanguage:a,progress:r}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:y.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noAssessments`)}):y.map(e=>(0,P.jsx)(PJ,{assessment:e,isFocused:e.id===h,isHovered:e.id===l,ref:t=>b(e.id,t)},e.id))})]})]})}function zJ({state:e,eventCount:t,lastEventTimestamp:n,knowledgeBaseName:r}){let i=hh(`CollaborationPanel`),a=e===`open`||e===`reconnecting`||e===`initial`||e===`connecting`,o;if(!n)o=i(`noActivity`);else{let e=new Date,t=new Date(n),r=e.getTime()-t.getTime(),a=Math.floor(r/1e3),s=Math.floor(a/60),c=Math.floor(s/60);o=a<10?i(`justNow`):a<60?i(`secondsAgo`,{count:a}):s===1?i(`minuteAgo`):s<60?i(`minutesAgo`,{count:s}):c===1?i(`hourAgo`):c<24?i(`hoursAgo`,{count:c}):t.toLocaleDateString()}return(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__title`,children:i(`title`)}),r&&(0,P.jsx)(`div`,{style:{padding:`0 0.75rem 0.5rem`,fontSize:`0.8rem`,color:`var(--semiont-color-neutral-400)`},children:r}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`connectionStatus`)}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__status`,children:[(0,P.jsxs)(`span`,{className:`semiont-collaboration-panel__indicator`,children:[(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__dot`,"data-connected":a?`true`:`false`}),(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__status-text`,"data-connected":a?`true`:`false`,children:i(a?`live`:`disconnected`)})]}),a&&t>0&&(0,P.jsxs)(`span`,{className:`semiont-collaboration-panel__event-count`,children:[`(`,i(`events`,{count:t}),`)`]})]}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__details`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-collaboration-panel__label`,children:i(`lastSync`)}),` `,o]}),(0,P.jsx)(`div`,{children:i(a?`realtimeActive`:`reconnecting`)})]})]}),(0,P.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,P.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:i(`sharing`)}),(0,P.jsx)(`p`,{className:`semiont-collaboration-panel__description`,children:i(`collaborationComingSoon`)})]})]})}function BJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function VJ({comment:e,isFocused:t,isHovered:n=!1,annotateMode:r=!0,ref:i}){let a=hh(`CommentsPanel`),o=K(R().activeSession$),s=uE(e.id),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(``),f=(0,m.useRef)(null);(0,m.useImperativeHandle)(i,()=>f.current);let p=so(e)||``,h=uo(e);(0,m.useEffect)(()=>{t&&f.current&&f.current.scrollIntoView({behavior:`smooth`,block:`center`})},[t]);let g=()=>{d(p),l(!0)},_=()=>{l(!1)},v=()=>{l(!1),d(``)};return(0,P.jsxs)(`div`,{ref:f,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`comment`,"data-focused":t?`true`:`false`,onClick:()=>{o?.client.browse.click(e.id,e.motivation)},...s,children:[h&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`comment`,children:[`"`,h.substring(0,100),h.length>100?`...`:``,`"`]}),c?(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__edit`,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),className:`semiont-textarea`,rows:3,autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__edit-footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-entry__char-count`,children:[u.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__button-group`,children:[(0,P.jsx)(`button`,{onClick:_,className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:a(`save`)}),(0,P.jsx)(`button`,{onClick:v,className:`semiont-button semiont-button--secondary`,children:a(`cancel`)})]})]})]}):(0,P.jsx)(`div`,{className:`semiont-annotation-entry__body`,children:p}),!c&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__footer`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,BJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]}),r&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__actions`,onClick:e=>e.stopPropagation(),children:(0,P.jsx)(`button`,{onClick:g,className:`semiont-text-button`,"data-variant":`comment`,children:a(`edit`)})})]})]})}function HJ(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function UJ({annotations:e,pendingAnnotation:t,annotateMode:n=!0,isAssisting:r=!1,progress:i,locale:a,sourceLanguage:o,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l}){let u=hh(`CommentsPanel`),d=K(R().activeSession$),[f,p]=(0,m.useState)(``),[h,g]=(0,m.useState)(null),_=(0,m.useRef)(null),v=(0,m.useRef)(new Map),y=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),b=(0,m.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!s)return;let e=v.current.get(s);if(e&&_.current){let t=e.offsetTop,n=_.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;_.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,m.useEffect)(()=>{if(!l)return;let e=v.current.get(l);if(!e||!_.current)return;let t=_.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[l]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,m.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(d?.client.mark.cancelPending(),p(``))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,d]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`comment`,count:e.length,title:u(`title`)}),t&&t.motivation===`commenting`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`comment`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=HJ(t.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()}),(0,P.jsx)(`textarea`,{value:f,onChange:e=>p(e.target.value),className:`semiont-textarea`,rows:3,placeholder:u(`commentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[f.length,`/2000`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{d?.client.mark.cancelPending(),p(``)},className:`semiont-button semiont-button--secondary`,"data-type":`comment`,children:u(`cancel`)}),(0,P.jsx)(`button`,{onClick:()=>{f.trim()&&t&&(d?.client.mark.submit({motivation:`commenting`,selector:t.selector,body:[{type:`TextualBody`,value:f,purpose:`commenting`}]}),p(``))},disabled:!f.trim(),className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:u(`save`)})]})]})]}),(0,P.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[n&&(0,P.jsx)(FJ,{annotationType:`comment`,isAssisting:r,locale:a,sourceLanguage:o,progress:i}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:y.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noComments`)}):y.map(e=>(0,P.jsx)(VJ,{comment:e,isFocused:e.id===h,isHovered:e.id===l,annotateMode:n,ref:t=>b(e.id,t)},e.id))})]})]})}function WJ(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i} minute${i>1?`s`:``} ago`:a<24?`${a} hour${a>1?`s`:``} ago`:o<7?`${o} day${o>1?`s`:``} ago`:t.toLocaleDateString()}function GJ({highlight:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e);return(0,P.jsxs)(`div`,{ref:r,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`highlight`,"data-focused":t?`true`:`false`,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,children:[o&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`highlight`,children:[`"`,o.substring(0,200),o.length>200?`...`:``,`"`]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof e.creator==`string`?e.creator:e.creator?.name||`Unknown`,` • `,WJ(e.created||new Date().toISOString())]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function KJ({annotations:e,pendingAnnotation:t,isAssisting:n=!1,progress:r,annotateMode:i=!0,scrollToAnnotationId:a,onScrollCompleted:o,hoveredAnnotationId:s,sourceLanguage:c}){let l=hh(`HighlightPanel`),u=K(R().activeSession$),[d,f]=(0,m.useState)(null),p=(0,m.useRef)(null),h=(0,m.useRef)(new Map),g=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),_=(0,m.useCallback)((e,t)=>{t?h.current.set(e,t):h.current.delete(e)},[]);return(0,m.useEffect)(()=>{if(!a)return;let e=h.current.get(a);if(e&&p.current){let t=e.offsetTop,n=p.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;p.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),o&&o()}},[a]),(0,m.useEffect)(()=>{if(!s)return;let e=h.current.get(s);if(!e||!p.current)return;let t=p.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[s]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{f(e),setTimeout(()=>f(null),3e3)},[])}),(0,m.useEffect)(()=>{t&&t.motivation===`highlighting`&&u?.client.mark.submit({motivation:`highlighting`,selector:t.selector})},[t,u]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`highlight`,count:e.length,title:l(`title`)}),(0,P.jsxs)(`div`,{ref:p,className:`semiont-panel__content`,children:[i&&(0,P.jsx)(FJ,{annotationType:`highlight`,isAssisting:n,progress:r,sourceLanguage:c}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:g.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:l(`noHighlights`)}):g.map(e=>(0,P.jsx)(GJ,{highlight:e,isFocused:e.id===d,isHovered:e.id===s,ref:t=>_(e.id,t)},e.id))})]})]})}function qJ({resource:e}){let t=(0,m.useRef)(null),n=(0,m.useRef)(null),{showLineNumbers:r}=lE();return(0,m.useEffect)(()=>{if(!t.current)return;let i=document.documentElement?.classList.contains(`dark`)??!1,a=JSON.stringify(e,null,2),o=[iP(),H.editable.of(!1),p_.readOnly.of(!0)];r&&o.push(TC()),i?o.push(xP):(o.push(RT),o.push(DT(zT)));let s=new H({state:p_.create({doc:a,extensions:o}),parent:t.current});return n.current=s,()=>{s.destroy(),n.current=null}},[e,r]),(0,P.jsxs)(`div`,{className:`semiont-jsonld-panel`,children:[(0,P.jsxs)(`div`,{className:`semiont-jsonld-panel__header`,children:[(0,P.jsx)(`h3`,{className:`semiont-jsonld-panel__title`,children:`JSON-LD`}),(0,P.jsx)(`button`,{onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-button semiont-button--icon`,title:`Copy to clipboard`,children:`📋 Copy`})]}),(0,P.jsx)(`div`,{ref:t,className:`semiont-jsonld-panel__editor`})]})}function JJ(e){if(Array.isArray(e.body)){let t=[];for(let n of e.body)if(typeof n==`object`&&n&&`type`in n&&`value`in n&&`purpose`in n){let e=n.type,r=n.value,i=n.purpose;e===`TextualBody`&&i===`tagging`&&typeof r==`string`&&r.length>0&&t.push(r)}return t}return[]}function YJ(e){return e.motivation===`tagging`}function XJ(e){if(!YJ(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`tagging`);if(t&&`value`in t)return t.value}function ZJ(e){if(!YJ(e))return;let t=(Array.isArray(e.body)?e.body:[e.body]).find(e=>typeof e==`object`&&!!e&&`purpose`in e&&e.purpose===`classifying`);if(t&&`value`in t)return t.value}function QJ({reference:e,isFocused:t,isHovered:n=!1,routes:r,annotateMode:i=!0,isGenerating:a=!1,ref:o}){let s=hh(`ReferencesPanel`),c=K(R().activeSession$),l=c?.client,u=fE(),d=uE(e.id),f=uo(e)||``,p=eo(e.body),m=p?$a(e.body):null,h=JJ(e),g=to(e.target),_=Qa(g),v=Za(g),y=_?`Fragment annotation`:v?`Image annotation`:`Annotation`,b=e,x=b._resolvedDocumentName,S=b._resolvedDocumentMediaType,C=tE(S),w=()=>{m&&u(r.resourceDetail(m),{resourceId:m})},T=typeof e.target==`object`&&`source`in e.target?e.target.source:``,E=()=>{T&&m&&l&&l.bind.body(Ra(T),e.id,[{op:`remove`,item:{type:`SpecificResource`,source:m,purpose:`linking`}}]).catch(()=>{})},D=()=>{c?.client.bind.initiate({annotationId:e.id,resourceId:Ra(T),defaultTitle:f,entityTypes:h})},O=e=>{e.stopPropagation(),p?w():i&&D()},k=p||i;return(0,P.jsxs)(`div`,{ref:o,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`reference`,"data-focused":t?`true`:`false`,onClick:()=>{c?.client.browse.click(e.id,e.motivation)},...d,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,P.jsxs)(`div`,{className:`semiont-reference-icon-group`,children:[(0,P.jsx)(`button`,{className:`semiont-reference-icon${k?` semiont-reference-icon--clickable`:``}`,title:s(p?`open`:i?`resolve`:`stub`),onClick:k?O:void 0,"data-generating":!p&&a?`true`:`false`,tabIndex:k?0:-1,children:p?`🔗`:`❓`}),i&&p&&(0,P.jsx)(`button`,{className:`semiont-reference-unlink`,title:s(`unlink`),onClick:e=>{e.stopPropagation(),E()},children:`⛓️💥`})]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__content`,children:[f&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`reference`,children:[`"`,f.substring(0,100),f.length>100?`...`:``,`"`]}),!f&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__meta`,children:y}),x&&(0,P.jsx)(`div`,{className:`semiont-reference-link`,children:(0,P.jsxs)(`span`,{children:[`→ `,C,` `,x]})})]})]}),h.length>0&&(0,P.jsx)(`div`,{className:`semiont-annotation-entry__tags`,children:h.map((e,t)=>(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},t))}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function $J(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function eY({annotations:e=[],isAssisting:t,progress:n,annotateMode:r=!0,Link:i,routes:a,allEntityTypes:o,generatingReferenceId:s,referencedBy:c=[],referencedByLoading:l=!1,pendingAnnotation:u,scrollToAnnotationId:d,onScrollCompleted:f,hoveredAnnotationId:p,locale:h,sourceLanguage:g}){let _=hh(`ReferencesPanel`),v=K(R().activeSession$),[y,b]=(0,m.useState)([]),[x,S]=(0,m.useState)(null),[C,w]=(0,m.useState)([]),[T,E]=(0,m.useState)(!1),[D,O]=(0,m.useState)(null),k=(0,m.useRef)(null),[A,ee]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-reference`);return e?e===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-reference`,String(A))},[A]);let te=(0,m.useRef)(new Map),j=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),ne=(0,m.useCallback)((e,t)=>{t?te.current.set(e,t):te.current.delete(e)},[]);(0,m.useEffect)(()=>{if(!d)return;let e=te.current.get(d);if(e&&k.current){let t=e.offsetTop,n=k.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;k.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),f&&f()}else console.warn(`[ReferencesPanel] Element not found for scrollToAnnotationId:`,d)},[d]),(0,m.useEffect)(()=>{if(!p)return;let e=te.current.get(p);if(!e||!k.current)return;let t=k.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[p]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{O(e),setTimeout(()=>O(null),3e3)},[])});let re=()=>{S(null),v?.client.mark.requestAssist(`linking`,{entityTypes:y,includeDescriptiveReferences:T,language:h,sourceLanguage:g})},ie=(0,m.useRef)(!1);(0,m.useEffect)(()=>{if(t){ie.current=!1;return}!t&&!ie.current&&n?.completedEntityTypes&&(ie.current=!0,S(n.completedEntityTypes),b([]))},[t,n?.completedEntityTypes]);let ae=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,m.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&(v?.client.mark.cancelPending(),w([]))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[u,v]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`reference`,count:e.length,title:_(`title`)}),u&&u.motivation===`linking`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`reference`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=$J(u.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:_(`fragmentSelected`)})()}),o.length>0&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`p`,{className:`semiont-form-field__label`,children:_(`entityTypesOptional`)}),(0,P.jsx)(`div`,{className:`semiont-tag-selector`,children:o.map(e=>(0,P.jsx)(`button`,{onClick:()=>ae(e),className:`semiont-tag-selector__item`,"data-selected":C.includes(e)?`true`:`false`,children:e},e))})]}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>{v?.client.mark.cancelPending(),w([])},className:`semiont-button semiont-button--secondary`,"data-type":`reference`,children:_(`cancel`)}),(0,P.jsxs)(`button`,{onClick:()=>{if(u){let e=C.join(`,`)||void 0;v?.client.mark.submit({motivation:`linking`,selector:u.selector,body:e?[{type:`TextualBody`,value:e,purpose:`tagging`}]:[]}),w([])}},className:`semiont-button semiont-button--primary`,"data-type":`reference`,children:[`🔗 `,_(`createReference`)]})]})})]}),(0,P.jsxs)(`div`,{ref:k,className:`semiont-panel__content`,children:[r&&(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>ee(!A),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":A,type:`button`,children:[(0,P.jsx)(`span`,{children:_(`annotateReferences`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":A,children:`›`})]}),A&&(0,P.jsxs)(P.Fragment,{children:[!t&&(0,P.jsx)(`div`,{className:`semiont-assist-widget`,"data-type":`reference`,children:(0,P.jsxs)(P.Fragment,{children:[x&&x.length>0&&(0,P.jsx)(`div`,{className:`semiont-assist-widget__log`,children:(0,P.jsx)(`div`,{className:`semiont-assist-widget__log-items`,children:x.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-assist-widget__log-item`,children:[(0,P.jsx)(`span`,{className:`semiont-assist-widget__log-check`,children:`✓`}),(0,P.jsxs)(`span`,{className:`semiont-assist-widget__log-type`,children:[e.entityType,`:`]}),(0,P.jsx)(`span`,{children:_(`found`,{count:e.foundCount})})]},t))})}),(0,P.jsxs)(`div`,{className:`semiont-assist-widget__entity-types`,children:[(0,P.jsx)(`p`,{className:`semiont-assist-widget__label`,children:_(`selectEntityTypes`)}),(0,P.jsx)(`div`,{className:`semiont-assist-widget__chips`,children:o.length>0?o.map(e=>(0,P.jsx)(`button`,{onClick:()=>{b(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":y.includes(e),"aria-label":`${y.includes(e)?_(`deselect`):_(`select`)} ${e}`,className:`semiont-chip semiont-chip--selectable`,"data-selected":y.includes(e),children:e},e)):(0,P.jsx)(`p`,{className:`semiont-assist-widget__no-types`,children:_(`noEntityTypes`)})})]}),y.length>0&&(0,P.jsx)(`p`,{className:`semiont-assist-widget__count`,children:_(`typesSelected`,{count:y.length})}),(0,P.jsxs)(`div`,{className:`semiont-assist-widget__checkbox-group`,children:[(0,P.jsxs)(`label`,{className:`semiont-assist-widget__checkbox-label`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked),className:`semiont-assist-widget__checkbox`}),(0,P.jsx)(`span`,{children:_(`includeDescriptiveReferences`)})]}),(0,P.jsx)(`p`,{className:`semiont-assist-widget__checkbox-hint`,children:_(`descriptiveReferencesTooltip`)})]}),(0,P.jsxs)(`button`,{onClick:re,disabled:y.length===0,title:_(`annotate`),className:`semiont-button`,"data-variant":`assist`,"data-type":`reference`,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:_(`annotate`)})]})]})}),t&&n&&(0,P.jsx)(GN,{progress:n,annotationType:`reference`})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,P.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[_(`outgoingReferences`),` (`,j.length,`)`]})}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:j.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty-message`,children:_(`noReferences`)}):j.map(e=>(0,P.jsx)(QJ,{reference:e,isFocused:e.id===D,isHovered:e.id===p,routes:a,annotateMode:r,isGenerating:e.id===s,ref:t=>ne(e.id,t)},e.id))})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,P.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[_(`incomingReferences`),` (`,c.length,`)`,l&&(0,P.jsxs)(`span`,{className:`semiont-panel__loading-indicator`,children:[`(`,_(`loading`),`)`]})]})}),c.length>0?(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:c.map(e=>{let t=e.target.source;return(0,P.jsxs)(`div`,{className:`semiont-reference-item semiont-reference-item--incoming`,children:[(0,P.jsxs)(`div`,{className:`semiont-reference-item__header`,children:[(0,P.jsx)(`span`,{className:`semiont-reference-item__title`,children:e.resourceName||_(`untitledResource`)}),(0,P.jsx)(i,{href:a.resourceDetail(t),className:`semiont-reference-item__link`,title:_(`open`),children:`🔗`})]}),(0,P.jsxs)(`span`,{className:`semiont-reference-item__excerpt`,children:[`"`,e.target.selector?.exact||_(`noText`),`"`]})]},e.id)})}):(0,P.jsx)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:_(l?`loadingEllipsis`:`noIncomingReferences`)})]})]})]})}function tY({resourceId:e,documentEntityTypes:t,documentLocale:n,primaryMediaType:r,primaryByteSize:i,storageUri:a,isArchived:o=!1,dateCreated:s,dateModified:c,wasAttributedTo:l,wasDerivedFrom:u,generator:d}){let f=hh(`ResourceInfoPanel`),p=K(R().activeSession$),m=l?Array.isArray(l)?l:[l]:d?Array.isArray(d)?d:[d]:[];return(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__title`,children:f(`title`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`locale`)}),n?(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__value`,children:Eo(n)}):(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__value semiont-resource-info-panel__value--empty`,children:f(`notSpecified`)})]}),(r||i!==void 0)&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`representation`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[r&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`mediaType`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:r})]}),i!==void 0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`byteSize`)}),(0,P.jsxs)(`span`,{className:`semiont-resource-info-panel__value`,children:[i.toLocaleString(),` bytes`]})]}),a&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`storageUri`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:a})]})]})]}),(s||c||m.length>0||u)&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`provenance`)}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[s&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`createdAt`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(s).toLocaleString()})]}),c&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`modifiedAt`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(c).toLocaleString()})]}),m.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`attributedTo`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:m.map(AJ).join(`, `)})]}),u&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:f(`derivedFrom`)}),(0,P.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:(Array.isArray(u)?u:[u]).map((e,t)=>(0,P.jsxs)(`button`,{className:`semiont-resource-info-panel__link`,onClick:()=>p?.client.browse.navigateReference(Ra(e)),children:[t>0&&`, `,e]},e))})]})]})]}),t.length>0&&(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,P.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:f(`entityTypeTags`)}),(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__tag-list`,children:t.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},e))})]}),(0,P.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.yield.clone(),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`🔗 `,f(`clone`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`cloneDescription`)})]}),(0,P.jsx)(`div`,{className:`semiont-resource-info-panel__action-section`,children:o?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.mark.unarchive(Ra(e)),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`📤 `,f(`unarchive`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`unarchiveDescription`)})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{onClick:()=>p?.client.mark.archive(Ra(e)),className:`semiont-resource-button semiont-resource-button--archive`,children:[`📦 `,f(`archive`)]}),(0,P.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:f(`archiveDescription`)})]})})]})}function nY({highlights:e,comments:t,assessments:n,references:r,tags:i}){let a=hh(`StatisticsPanel`),o=r.filter(e=>!eo(e.body)).length,s=r.filter(e=>eo(e.body)).length,c=new Map;r.forEach(e=>{JJ(e).forEach(e=>{c.set(e,(c.get(e)||0)+1)})});let l=Array.from(c.entries()).sort((e,t)=>t[1]-e[1]);return(0,P.jsx)(`div`,{className:`semiont-statistics-panel`,children:(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__content`,children:[(0,P.jsx)(`h2`,{className:`semiont-statistics-panel__title`,children:a(`title`)}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__list`,children:[(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`highlights`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:e.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`comments`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:t.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`assessments`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:n.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`tags`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:i.length})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`references`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:r.length}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitems`,children:[(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`stub`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:o})]}),(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`resolved`)}),(0,P.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:s})]})]})]}),l.length>0&&(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__entity-types`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`entityTypes`)}),(0,P.jsx)(`div`,{className:`semiont-statistics-panel__entity-list`,children:l.map(([e,t])=>(0,P.jsxs)(`div`,{className:`semiont-statistics-panel__entity-item`,children:[(0,P.jsx)(`span`,{className:`semiont-statistics-panel__entity-name`,children:e}),(0,P.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:t})]},e))})]})]})]})})}function rY({tag:e,isFocused:t,isHovered:n=!1,ref:r}){let i=K(R().activeSession$),a=uE(e.id),o=uo(e),s=XJ(e),c=ZJ(e),l=K((0,m.useMemo)(()=>i?.client.browse.tagSchemas()??null,[i])),u=c&&l?l.find(e=>e.id===c)??null:null;return(0,P.jsxs)(`div`,{ref:r,onClick:()=>{i?.client.browse.click(e.id,e.motivation)},...a,className:`semiont-annotation-entry${n?` semiont-annotation-pulse`:``}`,"data-type":`tag`,"data-focused":t?`true`:`false`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,P.jsx)(`span`,{className:`semiont-tag-badge`,"data-variant":`tag`,children:s}),u&&(0,P.jsx)(`span`,{className:`semiont-annotation-entry__meta`,children:u.name})]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`tag`,children:[`"`,o.substring(0,150),o.length>150?`...`:``,`"`]}),e.generator&&(0,P.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(e.generator)?e.generator.map(AJ).join(`, `):AJ(e.generator)]})]})}function iY(e){if(Array.isArray(e)){let t=e.find(e=>e.type===`TextQuoteSelector`);if(t&&`exact`in t)return t.exact}else if(e.type===`TextQuoteSelector`&&`exact`in e)return e.exact;return null}function aY({annotations:e,annotateMode:t=!0,isAssisting:n=!1,progress:r,pendingAnnotation:i,scrollToAnnotationId:a,onScrollCompleted:o,hoveredAnnotationId:s,locale:c,sourceLanguage:l}){let u=hh(`TaggingPanel`),d=K(R().activeSession$),f=K((0,m.useMemo)(()=>d?.client.browse.tagSchemas()??null,[d])),p=f??[],h=f!==void 0&&f.length===0,[g,_]=(0,m.useState)(``),[v,y]=(0,m.useState)(new Set);(0,m.useEffect)(()=>{!g&&p.length>0&&_(p[0].id)},[p,g]);let[b,x]=(0,m.useState)(null),S=(0,m.useRef)(null),[C,w]=(0,m.useState)(()=>{if(typeof window>`u`)return!0;let e=localStorage.getItem(`assist-section-expanded-tag`);return e?e===`true`:!0});(0,m.useEffect)(()=>{typeof window>`u`||localStorage.setItem(`assist-section-expanded-tag`,String(C))},[C]),SE({"browse:click":(0,m.useCallback)(({annotationId:e})=>{x(e),setTimeout(()=>x(null),3e3)},[])});let T=(0,m.useRef)(new Map),E=(0,m.useMemo)(()=>[...e].sort((e,t)=>{let n=Xa(to(e.target)),r=Xa(to(t.target));return!n||!r?0:n.start-r.start}),[e]),D=(0,m.useCallback)((e,t)=>{t?T.current.set(e,t):T.current.delete(e)},[]);(0,m.useEffect)(()=>{if(!a)return;let e=T.current.get(a);if(e&&S.current){let t=e.offsetTop,n=S.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;S.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),o&&o()}},[a]),(0,m.useEffect)(()=>{if(!s)return;let e=T.current.get(s);if(!e||!S.current)return;let t=S.current,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(n.top>=r.top&&n.bottom<=r.bottom)){let n=e.offsetTop,r=t.clientHeight,i=e.offsetHeight,a=n-r/2+i/2;t.scrollTo({top:a,behavior:`smooth`})}},[s]);let O=p.find(e=>e.id===g),k=e=>{_(e),y(new Set)},A=e=>{let t=new Set(v);t.has(e)?t.delete(e):t.add(e),y(t)};return(0,m.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&d?.client.mark.cancelPending()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,d]),(0,P.jsxs)(`div`,{className:`semiont-panel`,children:[(0,P.jsx)(IJ,{annotationType:`tag`,count:e.length,title:u(`title`)}),(0,P.jsxs)(`div`,{ref:S,className:`semiont-panel__content`,children:[i&&i.motivation===`tagging`&&(0,P.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`tag`,children:[(0,P.jsx)(`h3`,{className:`semiont-annotation-prompt__title`,children:u(`createTagForSelection`)}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(0,P.jsx)(`p`,{className:`semiont-annotation-prompt__text`,children:(()=>{let e=iY(i.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:u(`fragmentSelected`)})()})}),h&&(0,P.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:u(`noSchemas`)}),!h&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectSchema`)}),(0,P.jsx)(`select`,{value:g,onChange:e=>k(e.target.value),className:`semiont-select`,children:p.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),O&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectCategory`)}),(0,P.jsxs)(`select`,{className:`semiont-select`,onChange:e=>{e.target.value&&i&&d?.client.mark.submit({motivation:`tagging`,selector:i.selector,body:[{type:`TextualBody`,value:e.target.value,purpose:`tagging`},{type:`TextualBody`,value:g,purpose:`classifying`}]})},defaultValue:``,children:[(0,P.jsx)(`option`,{value:``,children:u(`chooseCategory`)}),O.tags.map(e=>(0,P.jsx)(`option`,{value:e.name,children:e.name},e.name))]})]}),(0,P.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,P.jsx)(`button`,{onClick:()=>d?.client.mark.cancelPending(),className:`semiont-button semiont-button--secondary`,"data-type":`tag`,children:u(`cancel`)})})]}),t&&(0,P.jsxs)(`div`,{className:`semiont-panel__section`,children:[(0,P.jsxs)(`button`,{onClick:()=>w(!C),className:`semiont-panel__section-title semiont-panel__section-title--collapsible`,"aria-expanded":C,type:`button`,children:[(0,P.jsx)(`span`,{children:u(`annotateTags`)}),(0,P.jsx)(`span`,{className:`semiont-panel__section-chevron`,"data-expanded":C,children:`›`})]}),C&&(0,P.jsxs)(`div`,{className:`semiont-assist-widget`,"data-assisting":n&&r?`true`:`false`,"data-type":`tag`,children:[!n&&!r&&(0,P.jsxs)(P.Fragment,{children:[h&&(0,P.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:u(`noSchemas`)}),!h&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectSchema`)}),(0,P.jsx)(`select`,{value:g,onChange:e=>k(e.target.value),className:`semiont-select`,children:p.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))}),O&&(0,P.jsx)(`p`,{className:`semiont-form__help`,children:O.description})]}),O&&(0,P.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,P.jsx)(`label`,{className:`semiont-form-field__label`,children:u(`selectCategories`)}),(0,P.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`,marginBottom:`0.75rem`},children:[(0,P.jsx)(`button`,{onClick:()=>{O&&y(new Set(O.tags.map(e=>e.name)))},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:u(`selectAll`)}),(0,P.jsx)(`button`,{onClick:()=>{y(new Set)},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:u(`deselectAll`)})]}),(0,P.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`0.75rem`},children:O.tags.map(e=>(0,P.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,P.jsx)(`input`,{type:`checkbox`,id:`category-${e.name.replace(/\s+/g,`-`)}`,checked:v.has(e.name),onChange:()=>A(e.name),className:`semiont-checkbox`}),(0,P.jsxs)(`label`,{htmlFor:`category-${e.name.replace(/\s+/g,`-`)}`,className:`semiont-form__checkbox-label`,style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,P.jsx)(`span`,{style:{fontWeight:500},children:e.name}),(0,P.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-secondary)`},children:e.description})]})]},e.name))}),(0,P.jsx)(`p`,{className:`semiont-form__help`,children:u(`categoriesSelected`,{count:v.size})})]})]}),(0,P.jsxs)(`button`,{onClick:()=>{v.size>0&&(d?.client.mark.requestAssist(`tagging`,{schemaId:g,categories:Array.from(v),language:c,sourceLanguage:l}),y(new Set))},disabled:v.size===0||n,className:`semiont-button`,"data-variant":`assist`,"data-type":`tag`,children:[(0,P.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,P.jsx)(`span`,{children:u(`annotate`)})]}),n&&r&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress`,"data-type":`tag`,children:[r.requestParams&&r.requestParams.length>0&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__params`,"data-type":`tag`,children:[(0,P.jsx)(`div`,{className:`semiont-annotation-progress__params-title`,children:`Request Parameters:`}),r.requestParams.map((e,t)=>(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__param`,children:[(0,P.jsxs)(`span`,{className:`semiont-annotation-progress__param-label`,children:[e.label,`:`]}),` `,e.value]},t))]}),(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__status`,children:[(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__message`,children:[(0,P.jsx)(`span`,{className:`semiont-annotation-progress__icon`,children:`✨`}),(0,P.jsx)(`span`,{children:r.message})]}),r.currentCategory&&(0,P.jsxs)(`div`,{className:`semiont-annotation-progress__details`,children:[`Processing: `,r.currentCategory,r.processedCategories!==void 0&&r.totalCategories!==void 0&&(0,P.jsxs)(P.Fragment,{children:[` (`,r.processedCategories,`/`,r.totalCategories,`)`]})]})]}),r.percentage!==void 0&&(0,P.jsx)(`div`,{className:`semiont-progress-bar`,children:(0,P.jsx)(`div`,{className:`semiont-progress-bar__fill`,"data-type":`tag`,style:{width:`${r.percentage}%`}})})]})]})]}),(0,P.jsx)(`div`,{className:`semiont-panel__list`,children:E.length===0?(0,P.jsx)(`p`,{className:`semiont-panel__empty`,children:u(`noTags`)}):E.map(e=>(0,P.jsx)(rY,{tag:e,isFocused:e.id===b,isHovered:e.id===s,ref:t=>D(e.id,t)},e.id))})]})]})}var oY=[`statistics`,`reference`,`highlight`,`assessment`,`comment`,`tag`];function sY(e){let t=hh(`UnifiedAnnotationsPanel`),n={highlight:[],comment:[],assessment:[],reference:[],tag:[]};for(let t of e.annotations){let r=Object.values(e.annotators).find(e=>e.matchesAnnotation(t));r&&(n[r.internalType]||(n[r.internalType]=[]),n[r.internalType].push(t))}let r=n,[i,a]=(0,m.useState)(()=>{if(typeof window>`u`)return e.initialTab||`statistics`;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`,n=localStorage.getItem(t);return n&&oY.includes(n)?n:e.initialTab||`statistics`});(0,m.useEffect)(()=>{if(typeof window>`u`)return;let t=e.resourceId?`annotations-tab-${e.resourceId}`:`annotations-tab-global`;localStorage.setItem(t,i)},[i,e.resourceId]),(0,m.useEffect)(()=>{e.initialTab&&e.initialTabGeneration!==void 0&&a(e.initialTab)},[e.initialTabGeneration]),(0,m.useEffect)(()=>{if(e.pendingAnnotation){let t={linking:`reference`,commenting:`comment`,tagging:`tag`,assessing:`assessment`,highlighting:`highlight`}[e.pendingAnnotation.motivation];t&&a(t)}},[e.pendingAnnotation]);let o=e=>{a(e)},s=e=>`semiont-unified-panel__tab-button${i===e?` semiont-unified-panel__tab-button--active`:``}`;return(0,P.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,P.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,P.jsx)(`div`,{className:`semiont-unified-panel__tabs`,children:oY.map(n=>{if(n===`statistics`)return(0,P.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,P.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:`📊`})},n);let r=e.annotators[n];return r?(0,P.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,P.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:r.iconEmoji})},n):null})}),(0,P.jsx)(`div`,{className:`semiont-unified-panel__content`,children:(()=>{if(i===`statistics`)return(0,P.jsx)(nY,{highlights:r.highlight||[],comments:r.comment||[],assessments:r.assessment||[],references:r.reference||[],tags:r.tag||[]});let t=e.annotators[i];if(!t)return null;let n=r[i]||[],a=e.assistingMotivation===t.motivation,o=a?e.progress??null:null,s={annotations:n,pendingAnnotation:e.pendingAnnotation,isAssisting:a,progress:o,annotateMode:e.annotateMode,locale:e.locale,sourceLanguage:e.sourceLanguage,scrollToAnnotationId:e.scrollToAnnotationId,onScrollCompleted:e.onScrollCompleted,hoveredAnnotationId:e.hoveredAnnotationId};return i===`highlight`?(0,P.jsx)(KJ,{...s}):i===`reference`?(0,P.jsx)(eY,{annotations:s.annotations,pendingAnnotation:s.pendingAnnotation,isAssisting:s.isAssisting,progress:s.progress,annotateMode:s.annotateMode,scrollToAnnotationId:s.scrollToAnnotationId,onScrollCompleted:s.onScrollCompleted,hoveredAnnotationId:s.hoveredAnnotationId,locale:s.locale,sourceLanguage:s.sourceLanguage,allEntityTypes:e.allEntityTypes||[],generatingReferenceId:e.generatingReferenceId,referencedBy:e.referencedBy,referencedByLoading:e.referencedByLoading,Link:e.Link,routes:e.routes}):i===`assessment`?(0,P.jsx)(RJ,{...s}):i===`comment`?(0,P.jsx)(UJ,{...s}):i===`tag`?(0,P.jsx)(aY,{...s}):null})()})]})}function cY({Link:e,routes:t,t:n,CookiePreferences:r,onOpenKeyboardHelp:i,sourceCodeUrl:a=`https://github.com/The-AI-Alliance/semiont`,showPolicyLinks:o=!0}){let[s,c]=(0,m.useState)(!1);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`footer`,{role:`contentinfo`,className:`semiont-footer`,children:(0,P.jsx)(`div`,{className:`semiont-footer__container`,children:(0,P.jsxs)(`div`,{className:`semiont-footer__content`,children:[(0,P.jsx)(`div`,{className:`semiont-footer__copyright`,children:n(`copyright`,{year:new Date().getFullYear()})}),(0,P.jsxs)(`div`,{className:`semiont-footer__links`,children:[o&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(e,{href:t.about?.()||`/about`,className:`semiont-footer__link`,children:n(`about`)}),(0,P.jsx)(e,{href:t.privacy?.()||`/privacy`,className:`semiont-footer__link`,children:n(`privacyPolicy`)}),r&&(0,P.jsx)(`button`,{onClick:()=>c(!0),className:`semiont-footer__link`,children:n(`cookiePreferences`)}),(0,P.jsx)(e,{href:t.terms?.()||`/terms`,className:`semiont-footer__link`,children:n(`termsOfService`)})]}),i&&(0,P.jsxs)(`button`,{onClick:i,className:`semiont-footer__link semiont-footer__link--keyboard`,children:[n(`keyboardShortcuts`),(0,P.jsx)(`kbd`,{className:`semiont-footer__kbd`,children:`?`})]}),(0,P.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-footer__link`,children:n(`sourceCode`)})]})]})})}),o&&r&&(0,P.jsx)(r,{isOpen:s,onClose:()=>c(!1)})]})}function lY({Link:e,routes:t,t:n,isAdmin:r=!1,isModerator:i=!1,onItemClick:a,className:o=``,currentPath:s}){let c=o?`semiont-navigation-menu ${o}`:`semiont-navigation-menu`,l=e=>s?s===e||s.startsWith(e+`/`):!1;return(0,P.jsxs)(`nav`,{className:c,"aria-label":`Main navigation`,children:[(0,P.jsx)(e,{href:t.knowledge?.()||`/know`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.knowledge?.()||`/know`)?`page`:void 0,children:n(`know`)}),(i||r)&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,P.jsx)(e,{href:t.moderate?.()||`/moderate`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.moderate?.()||`/moderate`)?`page`:void 0,children:n(`moderate`)})]}),r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,P.jsx)(e,{href:t.admin?.()||`/admin`,...a&&{onClick:a},className:`semiont-navigation-menu__link`,"aria-current":l(t.admin?.()||`/admin`)?`page`:void 0,children:n(`administer`)})]})]})}function uY({title:e,items:t,currentPath:n,LinkComponent:r,dropdownContent:i,isCollapsed:a,icons:o,collapseSidebarLabel:s,expandSidebarLabel:c}){let l=o.chevronLeft,u=o.bars,[d,f]=(0,m.useState)(!1),p=(0,m.useRef)(null),h=R(),g=()=>f(!d),_=()=>f(!1);return(0,m.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&_()};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,P.jsxs)(`div`,{className:`semiont-simple-nav`,children:[(0,P.jsxs)(`div`,{style:{position:`relative`},ref:i?p:void 0,children:[(0,P.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[i?(0,P.jsx)(`button`,{onClick:g,className:`semiont-nav-section__header-button`,"aria-expanded":d,"aria-haspopup":`true`,type:`button`,children:!a&&(0,P.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e})}):!a&&(0,P.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e}),(0,P.jsx)(`button`,{onClick:()=>h.emit(`shell:sidebar-toggle`,void 0),className:`semiont-nav-section__header-icon`,title:a?c:s,"aria-label":a?c:s,type:`button`,children:a?(0,P.jsx)(u,{}):(0,P.jsx)(l,{})})]}),d&&i&&!a&&(0,P.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:i(_)})]}),!a&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,P.jsxs)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,children:[(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),a&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,P.jsx)(r,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,"aria-label":e.name,children:(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})})]})}function dY(){var e=[...arguments];return(0,m.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var fY=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function pY(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function mY(e){return`nodeType`in e}function hY(e){return e?pY(e)?e:mY(e)?e.ownerDocument?.defaultView??window:window:window}function gY(e){let{Document:t}=hY(e);return e instanceof t}function _Y(e){return pY(e)?!1:e instanceof hY(e).HTMLElement}function vY(e){return e instanceof hY(e).SVGElement}function yY(e){return e?pY(e)?e.document:mY(e)?gY(e)?e:_Y(e)||vY(e)?e.ownerDocument:document:document:document}var bY=fY?m.useLayoutEffect:m.useEffect;function xY(e){let t=(0,m.useRef)(e);return bY(()=>{t.current=e}),(0,m.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function SY(){let e=(0,m.useRef)(null);return[(0,m.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,m.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function CY(e,t){t===void 0&&(t=[e]);let n=(0,m.useRef)(e);return bY(()=>{n.current!==e&&(n.current=e)},t),n}function wY(e,t){let n=(0,m.useRef)();return(0,m.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function TY(e){let t=xY(e),n=(0,m.useRef)(null);return[n,(0,m.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function EY(e){let t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e},[e]),t.current}var DY={};function OY(e,t){return(0,m.useMemo)(()=>{if(t)return t;let n=DY[e]==null?0:DY[e]+1;return DY[e]=n,e+`-`+n},[e,t])}function kY(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var AY=kY(1),jY=kY(-1);function MY(e){return`clientX`in e&&`clientY`in e}function NY(e){if(!e)return!1;let{KeyboardEvent:t}=hY(e.target);return t&&e instanceof t}function PY(e){if(!e)return!1;let{TouchEvent:t}=hY(e.target);return t&&e instanceof t}function FY(e){if(PY(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return MY(e)?{x:e.clientX,y:e.clientY}:null}var IY=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[IY.Translate.toString(e),IY.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),LY=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function RY(e){return e.matches(LY)?e:e.querySelector(LY)}var zY={display:`none`};function BY(e){let{id:t,value:n}=e;return m.createElement(`div`,{id:t,style:zY},n)}function VY(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return m.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function HY(){let[e,t]=(0,m.useState)(``);return{announce:(0,m.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var UY=(0,m.createContext)(null);function WY(e){let t=(0,m.useContext)(UY);(0,m.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function GY(){let[e]=(0,m.useState)(()=>new Set),t=(0,m.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,m.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var KY={draggable:`
|
|
136
136
|
To pick up a draggable item, press the space bar.
|
|
137
137
|
While dragging, use the arrow keys to move the item.
|
|
138
138
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
139
139
|
`},qY={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function JY(e){let{announcements:t=qY,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=KY}=e,{announce:a,announcement:o}=HY(),s=OY(`DndLiveRegion`),[c,l]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{l(!0)},[]),WY((0,m.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=m.createElement(m.Fragment,null,m.createElement(BY,{id:r,value:i.draggable}),m.createElement(VY,{id:s,announcement:o}));return n?(0,h.createPortal)(u,n):u}var YY;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(YY||={});function XY(){}function ZY(e,t){return(0,m.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function QY(){var e=[...arguments];return(0,m.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var $Y=Object.freeze({x:0,y:0});function eX(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function tX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function nX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function rX(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function iX(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function aX(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var oX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=aX(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=eX(aX(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(tX)},sX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=rX(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=rX(r),o=i.reduce((e,t,r)=>e+eX(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(tX)};function cX(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var lX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=cX(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(nX)};function uX(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function dX(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:$Y}function fX(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var pX=fX(1);function mX(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function hX(e,t,n){let r=mX(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var gX={ignoreTransform:!1};function _X(e,t){t===void 0&&(t=gX);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=hY(e).getComputedStyle(e);t&&(n=hX(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function vX(e){return _X(e,{ignoreTransform:!0})}function yX(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function bX(e,t){return t===void 0&&(t=hY(e).getComputedStyle(e)),t.position===`fixed`}function xX(e,t){t===void 0&&(t=hY(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function SX(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(gY(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_Y(i)||vY(i)||n.includes(i))return n;let a=hY(e).getComputedStyle(i);return i!==e&&xX(i,a)&&n.push(i),bX(i,a)?n:r(i.parentNode)}return e?r(e):n}function CX(e){let[t]=SX(e,1);return t??null}function wX(e){return!fY||!e?null:pY(e)?e:mY(e)?gY(e)||e===yY(e).scrollingElement?window:_Y(e)?e:null:null}function TX(e){return pY(e)?e.scrollX:e.scrollLeft}function EX(e){return pY(e)?e.scrollY:e.scrollTop}function DX(e){return{x:TX(e),y:EX(e)}}var OX;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(OX||={});function kX(e){return!fY||!e?!1:e===document.scrollingElement}function AX(e){let t={x:0,y:0},n=kX(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var jX={x:.2,y:.2};function MX(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=jX);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=AX(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=OX.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=OX.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=OX.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=OX.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function NX(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function PX(e){return e.reduce((e,t)=>AY(e,DX(t)),$Y)}function FX(e){return e.reduce((e,t)=>e+TX(t),0)}function IX(e){return e.reduce((e,t)=>e+EX(t),0)}function LX(e,t){if(t===void 0&&(t=_X),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);CX(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var RX=[[`x`,[`left`,`right`],FX],[`y`,[`top`,`bottom`],IX]],zX=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=SX(t),r=PX(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of RX)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},BX=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function VX(e){let{EventTarget:t}=hY(e);return e instanceof t?e:yY(e)}function HX(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var UX;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(UX||={});function WX(e){e.preventDefault()}function GX(e){e.stopPropagation()}var KX;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(KX||={});var qX={start:[KX.Space,KX.Enter],cancel:[KX.Esc],end:[KX.Space,KX.Enter,KX.Tab]},JX=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case KX.Right:return{...n,x:n.x+25};case KX.Left:return{...n,x:n.x-25};case KX.Down:return{...n,y:n.y+25};case KX.Up:return{...n,y:n.y-25}}},YX=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new BX(yY(t)),this.windowListeners=new BX(hY(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(UX.Resize,this.handleCancel),this.windowListeners.add(UX.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(UX.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&LX(n),t($Y)}handleKeyDown(e){if(NY(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=qX,coordinateGetter:a=JX,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:$Y;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=jY(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=AX(n),p=NX(n),m={x:Math.min(i===KX.Right?p.right-p.width/2:p.right,Math.max(i===KX.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===KX.Down?p.bottom-p.height/2:p.bottom,Math.max(i===KX.Down?p.top:p.top+p.height/2,u.y))},h=i===KX.Right&&!s||i===KX.Left&&!c,g=i===KX.Down&&!l||i===KX.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===KX.Right&&e<=d.x||i===KX.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===KX.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===KX.Down&&e<=d.y||i===KX.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===KX.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,AY(jY(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};YX.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=qX,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function XX(e){return!!(e&&`distance`in e)}function ZX(e){return!!(e&&`delay`in e)}var QX=class{constructor(e,t,n){n===void 0&&(n=VX(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=yY(i),this.documentListeners=new BX(this.document),this.listeners=new BX(n),this.windowListeners=new BX(hY(i)),this.initialCoordinates=FY(r)??$Y,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(UX.Resize,this.handleCancel),this.windowListeners.add(UX.DragStart,WX),this.windowListeners.add(UX.VisibilityChange,this.handleCancel),this.windowListeners.add(UX.ContextMenu,WX),this.documentListeners.add(UX.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ZX(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(XX(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(UX.Click,GX,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(UX.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=FY(e)??$Y,s=jY(n,o);if(!t&&a){if(XX(a)){if(a.tolerance!=null&&HX(s,a.tolerance))return this.handleCancel();if(HX(s,a.distance))return this.handleStart()}if(ZX(a)&&HX(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===KX.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},$X={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},eZ=class extends QX{constructor(e){let{event:t}=e,n=yY(t.target);super(e,$X,n)}};eZ.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var tZ={move:{name:`mousemove`},end:{name:`mouseup`}},nZ;(function(e){e[e.RightClick=2]=`RightClick`})(nZ||={});var rZ=class extends QX{constructor(e){super(e,tZ,yY(e.event.target))}};rZ.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===nZ.RightClick?!1:(r?.({event:n}),!0)}}];var iZ={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},aZ=class extends QX{constructor(e){super(e,iZ)}static setup(){return window.addEventListener(iZ.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(iZ.move.name,e)};function e(){}}};aZ.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var oZ;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(oZ||={});var sZ;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(sZ||={});function cZ(e){let{acceleration:t,activator:n=oZ.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=sZ.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=uZ({delta:d,disabled:!a}),[h,g]=SY(),_=(0,m.useRef)({x:0,y:0}),v=(0,m.useRef)({x:0,y:0}),y=(0,m.useMemo)(()=>{switch(n){case oZ.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case oZ.DraggableRect:return i}},[n,i,c]),b=(0,m.useRef)(null),x=(0,m.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),S=(0,m.useMemo)(()=>s===sZ.TreeOrder?[...l].reverse():l,[s,l]);(0,m.useEffect)(()=>{if(!a||!l.length||!y){g();return}for(let e of S){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=MX(e,n,y,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){g(),b.current=e,h(x,o),_.current=a,v.current=i;return}}_.current={x:0,y:0},v.current={x:0,y:0},g()},[t,x,r,g,a,o,JSON.stringify(y),JSON.stringify(p),h,l,S,u,JSON.stringify(f)])}var lZ={x:{[OX.Backward]:!1,[OX.Forward]:!1},y:{[OX.Backward]:!1,[OX.Forward]:!1}};function uZ(e){let{delta:t,disabled:n}=e,r=EY(t);return wY(e=>{if(n||!r||!e)return lZ;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[OX.Backward]:e.x[OX.Backward]||i.x===-1,[OX.Forward]:e.x[OX.Forward]||i.x===1},y:{[OX.Backward]:e.y[OX.Backward]||i.y===-1,[OX.Forward]:e.y[OX.Forward]||i.y===1}}},[n,t,r])}function dZ(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return wY(e=>t==null?null:r??e??null,[r,t])}function fZ(e,t){return(0,m.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var pZ;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(pZ||={});var mZ;(function(e){e.Optimized=`optimized`})(mZ||={});var hZ=new Map;function gZ(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,m.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,m.useRef)(e),d=_(),f=CY(d),p=(0,m.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=(0,m.useRef)(null),g=wY(t=>{if(d&&!n)return hZ;if(!t||t===hZ||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new zX(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,m.useEffect)(()=>{u.current=e},[e]),(0,m.useEffect)(()=>{d||p()},[n,d]),(0,m.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,m.useEffect)(()=>{d||typeof s!=`number`||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},s))},[s,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:a!=null};function _(){switch(l){case pZ.Always:return!1;case pZ.BeforeDragging:return n;default:return!n}}}function _Z(e,t){return wY(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function vZ(e,t){return _Z(e,t)}function yZ(e){let{callback:t,disabled:n}=e,r=xY(t),i=(0,m.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,m.useEffect)(()=>()=>i?.disconnect(),[i]),i}function bZ(e){let{callback:t,disabled:n}=e,r=xY(t),i=(0,m.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,m.useEffect)(()=>()=>i?.disconnect(),[i]),i}function xZ(e){return new zX(_X(e),e)}function SZ(e,t,n){t===void 0&&(t=xZ);let[r,i]=(0,m.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=yZ({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=bZ({callback:a});return bY(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function CZ(e){return dX(e,_Z(e))}var wZ=[];function TZ(e){let t=(0,m.useRef)(e),n=wY(n=>e?n&&n!==wZ&&e&&t.current&&e.parentNode===t.current.parentNode?n:SX(e):wZ,[e]);return(0,m.useEffect)(()=>{t.current=e},[e]),n}function EZ(e){let[t,n]=(0,m.useState)(null),r=(0,m.useRef)(e),i=(0,m.useCallback)(e=>{let t=wX(e.target);t&&n(e=>e?(e.set(t,DX(t)),new Map(e)):null)},[]);return(0,m.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=wX(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,DX(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{wX(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,m.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>AY(e,t),$Y):PX(e):$Y,[e,t])}function DZ(e,t){t===void 0&&(t=[]);let n=(0,m.useRef)(null);return(0,m.useEffect)(()=>{n.current=null},t),(0,m.useEffect)(()=>{let t=e!==$Y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?jY(e,n.current):$Y}function OZ(e){(0,m.useEffect)(()=>{if(!fY)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function kZ(e,t){return(0,m.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function AZ(e){return(0,m.useMemo)(()=>e?yX(e):null,[e])}var jZ=[];function MZ(e,t){t===void 0&&(t=_X);let[n]=e,r=AZ(n?hY(n):null),[i,a]=(0,m.useState)(jZ);function o(){a(()=>e.length?e.map(e=>kX(e)?r:new zX(t(e),e)):jZ)}let s=bZ({callback:o});return bY(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function NZ(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _Y(t)?t:e}function PZ(e){let{measure:t}=e,[n,r]=(0,m.useState)(null),i=bZ({callback:(0,m.useCallback)(e=>{for(let{target:n}of e)if(_Y(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=TY((0,m.useCallback)(e=>{let n=NZ(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,m.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var FZ=[{sensor:eZ,options:{}},{sensor:YX,options:{}}],IZ={current:{}},LZ={draggable:{measure:vX},droppable:{measure:vX,strategy:pZ.WhileDragging,frequency:mZ.Optimized},dragOverlay:{measure:_X}},RZ=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},zZ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new RZ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:XY},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:LZ,measureDroppableContainers:XY,windowRect:null,measuringScheduled:!1},BZ=(0,m.createContext)({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:XY,draggableNodes:new Map,over:null,measureDroppableContainers:XY}),VZ=(0,m.createContext)(zZ);function HZ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new RZ}}}function UZ(e,t){switch(t.type){case YY.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case YY.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case YY.DragEnd:case YY.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case YY.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new RZ(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case YY.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new RZ(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case YY.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new RZ(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function WZ(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,m.useContext)(BZ),a=EY(r),o=EY(n?.id);return(0,m.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!NY(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=RY(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function GZ(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function KZ(e){return(0,m.useMemo)(()=>({draggable:{...LZ.draggable,...e?.draggable},droppable:{...LZ.droppable,...e?.droppable},dragOverlay:{...LZ.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function qZ(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,m.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;bY(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=dX(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=CX(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var JZ=(0,m.createContext)({...$Y,scaleX:1,scaleY:1}),YZ;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(YZ||={});var XZ=(0,m.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=FZ,collisionDetection:o=lX,measuring:s,modifiers:c,...l}=e,[u,d]=(0,m.useReducer)(UZ,void 0,HZ),[f,p]=GY(),[g,_]=(0,m.useState)(YZ.Uninitialized),v=g===YZ.Initialized,{draggable:{active:y,nodes:b,translate:x},droppable:{containers:S}}=u,C=y==null?null:b.get(y),w=(0,m.useRef)({initial:null,translated:null}),T=(0,m.useMemo)(()=>y==null?null:{id:y,data:C?.data??IZ,rect:w},[y,C]),E=(0,m.useRef)(null),[D,O]=(0,m.useState)(null),[k,A]=(0,m.useState)(null),ee=CY(l,Object.values(l)),te=OY(`DndDescribedBy`,t),j=(0,m.useMemo)(()=>S.getEnabled(),[S]),ne=KZ(s),{droppableRects:re,measureDroppableContainers:ie,measuringScheduled:ae}=gZ(j,{dragging:v,dependencies:[x.x,x.y],config:ne.droppable}),M=dZ(b,y),oe=(0,m.useMemo)(()=>k?FY(k):null,[k]),se=Le(),ce=vZ(M,ne.draggable.measure);qZ({activeNode:y==null?null:b.get(y),config:se.layoutShiftCompensation,initialRect:ce,measure:ne.draggable.measure});let le=SZ(M,ne.draggable.measure,ce),ue=SZ(M?M.parentElement:null),N=(0,m.useRef)({activatorEvent:null,active:null,activeNode:M,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=S.getNodeFor(N.current.over?.id),fe=PZ({measure:ne.dragOverlay.measure}),pe=fe.nodeRef.current??M,me=v?fe.rect??le:null,he=!!(fe.nodeRef.current&&fe.rect),ge=CZ(he?null:le),_e=AZ(pe?hY(pe):null),ve=TZ(v?de??M:null),ye=MZ(ve),be=GZ(c,{transform:{x:x.x-ge.x,y:x.y-ge.y,scaleX:1,scaleY:1},activatorEvent:k,active:T,activeNodeRect:le,containerNodeRect:ue,draggingNodeRect:me,over:N.current.over,overlayNodeRect:fe.rect,scrollableAncestors:ve,scrollableAncestorRects:ye,windowRect:_e}),xe=oe?AY(oe,x):null,Se=EZ(ve),Ce=DZ(Se),we=DZ(Se,[le]),Te=AY(be,Ce),Ee=me?pX(me,be):null,De=T&&Ee?o({active:T,collisionRect:Ee,droppableRects:re,droppableContainers:j,pointerCoordinates:xe}):null,Oe=iX(De,`id`),[ke,Ae]=(0,m.useState)(null),je=uX(he?be:AY(be,we),ke?.rect??null,le),Me=(0,m.useRef)(null),Ne=(0,m.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(E.current==null)return;let i=b.get(E.current);if(!i)return;let a=e.nativeEvent;Me.current=new n({active:E.current,activeNode:i,event:a,options:r,context:N,onAbort(e){if(!b.get(e))return;let{onDragAbort:t}=ee.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!b.get(e))return;let{onDragPending:i}=ee.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=E.current;if(t==null)return;let n=b.get(t);if(!n)return;let{onDragStart:r}=ee.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:w}};(0,h.unstable_batchedUpdates)(()=>{r?.(i),_(YZ.Initializing),d({type:YY.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),O(Me.current),A(a)})},onMove(e){d({type:YY.DragMove,coordinates:e})},onEnd:o(YY.DragEnd),onCancel:o(YY.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=N.current,o=null;if(t&&i){let{cancelDrop:s}=ee.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===YY.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=YY.DragCancel)}E.current=null,(0,h.unstable_batchedUpdates)(()=>{d({type:e}),_(YZ.Uninitialized),Ae(null),O(null),A(null),Me.current=null;let t=e===YY.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=ee.current[t];e?.(o),f({type:t,event:o})}})}}},[b]),Pe=fZ(a,(0,m.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=b.get(r);if(E.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},E.current=r,Ne(n,t))},[b,Ne]));OZ(a),bY(()=>{le&&g===YZ.Initializing&&_(YZ.Initialized)},[le,g]),(0,m.useEffect)(()=>{let{onDragMove:e}=ee.current,{active:t,activatorEvent:n,collisions:r,over:i}=N.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:Te.x,y:Te.y},over:i};(0,h.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[Te.x,Te.y]),(0,m.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=N.current;if(!e||E.current==null||!t||!i)return;let{onDragOver:a}=ee.current,o=r.get(Oe),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,h.unstable_batchedUpdates)(()=>{Ae(s),a?.(c),f({type:`onDragOver`,event:c})})},[Oe]),bY(()=>{N.current={activatorEvent:k,active:T,activeNode:M,collisionRect:Ee,collisions:De,droppableRects:re,draggableNodes:b,draggingNode:pe,draggingNodeRect:me,droppableContainers:S,over:ke,scrollableAncestors:ve,scrollAdjustedTranslate:Te},w.current={initial:me,translated:Ee}},[T,M,De,Ee,b,pe,me,re,S,ke,ve,Te]),cZ({...se,delta:x,draggingRect:Ee,pointerCoordinates:xe,scrollableAncestors:ve,scrollableAncestorRects:ye});let Fe=(0,m.useMemo)(()=>({active:T,activeNode:M,activeNodeRect:le,activatorEvent:k,collisions:De,containerNodeRect:ue,dragOverlay:fe,draggableNodes:b,droppableContainers:S,droppableRects:re,over:ke,measureDroppableContainers:ie,scrollableAncestors:ve,scrollableAncestorRects:ye,measuringConfiguration:ne,measuringScheduled:ae,windowRect:_e}),[T,M,le,k,De,ue,fe,b,S,re,ke,ie,ve,ye,ne,ae,_e]),Ie=(0,m.useMemo)(()=>({activatorEvent:k,activators:Pe,active:T,activeNodeRect:le,ariaDescribedById:{draggable:te},dispatch:d,draggableNodes:b,over:ke,measureDroppableContainers:ie}),[k,Pe,T,le,d,te,b,ke,ie]);return m.createElement(UY.Provider,{value:p},m.createElement(BZ.Provider,{value:Ie},m.createElement(VZ.Provider,{value:Fe},m.createElement(JZ.Provider,{value:je},i)),m.createElement(WZ,{disabled:n?.restoreFocus===!1})),m.createElement(JY,{...n,hiddenTextDescribedById:te}));function Le(){let e=D?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=v&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),ZZ=(0,m.createContext)(null),QZ=`button`,$Z=`Draggable`;function eQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=OY($Z),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,m.useContext)(BZ),{role:p=QZ,roleDescription:h=`draggable`,tabIndex:g=0}=i??{},_=c?.id===t,v=(0,m.useContext)(_?JZ:ZZ),[y,b]=TY(),[x,S]=TY(),C=kZ(o,t),w=CY(n);return bY(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,m.useMemo)(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":_&&p===QZ?!0:void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[r,p,g,_,h,u.draggable]),isDragging:_,listeners:r?void 0:C,node:y,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:v}}function tQ(){return(0,m.useContext)(VZ)}var nQ=`Droppable`,rQ={timeout:25};function iQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=OY(nQ),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,m.useContext)(BZ),u=(0,m.useRef)({disabled:n}),d=(0,m.useRef)(!1),f=(0,m.useRef)(null),p=(0,m.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...rQ,...i},v=CY(g??r),y=bZ({callback:(0,m.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),p.current=null},_)},[_]),disabled:h||!o}),[b,x]=TY((0,m.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y])),S=CY(t);return(0,m.useEffect)(()=>{!y||!b.current||(y.disconnect(),d.current=!1,y.observe(b.current))},[b,y]),(0,m.useEffect)(()=>(s({type:YY.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:YY.UnregisterDroppable,key:a,id:r})),[r]),(0,m.useEffect)(()=>{n!==u.current.disabled&&(s({type:YY.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function aQ(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function oQ(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function sQ(e){return e!==null&&e>=0}function cQ(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function lQ(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var uQ=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=aQ(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},dQ={scaleX:1,scaleY:1},fQ=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...dQ}:null}let s=pQ(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...dQ}:r<t&&r>=a?{x:0,y:o.height+s,...dQ}:{x:0,y:0,...dQ}};function pQ(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var mQ=`Sortable`,hQ=m.createContext({activeIndex:-1,containerId:mQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:uQ,disabled:{draggable:!1,droppable:!1}});function gQ(e){let{children:t,id:n,items:r,strategy:i=uQ,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=tQ(),d=OY(mQ,n),f=s.rect!==null,p=(0,m.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),h=o!=null,g=o?p.indexOf(o.id):-1,_=l?p.indexOf(l.id):-1,v=(0,m.useRef)(p),y=!cQ(p,v.current),b=_!==-1&&g===-1||y,x=lQ(a);bY(()=>{y&&h&&u(p)},[y,p,h,u]),(0,m.useEffect)(()=>{v.current=p},[p]);let S=(0,m.useMemo)(()=>({activeIndex:g,containerId:d,disabled:x,disableTransforms:b,items:p,overIndex:_,useDragOverlay:f,sortedRects:oQ(p,c),strategy:i}),[g,d,x.draggable,x.droppable,b,p,_,c,f,i]);return m.createElement(hQ.Provider,{value:S},t)}var _Q=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return aQ(n,r,i).indexOf(t)},vQ=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},yQ={duration:200,easing:`ease`},bQ=`transform`,xQ=IY.Transition.toString({property:bQ,duration:0,easing:`linear`}),SQ={roleDescription:`sortable`};function CQ(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,m.useState)(null),s=(0,m.useRef)(n);return bY(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=_X(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,m.useEffect)(()=>{a&&o(null)},[a]),a}function wQ(e){let{animateLayoutChanges:t=vQ,attributes:n,disabled:r,data:i,getNewIndex:a=_Q,id:o,strategy:s,resizeObserverConfig:c,transition:l=yQ}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:h,sortedRects:g,overIndex:_,useDragOverlay:v,strategy:y}=(0,m.useContext)(hQ),b=TQ(r,p),x=u.indexOf(o),S=(0,m.useMemo)(()=>({sortable:{containerId:d,index:x,items:u},...i}),[d,i,x,u]),C=(0,m.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=iQ({id:o,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:ee,setNodeRef:te,listeners:j,isDragging:ne,over:re,setActivatorNodeRef:ie,transform:ae}=eQ({id:o,data:S,attributes:{...SQ,...n},disabled:b.draggable}),M=dY(D,te),oe=!!O,se=oe&&!h&&sQ(f)&&sQ(_),ce=!v&&ne,le=se?(ce&&se?ae:null)??(s??y)({rects:g,activeNodeRect:A,activeIndex:f,overIndex:_,index:x}):null,ue=sQ(f)&&sQ(_)?a({id:o,items:u,activeIndex:f,overIndex:_}):x,N=O?.id,de=(0,m.useRef)({activeId:N,items:u,newIndex:ue,containerId:d}),fe=u!==de.current.items,pe=t({active:O,containerId:d,isDragging:ne,isSorting:oe,id:o,index:x,items:u,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:l,wasDragging:de.current.activeId!=null}),me=CQ({disabled:!pe,index:x,node:T,rect:w});return(0,m.useEffect)(()=>{oe&&de.current.newIndex!==ue&&(de.current.newIndex=ue),d!==de.current.containerId&&(de.current.containerId=d),u!==de.current.items&&(de.current.items=u)},[oe,ue,d,u]),(0,m.useEffect)(()=>{if(N===de.current.activeId)return;if(N!=null&&de.current.activeId==null){de.current.activeId=N;return}let e=setTimeout(()=>{de.current.activeId=N},50);return()=>clearTimeout(e)},[N]),{active:O,activeIndex:f,attributes:ee,data:S,rect:w,index:x,newIndex:ue,items:u,isOver:E,isSorting:oe,isDragging:ne,listeners:j,node:T,overIndex:_,over:re,setNodeRef:M,setActivatorNodeRef:ie,setDroppableNodeRef:D,setDraggableNodeRef:te,transform:me??le,transition:he()};function he(){if(me||fe&&de.current.newIndex===x)return xQ;if(!(ce&&!NY(k)||!l)&&(oe||pe))return IY.Transition.toString({...l,property:bQ})}}function TQ(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function EQ(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var DQ=[KX.Down,KX.Right,KX.Up,KX.Left],OQ=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(DQ.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case KX.Down:r.top<a.top&&t.push(n);break;case KX.Up:r.top>a.top&&t.push(n);break;case KX.Left:r.left>a.left&&t.push(n);break;case KX.Right:r.left<a.left&&t.push(n);break}});let c=sX({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=iX(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=SX(c).some((e,t)=>s[t]!==e),i=kQ(e,t),a=AQ(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:jY(u,l)}}}};function kQ(e,t){return!EQ(e)||!EQ(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function AQ(e,t){return!EQ(e)||!EQ(t)||!kQ(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function jQ({resource:e,isCollapsed:t,isActive:n,href:r,onClose:i,onReorder:a,index:o,totalCount:s,LinkComponent:c,translations:l={},isDragging:u=!1}){let{attributes:d,listeners:f,setNodeRef:p,transform:h,transition:g,isDragging:_}=wQ({id:e.id}),v=(0,m.useRef)(a);(0,m.useEffect)(()=>{v.current=a});let y={transform:IY.Transform.toString(h),transition:g,opacity:_||u?.5:1},b=tE(e.mediaType),x=_||u,S=e.storageUri?e.storageUri.replace(/^file:\/\//,``):e.name,C=(0,m.useCallback)(t=>{v.current&&t.altKey&&(t.key===`ArrowUp`?(t.preventDefault(),v.current(e.id,`up`)):t.key===`ArrowDown`&&(t.preventDefault(),v.current(e.id,`down`)))},[e.id]);return(0,P.jsxs)(`div`,{ref:p,style:y,...d,...f,"aria-selected":n,onKeyDown:C,"aria-label":`${e.name}, position ${o===void 0?``:o+1} of ${s||``}`,className:`semiont-resource-tab ${n?`semiont-resource-tab--active`:``} ${x?`semiont-resource-tab--dragging`:``}`,role:`tab`,children:[(0,P.jsxs)(c,{href:r,className:`semiont-resource-tab__link`,title:S,children:[(0,P.jsx)(`span`,{className:`semiont-resource-tab__icon`,"aria-hidden":`true`,children:b}),!t&&(0,P.jsx)(`span`,{className:`semiont-resource-tab__text`,children:e.name})]}),!t&&(0,P.jsx)(`button`,{onClick:t=>i(e.id,t),className:`semiont-resource-tab__close`,title:l.closeResource||`Close resource`,"aria-label":`Close ${e.name}`,type:`button`,children:(0,P.jsx)(`svg`,{fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,width:`16`,height:`16`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function MQ(){let{announce:e}=wE();return{announceReorder:(0,m.useCallback)(t=>{e(t,`assertive`)},[e]),announcePickup:(0,m.useCallback)((t,n,r)=>{e(`Picked up ${t}. Position ${n} of ${r}. Use arrow keys to move, space to drop.`,`assertive`)},[e]),announceDrop:(0,m.useCallback)((t,n,r)=>{e(`Dropped ${t} at position ${n} of ${r}.`,`assertive`)},[e]),announceMove:(0,m.useCallback)((t,n,r,i)=>{e(`Moved ${t} ${n} to position ${r} of ${i}.`,`polite`)},[e]),announceKeyboardReorder:(0,m.useCallback)((t,n,r,i)=>{e(`${t} moved ${n} to position ${r} of ${i}.`,`assertive`)},[e]),announceCannotMove:(0,m.useCallback)(t=>{e(`Cannot move ${t}. Already at the ${t===`up`?`top`:`bottom`} of the list.`,`polite`)},[e])}}function NQ({fixedItems:e,resources:t,isCollapsed:n,currentPath:r,LinkComponent:i,onNavigate:a,getResourceHref:o,className:s=``,translations:c={},icons:l,navigationMenu:u}){let d=l.chevronLeft,f=l.bars,[p,h]=(0,m.useState)(!1),g=(0,m.useRef)(null),{announcePickup:_,announceDrop:v,announceKeyboardReorder:y,announceCannotMove:b}=MQ(),x=hh(`CollapsibleResourceNavigation`),S=R(),C={title:c?.title||x(`title`),collapseSidebar:c?.collapseSidebar||x(`collapseSidebar`),expandSidebar:c?.expandSidebar||x(`expandSidebar`),dragToReorder:c?.dragToReorder||x(`dragToReorder`),dragToReorderDoc:c?.dragToReorderDoc||x(`dragToReorderDoc`),closeResource:c?.closeResource||x(`closeResource`),dragInstructions:c?.dragInstructions||x(`dragInstructions`)},w=()=>h(!p),T=()=>h(!1);(0,m.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&T()};if(p)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]);let E=QY(ZY(eZ,{activationConstraint:{distance:8}}),ZY(YX,{coordinateGetter:OQ})),D=(0,m.useCallback)((e,n)=>{let r=t.findIndex(t=>t.id===e);if(r===-1)return;let i=n===`up`?r-1:r+1;if(i<0||i>=t.length){b(n);return}S.emit(`tabs:reorder`,{oldIndex:r,newIndex:i});let a=t[r];y(a.name,n,i+1,t.length)},[t,S]),O=(t,n)=>{n.preventDefault(),n.stopPropagation(),S.emit(`tabs:close`,{resourceId:t}),r===o(t)&&a&&e.length>0&&a(e[0].href)};return(0,P.jsxs)(`div`,{className:`semiont-collapsible-nav ${s}`,children:[(0,P.jsx)(`div`,{id:`drag-instructions`,className:`sr-only`,"aria-live":`polite`,children:C.dragInstructions}),(0,P.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-atomic":`true`,children:`Resources can be reordered using Alt+Up or Alt+Down arrow keys.`}),(0,P.jsxs)(`div`,{className:`semiont-collapsible-nav__container`,children:[(0,P.jsxs)(`div`,{style:{position:`relative`},ref:u?g:void 0,children:[(0,P.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[!n&&u&&(0,P.jsx)(`button`,{onClick:w,className:`semiont-nav-section__header-text`,"aria-expanded":p,"aria-haspopup":`true`,type:`button`,children:C.title}),!n&&!u&&(0,P.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:C.title}),(0,P.jsx)(`button`,{onClick:()=>S.emit(`shell:sidebar-toggle`,void 0),className:`semiont-nav-section__header-icon`,title:n?C.expandSidebar:C.collapseSidebar,"aria-label":n?C.expandSidebar:C.collapseSidebar,type:`button`,children:n?(0,P.jsx)(f,{}):(0,P.jsx)(d,{})})]}),p&&u&&!n&&(0,P.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:u(T)})]}),!n&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,P.jsxs)(i,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,children:[(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),n&&(0,P.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,P.jsx)(i,{href:e.href,className:`semiont-nav-tab ${t?`semiont-nav-tab--active`:``}`,title:e.description||e.name,"aria-current":t?`page`:void 0,"aria-label":e.name,children:(0,P.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})}),(0,P.jsx)(`div`,{className:`semiont-resource-tabs`,role:`tablist`,"aria-label":`Open resources`,children:n?t.map(e=>{let t=o(e.id);return(0,P.jsx)(jQ,{resource:e,isCollapsed:n,isActive:r===t,href:t,onClose:O,LinkComponent:i,translations:{dragToReorder:C.dragToReorder,dragToReorderDoc:C.dragToReorderDoc,closeResource:C.closeResource}},e.id)}):(0,P.jsx)(XZ,{sensors:E,collisionDetection:oX,onDragStart:e=>{let{active:n}=e,r=t.find(e=>e.id===n.id);if(r){let e=t.indexOf(r);_(r.name,e+1,t.length)}},onDragEnd:e=>{let{active:n,over:r}=e;if(r&&n.id!==r.id){let e=t.findIndex(e=>e.id===n.id),i=t.findIndex(e=>e.id===r.id);if(e!==-1&&i!==-1){S.emit(`tabs:reorder`,{oldIndex:e,newIndex:i});let n=t[e];v(n.name,i+1,t.length)}}},children:(0,P.jsx)(gQ,{items:t.map(e=>e.id),strategy:fQ,children:t.map((e,a)=>{let s=o(e.id);return(0,P.jsx)(jQ,{resource:e,isCollapsed:n,isActive:r===s,href:s,onClose:O,onReorder:D,index:a,totalCount:t.length,LinkComponent:i,translations:{dragToReorder:C.dragToReorder,dragToReorderDoc:C.dragToReorderDoc,closeResource:C.closeResource}},e.id)})})})})]})]})}function PQ({context:e,translations:t}){let n=e.graphContext,r=n?.connections??[],i=n?.citedBy??[],a=n?.citedByCount??0;return(0,P.jsx)(P.Fragment,{children:n&&(r.length>0||a>0)&&(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1rem`},children:[r.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--semiont-text-tertiary)`,marginBottom:`0.375rem`},children:t.connectionsLabel}),(0,P.jsx)(`ul`,{style:{display:`flex`,flexDirection:`column`,gap:`0.375rem`,listStyle:`none`,padding:0,margin:0},children:r.map(e=>(0,P.jsxs)(`li`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:`0.375rem`,fontSize:`var(--semiont-text-sm)`},children:[(0,P.jsx)(`span`,{style:{color:`var(--semiont-text-primary)`,fontWeight:500},children:e.resourceName}),e.bidirectional&&(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`},children:`mutual`}),e.entityTypes&&e.entityTypes.map(e=>(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`},children:e},e))]},e.resourceId))})]}),a>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`,color:`var(--semiont-text-tertiary)`,marginBottom:`0.375rem`},children:[t.citedByLabel,` (`,a,`)`]}),i.length>0&&(0,P.jsx)(`ul`,{style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`,listStyle:`none`,padding:0,margin:0},children:i.map(e=>(0,P.jsx)(`li`,{style:{fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-primary)`,fontWeight:500},children:e.resourceName},e.resourceId))})]})]})})}function FQ({context:e,contextLoading:t,contextError:n,userHint:r,onUserHintChange:i,onBind:a,onGenerate:o,onCompose:s,translations:c}){let[l,u]=(0,m.useState)(!1),d=!t&&!n&&!!e,f=e?.sourceContext,p=(0,m.useRef)(null);return(0,m.useEffect)(()=>{p.current&&p.current.scrollIntoView({block:`center`,behavior:`instant`})},[e]),(0,P.jsxs)(`div`,{className:`semiont-gather__outer`,children:[t&&(0,P.jsxs)(`div`,{className:`semiont-gather__loading`,children:[(0,P.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`},children:[(0,P.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,P.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,P.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,P.jsx)(`span`,{className:`semiont-gather__loading-text`,children:c.loadingContext})]}),!!n&&(0,P.jsx)(`div`,{style:{textAlign:`center`,padding:`1rem 0`,color:`var(--semiont-color-red-600)`},children:c.failedContext}),e&&(0,P.jsxs)(P.Fragment,{children:[f&&(0,P.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,P.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:`0.375rem`},children:[c.sourceContextLabel,e.sourceResource?.name?` "${e.sourceResource.name}"`:``]}),(0,P.jsxs)(`div`,{className:`semiont-gather__source-box${l?` semiont-gather__source-box--expanded`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,P.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[f.before&&(0,P.jsx)(`span`,{children:f.before}),(0,P.jsx)(`span`,{ref:p,style:{backgroundColor:`var(--semiont-color-primary-100)`,padding:`0 0.25rem`,fontWeight:600,color:`var(--semiont-color-primary-900)`},children:f.selected}),(e.metadata?.entityTypes??[]).map(e=>(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400,verticalAlign:`middle`,marginLeft:`0.25rem`},children:e},e)),e.annotation?.motivation&&(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400,verticalAlign:`middle`,marginLeft:`0.25rem`},children:e.annotation.motivation}),f.after&&(0,P.jsx)(`span`,{children:f.after})]})}),(0,P.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>u(e=>!e),children:l?`▲ less`:`▼ more`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-gather__body`,children:[(0,P.jsx)(`div`,{className:`semiont-gather__left`,children:(0,P.jsx)(PQ,{context:e,translations:c})}),(0,P.jsx)(`div`,{className:`semiont-gather__right`,children:(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{className:`semiont-form__label`,children:c.userHintLabel}),(0,P.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:c.userHintPlaceholder,className:`semiont-search-modal__search-input semiont-gather__hint-textarea`,style:{resize:`vertical`,fontFamily:`inherit`}})]})})]}),(0,P.jsxs)(`div`,{className:`semiont-gather__footer`,children:[(0,P.jsx)(`div`,{className:`semiont-gather__footer-label`,children:c.resolutionStrategyLabel}),(0,P.jsxs)(`div`,{className:`semiont-gather__actions`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:a,disabled:!d,className:`semiont-button--primary semiont-button--flex`,children:[`🔍 `,c.search,`…`]}),(0,P.jsxs)(`button`,{type:`button`,onClick:o,disabled:!d,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,c.generate,`…`]}),(0,P.jsxs)(`button`,{type:`button`,onClick:s,disabled:!d,className:`semiont-button--secondary semiont-button--flex`,children:[`✍️ `,c.compose]})]})]})]})]})}function IQ({defaultTitle:e,locale:t,context:n,onBack:r,onCancel:i,onGenerate:a,translations:o}){let[s,c]=(0,m.useState)(e),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(``),[p,h]=(0,m.useState)(t),[g,_]=(0,m.useState)(.7),[v,y]=(0,m.useState)(500);return(0,P.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=d.trim();a({title:s,storagePath:`file://${l}`,...t?{prompt:t}:{},language:p,temperature:g,maxTokens:v,context:n})},className:`semiont-form semiont-form--scrollable`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-title`,className:`semiont-form__label`,children:o.resourceTitle}),(0,P.jsx)(`input`,{id:`wizard-title`,type:`text`,value:s,onChange:e=>c(e.target.value),required:!0,className:`semiont-input`,placeholder:o.resourceTitlePlaceholder})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,P.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,P.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,P.jsx)(`input`,{id:`wizard-storagePath`,type:`text`,value:l,onChange:e=>u(e.target.value),required:!0,className:`semiont-input semiont-input--addon`,placeholder:`generated/my-resource.md`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-prompt`,className:`semiont-form__label`,children:o.additionalInstructions}),(0,P.jsx)(`textarea`,{id:`wizard-prompt`,value:d,onChange:e=>f(e.target.value),rows:2,className:`semiont-textarea`,placeholder:o.additionalInstructionsPlaceholder})]}),(0,P.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-language`,className:`semiont-form__label`,children:o.language}),(0,P.jsx)(`select`,{id:`wizard-language`,value:p,onChange:e=>h(e.target.value),className:`semiont-select`,children:Co.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--grow`,children:[(0,P.jsxs)(`label`,{htmlFor:`wizard-temperature`,className:`semiont-form__label`,children:[o.creativity,` (`,g.toFixed(1),`)`]}),(0,P.jsx)(`input`,{id:`wizard-temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,value:g,onChange:e=>_(parseFloat(e.target.value)),className:`semiont-slider`}),(0,P.jsxs)(`div`,{className:`semiont-slider__labels semiont-slider__labels--small`,children:[(0,P.jsx)(`span`,{children:o.creativityFocused}),(0,P.jsx)(`span`,{children:o.creativityCreative})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-maxTokens`,className:`semiont-form__label`,children:o.maxLength}),(0,P.jsx)(`input`,{id:`wizard-maxTokens`,type:`number`,min:`100`,max:`4000`,step:`100`,value:v,onChange:e=>y(parseInt(e.target.value)),className:`semiont-input`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,P.jsxs)(`button`,{type:`button`,onClick:i,className:`semiont-button--secondary semiont-button--flex`,children:[`✕ `,o.cancel]}),(0,P.jsxs)(`button`,{type:`button`,onClick:r,className:`semiont-button--secondary semiont-button--flex`,children:[`◀ `,o.back]}),(0,P.jsxs)(`button`,{type:`submit`,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,o.generate]})]})]})}function LQ({isSearching:e=!1,onBack:t,onCancel:n,onSearch:r,translations:i}){let[a,o]=(0,m.useState)(10),[s,c]=(0,m.useState)(!0);return(0,P.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),r({limit:a,useSemanticScoring:s})},className:`semiont-form`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`wizard-limit`,className:`semiont-form__label`,children:i.maxResults}),(0,P.jsxs)(`select`,{id:`wizard-limit`,value:a,onChange:e=>o(parseInt(e.target.value)),className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:1,children:`1`}),(0,P.jsx)(`option`,{value:5,children:`5`}),(0,P.jsx)(`option`,{value:10,children:`10`}),(0,P.jsx)(`option`,{value:20,children:`20`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsxs)(`label`,{className:`semiont-form__label`,style:{display:`flex`,alignItems:`center`,gap:`0.5rem`},children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),i.semanticScoring]}),(0,P.jsx)(`p`,{className:`semiont-form__help`,children:i.semanticScoringHelp})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,P.jsxs)(`button`,{type:`button`,onClick:n,className:`semiont-button--secondary semiont-button--flex`,disabled:e,children:[`✕ `,i.cancel]}),(0,P.jsxs)(`button`,{type:`button`,onClick:t,className:`semiont-button--secondary semiont-button--flex`,disabled:e,children:[`◀ `,i.back]}),(0,P.jsx)(`button`,{type:`submit`,className:`semiont-button--primary semiont-button--flex`,disabled:e,"data-generating":e?`true`:`false`,children:e?`\u2728 ${i.searching}`:`\u{1F50D} ${i.search}`})]})]})}function RQ({results:e,context:t,onLink:n,onBack:r,onCancel:i,translations:a}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`semiont-search-results__two-pane`,children:[(0,P.jsx)(`div`,{className:`semiont-search-results__context-pane`,children:(0,P.jsx)(PQ,{context:t,translations:a})}),(0,P.jsx)(`div`,{className:`semiont-search-results__results-pane`,children:e.length===0?(0,P.jsx)(`div`,{className:`semiont-modal__empty-state`,style:{textAlign:`center`,padding:`2rem 0`},children:a.noResults}):e.map(e=>{let t=e[`@id`];return(0,P.jsxs)(`div`,{style:{padding:`0.75rem`,borderBottom:`1px solid var(--semiont-border-primary)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`0.75rem`},children:[(0,P.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,P.jsx)(`div`,{style:{fontWeight:500,color:`var(--semiont-text-primary)`},children:e.name}),e.description&&(0,P.jsx)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-secondary)`,marginTop:`0.25rem`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.description}),(0,P.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-tertiary)`,marginTop:`0.25rem`,display:`flex`,gap:`0.5rem`},children:[e.score!==void 0&&(0,P.jsxs)(`span`,{children:[a.score,`: `,e.score]}),e.matchReason&&(0,P.jsx)(`span`,{children:e.matchReason})]})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(t),className:`semiont-button--primary`,style:{flexShrink:0},children:[`🔗 `,a.link]})]},t)})})]}),(0,P.jsxs)(`div`,{className:`semiont-modal__actions`,style:{paddingTop:`0.5rem`},children:[(0,P.jsxs)(`button`,{type:`button`,onClick:i,className:`semiont-button--secondary semiont-button--flex`,children:[`✕ `,a.cancel]}),(0,P.jsxs)(`button`,{type:`button`,onClick:r,className:`semiont-button--secondary semiont-button--flex`,children:[`◀ `,a.back]})]})]})}function zQ({isOpen:e,onClose:t,annotationId:n,resourceId:r,defaultTitle:i,entityTypes:a,locale:o,context:s,contextLoading:c,contextError:l,onGenerateSubmit:u,onLinkResource:d,onComposeNavigate:f,translations:p}){let h=K(R().activeSession$),[g,_]=(0,m.useState)({step:`gather`}),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(``);(0,m.useEffect)(()=>{e&&(_({step:`gather`}),y(!1),x(``))},[e]),xE(`match:search-results`,t=>{e&&n&&t.referenceId===n&&(y(!1),_({step:`search-results`,results:t.response}))});let S=(0,m.useCallback)(()=>{_({step:`configure-search`})},[]),C=(0,m.useCallback)(()=>{_({step:`configure-generation`})},[]),w=(0,m.useCallback)(()=>{!s||!n||!r||(f(b?{...s,userHint:b}:s,n,r,i,a),t())},[s,n,r,i,a,f,t,b]),T=(0,m.useCallback)(()=>{_({step:`gather`})},[]),E=(0,m.useCallback)(e=>{if(!n||!s||!r)return;y(!0);let t=b?{...s,userHint:b}:s;h?.client.match.requestSearch({correlationId:crypto.randomUUID(),resourceId:r,referenceId:n,context:t,limit:e.limit,useSemanticScoring:e.useSemanticScoring})},[n,r,s,h,b]),D=(0,m.useCallback)(e=>{n&&(u(n,e),t())},[n,u,t]),O=(0,m.useCallback)(e=>{n&&(d(n,e),t())},[n,d,t]),k=g.step===`gather`?p.gatherTitle:g.step===`configure-generation`?p.configureGenerationTitle:g.step===`configure-search`?p.configureSearchTitle:p.searchResultsTitle;return(0,P.jsx)(QL,{appear:!0,show:e,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border${g.step===`search-results`?` semiont-search-modal__panel--wide`:``}${g.step===`gather`?` semiont-search-modal__panel--gather`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,P.jsx)(_R,{className:`semiont-search-modal__title`,children:k}),(0,P.jsx)(`button`,{onClick:t,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),g.step===`gather`&&(0,P.jsx)(FQ,{context:s,contextLoading:c,contextError:l,userHint:b,onUserHintChange:x,onBind:S,onGenerate:C,onCompose:w,translations:{title:p.gatherTitle,sourceContextLabel:p.sourceContextLabel,connectionsLabel:p.connectionsLabel,citedByLabel:p.citedByLabel,userHintLabel:p.userHintLabel,userHintPlaceholder:p.userHintPlaceholder,loadingContext:p.loadingContext,failedContext:p.failedContext,search:p.search,generate:p.generate,compose:p.compose,resolutionStrategyLabel:p.resolutionStrategyLabel}}),g.step===`configure-generation`&&s&&(0,P.jsx)(IQ,{defaultTitle:i,locale:o,context:s,onBack:T,onCancel:t,onGenerate:D,translations:{resourceTitle:p.resourceTitle,resourceTitlePlaceholder:p.resourceTitlePlaceholder,additionalInstructions:p.additionalInstructions,additionalInstructionsPlaceholder:p.additionalInstructionsPlaceholder,language:p.language,languageHelp:p.languageHelp,creativity:p.creativity,creativityFocused:p.creativityFocused,creativityCreative:p.creativityCreative,maxLength:p.maxLength,maxLengthHelp:p.maxLengthHelp,cancel:p.cancel,back:p.back,generate:p.generate}}),g.step===`configure-search`&&(0,P.jsx)(LQ,{isSearching:v,onBack:T,onCancel:t,onSearch:E,translations:{maxResults:p.maxResults,semanticScoring:p.semanticScoring,semanticScoringHelp:p.semanticScoringHelp,cancel:p.cancel,back:p.back,search:p.search,searching:p.searching}}),g.step===`search-results`&&s&&(0,P.jsx)(RQ,{results:g.results,context:s,onLink:O,onBack:T,onCancel:t,translations:{noResults:p.noResults,link:p.link,back:p.back,cancel:p.cancel,score:p.score,sourceContextLabel:p.sourceContextLabel,connectionsLabel:p.connectionsLabel,citedByLabel:p.citedByLabel,userHintLabel:p.userHintLabel,userHintPlaceholder:p.userHintPlaceholder}})]})})})})]})})}var BQ=u(Fh(),1);function VQ(){let{announce:e}=wE();return{announceSearching:(0,m.useCallback)(()=>{e(`Searching...`,`polite`)},[e]),announceSearchResults:(0,m.useCallback)((t,n)=>{e(t===0?`No results found for ${n}`:t===1?`1 result found for ${n}`:`${t} results found for ${n}`,`polite`)},[e]),announceSelection:(0,m.useCallback)((t,n)=>{e(`Selected ${n}: ${t}. Press Enter to navigate.`,`polite`)},[e]),announceNavigation:(0,m.useCallback)((t,n)=>{e(`Navigating to ${n}: ${t}`,`assertive`)},[e])}}var HQ=300,UQ=5;function WQ({isOpen:e,onClose:t,onNavigate:n,translations:r={}}){let{announceSearchResults:i,announceSearching:a}=VQ(),o=K(R().activeSession$)?.client,s=(0,m.useRef)(o);s.current=o;let[c,l]=(0,m.useState)(0),u={placeholder:r.placeholder||`Search resources, entities...`,searching:r.searching||`Searching...`,noResults:r.noResults||`No results found for`,startTyping:r.startTyping||`Start typing to search...`,navigate:r.navigate||`Navigate`,select:r.select||`Select`,close:r.close||`Close`,enter:r.enter||`Enter`,esc:r.esc||`ESC`},[d]=(0,m.useState)(()=>Bu(e=>s.current.browse.resources({search:e,limit:UQ}).pipe((0,BQ.map)(e=>{if(e!==void 0)return e.map(e=>{let t=po(e);return t?{type:`resource`,id:t,name:e.name,content:e.content?.substring(0,150)}:null}).filter(e=>e!==null)})),{debounceMs:HQ}));(0,m.useEffect)(()=>()=>d.dispose(),[d]);let f=K(d.query$)??``,p=K(d.state$),h=p?.results??[],g=p?.isSearching??!1;(0,m.useEffect)(()=>{e&&(d.setQuery(``),l(0))},[e,d]),(0,m.useEffect)(()=>{l(0)},[h.length]),(0,m.useEffect)(()=>{f.trim()&&(g?a():i(h.length,f))},[g,h.length]);let _=e=>{e.key===`ArrowDown`?(e.preventDefault(),l(e=>(e+1)%Math.max(1,h.length))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>(e-1+Math.max(1,h.length))%Math.max(1,h.length))):e.key===`Enter`&&h[c]&&(e.preventDefault(),v(h[c]))},v=e=>{t(),n(e.type,e.id)};return(0,P.jsx)(QL,{appear:!0,show:e,children:(0,P.jsxs)(vR,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,P.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,P.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-search-modal__centering`,children:(0,P.jsx)(ZL,{enter:`ease-out duration-200`,enterFrom:`opacity-0 scale-95`,enterTo:`opacity-100 scale-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100 scale-100`,leaveTo:`opacity-0 scale-95`,children:(0,P.jsxs)(gR,{className:`semiont-search-modal__panel`,children:[(0,P.jsxs)(`div`,{className:`semiont-search-modal__input-container`,children:[(0,P.jsx)(`div`,{className:`semiont-search-modal__search-icon-wrapper`,children:(0,P.jsx)(`svg`,{className:`semiont-search-modal__search-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})})}),(0,P.jsx)(`input`,{type:`text`,value:f,onChange:e=>d.setQuery(e.target.value),onKeyDown:_,placeholder:u.placeholder,className:`semiont-search-modal__input`,autoFocus:!0}),(0,P.jsx)(`div`,{className:`semiont-search-modal__esc-wrapper`,children:(0,P.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.esc})})]}),(0,P.jsxs)(`div`,{className:`semiont-search-modal__results`,children:[g&&(0,P.jsx)(`div`,{className:`semiont-search-modal__empty`,children:u.searching}),!g&&f&&h.length===0&&(0,P.jsxs)(`div`,{className:`semiont-search-modal__empty`,children:[u.noResults,` "`,f,`"`]}),!g&&h.length>0&&(0,P.jsx)(`div`,{className:`semiont-search-modal__results-list`,children:h.map((e,t)=>(0,P.jsxs)(`button`,{onClick:()=>v(e),onMouseEnter:()=>l(t),className:`semiont-search-modal__result ${t===c?`semiont-search-modal__result--selected`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-search-modal__result-icon-wrapper`,children:e.type===`resource`?(0,P.jsx)(`svg`,{className:`semiont-search-modal__result-icon semiont-search-modal__result-icon--resource`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})}):(0,P.jsx)(`svg`,{className:`semiont-search-modal__result-icon semiont-search-modal__result-icon--entity`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z`})})}),(0,P.jsxs)(`div`,{className:`semiont-search-modal__result-content`,children:[(0,P.jsxs)(`div`,{className:`semiont-search-modal__result-header`,children:[(0,P.jsx)(`span`,{className:`semiont-search-modal__result-name`,children:e.name}),e.type===`entity`&&e.entityType&&(0,P.jsx)(`span`,{className:`semiont-search-modal__result-badge`,children:e.entityType})]}),e.content&&(0,P.jsx)(`p`,{className:`semiont-search-modal__result-description`,children:e.content})]}),t===c&&(0,P.jsx)(`div`,{className:`semiont-search-modal__result-action`,children:(0,P.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.enter})})]},`${e.type}-${e.id}`))}),!g&&!f&&(0,P.jsxs)(`div`,{className:`semiont-search-modal__help`,children:[(0,P.jsx)(`div`,{className:`semiont-search-modal__help-text`,children:u.startTyping}),(0,P.jsxs)(`div`,{className:`semiont-search-modal__shortcuts`,children:[(0,P.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,P.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`↑↓`}),u.navigate]}),(0,P.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,P.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:u.enter}),u.select]}),(0,P.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,P.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`Esc`}),u.close]})]})]})]})]})})})})]})})}u(Fh(),1);function GQ(){return(0,P.jsx)(`div`,{className:`semiont-skip-links`,children:(0,P.jsxs)(`div`,{className:`semiont-skip-links-container`,children:[(0,P.jsx)(`a`,{href:`#main-content`,className:`semiont-skip-link semiont-skip-link-first`,children:`Skip to main content`}),(0,P.jsx)(`a`,{href:`#main-navigation`,className:`semiont-skip-link`,children:`Skip to navigation`}),(0,P.jsx)(`a`,{href:`#search`,className:`semiont-skip-link semiont-skip-link-last`,children:`Skip to search`})]})})}function KQ({isFullyAuthenticated:e=!1,isAuthenticated:t=!1,hasValidBackendToken:n=!1}){let r=K(R().activeSession$)?.client,[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(!0),[c,l]=(0,m.useState)(null);return(0,m.useEffect)(()=>{if(!r){s(!1);return}let e=()=>{r.admin.status().then(e=>{a(e),l(null),s(!1)}).catch(e=>{l(e instanceof Error?e:Error(String(e))),s(!1)})};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]),(0,P.jsxs)(`section`,{className:`semiont-status-display`,"data-status":t&&!n?`warning`:e?i?`success`:o?`loading`:`error`:`info`,role:`status`,"aria-live":`polite`,"aria-label":`System status information`,children:[(0,P.jsxs)(`p`,{className:`semiont-status-message`,children:[(0,P.jsx)(`span`,{className:`sr-only`,children:`System status: `}),(()=>{if(t&&!n)return`🚀 Frontend Status: Ready • Backend: Please sign out and sign in again to reconnect`;if(!e)return`🚀 Frontend Status: Ready • Backend: Authentication required`;if(i)return`\u{1F680} Frontend Status: Ready \u2022 Backend: ${i.status} (v${i.version})`;if(o)return`🚀 Frontend Status: Ready • Backend: Connecting...`;if(c){let e=c.message;return e.includes(`401`)||e.includes(`Unauthorized`)?`🚀 Frontend Status: Ready • Backend: Please sign out and sign in again`:`🚀 Frontend Status: Ready • Backend: Connection failed`}return`🚀 Frontend Status: Ready • Backend: Unknown`})()]}),e?c?(0,P.jsxs)(`p`,{className:`semiont-status-hint semiont-status-error-hint`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`sr-only`,children:`Error: `}),`Check that the backend server is running and accessible`]}):null:(0,P.jsx)(`p`,{className:`semiont-status-hint`,children:`Sign in to view backend status`})]})}function qQ({t:e,className:t=``,size:n=`lg`,showTagline:r=!0,animated:i=!0,compactTagline:a=!1}){return(0,P.jsxs)(`div`,{className:`semiont-branding ${t}`,"data-size":n,"data-animated":i,"data-compact-tagline":a,children:[(0,P.jsx)(`h1`,{className:`semiont-branding-title`,children:(0,P.jsx)(`span`,{className:`semiont-branding-text`,children:`Semiont`})}),r&&(0,P.jsx)(`h2`,{className:`semiont-branding-tagline`,children:e(`tagline`)})]})}function JQ({Link:e,routes:t,t:n,tHome:r,showBranding:i=!0,brandingLink:a=`/`,variant:o=`standalone`,isAuthenticated:s=!1,isAdmin:c=!1,isModerator:l=!1,currentPath:u}){let{isOpen:d,toggle:f,close:p,dropdownRef:m}=yE();if(o===`floating`&&i)return(0,P.jsxs)(`div`,{className:`semiont-unified-header semiont-unified-header--floating`,"data-variant":`floating`,ref:m,children:[(0,P.jsx)(`button`,{onClick:f,className:`semiont-unified-header__branding-button`,"aria-label":`Navigation menu`,"aria-expanded":d,"aria-controls":`nav-menu-dropdown-1`,"aria-haspopup":`true`,id:`nav-menu-button-1`,children:(0,P.jsx)(qQ,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,P.jsx)(`div`,{id:`nav-menu-dropdown-1`,className:`semiont-unified-header__dropdown`,role:`menu`,"aria-orientation":`vertical`,"aria-labelledby":`nav-menu-button-1`,children:(0,P.jsx)(lY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]});let h=(0,P.jsxs)(`div`,{className:`semiont-unified-header__content`,"data-variant":o,children:[i?(0,P.jsxs)(`div`,{className:`semiont-unified-header__branding-wrapper`,ref:m,children:[(0,P.jsx)(`button`,{onClick:f,className:`semiont-unified-header__branding-button`,"aria-label":`Navigation menu`,"aria-expanded":d,"aria-controls":`nav-menu-dropdown-2`,"aria-haspopup":`true`,id:`nav-menu-button-2`,children:(0,P.jsx)(qQ,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,P.jsx)(`div`,{id:`nav-menu-dropdown-2`,className:`semiont-unified-header__dropdown`,role:`menu`,"aria-orientation":`vertical`,"aria-labelledby":`nav-menu-button-2`,children:(0,P.jsx)(lY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]}):(0,P.jsx)(`div`,{}),(0,P.jsx)(`div`,{className:`semiont-unified-header__actions`,"data-variant":o})]});return o===`standalone`?(0,P.jsx)(`header`,{className:`semiont-unified-header semiont-unified-header--standalone`,"data-variant":`standalone`,children:(0,P.jsx)(`div`,{className:`semiont-unified-header__container`,children:h})}):h}function YQ({Link:e,routes:t,t:n,tHome:r,children:i,brandingLink:a=`/`,collapsible:o=!1,storageKey:s=`leftSidebarCollapsed`,isAdmin:c=!1,isModerator:l=!1,currentPath:u}){let[d,f]=(0,m.useState)(!1),{width:p,setWidth:h,minWidth:g,maxWidth:_}=pE({defaultWidth:256,minWidth:192,maxWidth:400,storageKey:`semiont-left-sidebar-width`});return(0,m.useEffect)(()=>{o&&localStorage.getItem(s)===`true`&&f(!0)},[o,s]),(0,P.jsxs)(`aside`,{className:`semiont-left-sidebar`,"data-collapsed":d,style:d?void 0:{width:`${p}px`,position:`relative`},children:[!d&&(0,P.jsx)(XN,{onResize:h,minWidth:g,maxWidth:_,position:`right`,ariaLabel:`Resize left sidebar`}),(0,P.jsx)(`div`,{className:`semiont-left-sidebar__header`,"data-collapsed":d,children:(0,P.jsx)(e,{href:a,className:`semiont-left-sidebar__branding-button`,"aria-label":`Go to home page`,children:d?(0,P.jsx)(`div`,{className:`semiont-left-sidebar__logo-collapsed`,children:(0,P.jsx)(`span`,{className:`semiont-left-sidebar__logo-text`,children:`S`})}):(0,P.jsx)(qQ,{t:r,size:`sm`,showTagline:!1,animated:!1,className:``})})}),(0,P.jsx)(`nav`,{role:`navigation`,"aria-label":`Main navigation`,id:`main-navigation`,className:`semiont-left-sidebar__content`,children:typeof i==`function`?i(d,()=>{if(!o)return;let e=!d;f(e),localStorage.setItem(s,e.toString())},r=>(0,P.jsx)(lY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:r,currentPath:u})):i})]})}function XQ({Link:e,routes:t,t:n,tNav:r,tHome:i,children:a,className:o=``,showAuthLinks:s=!0,CookiePreferences:c,onOpenKeyboardHelp:l}){return(0,P.jsxs)(`div`,{className:`semiont-page-layout`,children:[(0,P.jsx)(GQ,{}),(0,P.jsx)(`header`,{role:`banner`,className:`semiont-page-layout__header`,children:(0,P.jsx)(`div`,{className:`semiont-page-layout__header-container`,children:(0,P.jsx)(JQ,{Link:e,routes:t,t:r,tHome:i,showAuthLinks:s,brandingLink:`/`,variant:`embedded`})})}),(0,P.jsx)(`main`,{role:`main`,id:`main-content`,tabIndex:-1,className:`semiont-page-layout__main ${o}`,children:a}),(0,P.jsx)(cY,{Link:e,routes:t,t:n,...c&&{CookiePreferences:c},...l&&{onOpenKeyboardHelp:l}})]})}var ZQ={colors:{primary:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#0080ff`,600:`#0066cc`,700:`#0052a3`,800:`#1e40af`,900:`#1e3a8a`},secondary:{50:`#f0fffe`,100:`#e0fffd`,200:`#b3fffa`,300:`#66fff6`,400:`#1afff1`,500:`#00ffff`,600:`#00cccc`,700:`#00a3a3`,800:`#007a7a`,900:`#005252`},semantic:{error:`#ef4444`,errorLight:`#fca5a5`,errorDark:`#b91c1c`,warning:`#f59e0b`,warningLight:`#fcd34d`,warningDark:`#d97706`,success:`#10b981`,successLight:`#6ee7b7`,successDark:`#047857`,info:`#3b82f6`,infoLight:`#93c5fd`,infoDark:`#1d4ed8`},neutral:{0:`#ffffff`,50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`,1e3:`#000000`},background:{primary:`#ffffff`,secondary:`#f9fafb`,tertiary:`#f3f4f6`,inverse:`#111827`},text:{primary:`#111827`,secondary:`#4b5563`,tertiary:`#6b7280`,disabled:`#9ca3af`,inverse:`#ffffff`}},spacing:{0:`0`,xs:`0.25rem`,sm:`0.5rem`,md:`1rem`,lg:`1.5rem`,xl:`2rem`,"2xl":`2.5rem`,"3xl":`3rem`,"4xl":`4rem`,"5xl":`5rem`},typography:{fontFamily:{sans:`Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,mono:`JetBrains Mono, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`},fontSize:{xs:`0.75rem`,sm:`0.875rem`,base:`1rem`,lg:`1.125rem`,xl:`1.25rem`,"2xl":`1.5rem`,"3xl":`1.875rem`,"4xl":`2.25rem`,"5xl":`3rem`},fontWeight:{thin:100,light:300,normal:400,medium:500,semibold:600,bold:700,black:900},lineHeight:{none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2}},borderRadius:{none:`0`,sm:`0.125rem`,base:`0.25rem`,md:`0.375rem`,lg:`0.5rem`,xl:`0.75rem`,"2xl":`1rem`,"3xl":`1.5rem`,full:`9999px`},shadows:{none:`none`,xs:`0 1px 2px 0 rgb(0 0 0 / 0.05)`,sm:`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`,base:`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`,md:`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`,lg:`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`,xl:`0 25px 50px -12px rgb(0 0 0 / 0.25)`,inner:`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},transitions:{duration:{fast:`150ms`,base:`250ms`,slow:`350ms`,slower:`500ms`},timing:{linear:`linear`,ease:`cubic-bezier(0.4, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,easeOut:`cubic-bezier(0, 0, 0.2, 1)`,easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`}},breakpoints:{sm:`640px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`}};function QQ(){let e=[`:root {`];return Object.entries(ZQ.colors.primary).forEach(([t,n])=>{e.push(` --semiont-color-primary-${t}: ${n};`)}),Object.entries(ZQ.colors.secondary).forEach(([t,n])=>{e.push(` --semiont-color-secondary-${t}: ${n};`)}),Object.entries(ZQ.colors.semantic).forEach(([t,n])=>{e.push(` --semiont-color-${t.toLowerCase().replace(/([A-Z])/g,`-$1`).toLowerCase()}: ${n};`)}),Object.entries(ZQ.colors.neutral).forEach(([t,n])=>{e.push(` --semiont-color-neutral-${t}: ${n};`)}),Object.entries(ZQ.spacing).forEach(([t,n])=>{e.push(` --semiont-spacing-${t}: ${n};`)}),Object.entries(ZQ.typography.fontSize).forEach(([t,n])=>{e.push(` --semiont-text-${t}: ${n};`)}),Object.entries(ZQ.typography.fontWeight).forEach(([t,n])=>{e.push(` --semiont-font-${t}: ${n};`)}),e.push(` --semiont-font-sans: ${ZQ.typography.fontFamily.sans};`),e.push(` --semiont-font-mono: ${ZQ.typography.fontFamily.mono};`),Object.entries(ZQ.borderRadius).forEach(([t,n])=>{e.push(` --semiont-radius-${t}: ${n};`)}),Object.entries(ZQ.shadows).forEach(([t,n])=>{e.push(` --semiont-shadow-${t}: ${n};`)}),Object.entries(ZQ.transitions.duration).forEach(([t,n])=>{e.push(` --semiont-duration-${t}: ${n};`)}),e.push(`}`),e.join(`
|
|
140
|
-
`)}QQ();function $Q({message:e}){return(0,P.jsx)(`div`,{className:`semiont-loading-state-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-compose`,children:(0,P.jsx)(`p`,{className:`semiont-loading-message`,children:e})})})}function e$(){return(0,P.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-resource`,children:(0,P.jsx)(`p`,{className:`semiont-loading-message`,children:`Loading resource...`})})}function t$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5`}))}var n$=m.forwardRef(t$);function r$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var i$=m.forwardRef(r$);function a$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var o$=m.forwardRef(a$);function s$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z`}))}var c$=m.forwardRef(s$);function l$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z`}))}var u$=m.forwardRef(l$);function d$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z`}))}var f$=m.forwardRef(d$);function p$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418`}))}var m$=m.forwardRef(p$);function h$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z`}))}var g$=m.forwardRef(h$);function _$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18`}))}var v$=m.forwardRef(_$);function y$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z`}))}var b$=m.forwardRef(y$);function x$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125`}))}var S$=m.forwardRef(x$);function C$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`}))}var w$=m.forwardRef(C$);function T$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971Z`}))}var E$=m.forwardRef(T$);function D$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z`}))}var O$=m.forwardRef(D$);function k$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z`}),m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.008v.008H6V6Z`}))}var A$=m.forwardRef(k$);function j$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0`}))}var M$=m.forwardRef(j$);function N$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`}))}var P$=m.forwardRef(N$),F$=u(Qm(),1),I$=[`knowledge-base`,`user`,`settings`],L$={linking:`reference`,commenting:`comment`,tagging:`tag`,highlighting:`highlight`,assessing:`assessment`},R$=0;function z$(e,t){let n=[],r=new F$.BehaviorSubject(t?.initialPanel??null),i=new F$.BehaviorSubject(null),a=new F$.BehaviorSubject(null);if(t?.onPanelChange){let e=t.onPanelChange;n.push(r.subscribe(e))}return n.push(e.stream(`panel:toggle`).subscribe(({panel:e})=>{let t=r.getValue();r.next(t===e?null:e)})),n.push(e.stream(`panel:open`).subscribe(({panel:e,scrollToAnnotationId:t,motivation:n})=>{if(t&&i.next(t),n){let e=L$[n]||`highlight`;a.next({tab:e,generation:++R$})}r.next(e)})),n.push(e.stream(`panel:close`).subscribe(()=>{r.next(null)})),{activePanel$:r.asObservable(),scrollToAnnotationId$:i.asObservable(),panelInitialTab$:a.asObservable(),openPanel:t=>e.emit(`panel:open`,{panel:t}),closePanel:()=>e.emit(`panel:close`,void 0),togglePanel:t=>e.emit(`panel:toggle`,{panel:t}),onScrollCompleted:()=>i.next(null),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete()}}}function B$({suggestedFeatures:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,StatusDisplay:a,ToolbarPanels:o,Toolbar:s}){return(0,P.jsxs)(`div`,{className:`semiont-page${r&&I$.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:i.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.systemStatus}),(0,P.jsx)(a,{})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.cliOperations}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:i.cliOperationsDescription}),(0,P.jsx)(`div`,{className:`semiont-admin__features-grid`,children:e.map(e=>(0,P.jsx)(`div`,{className:`semiont-devops-feature`,children:(0,P.jsxs)(`div`,{className:`semiont-devops-feature__header`,children:[(0,P.jsx)(`div`,{className:`semiont-devops-feature__icon-box`,children:(0,P.jsx)(e.icon,{className:`semiont-devops-feature__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-devops-feature__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-devops-feature__title`,children:e.title}),(0,P.jsx)(`p`,{className:`semiont-devops-feature__description`,children:e.description}),(0,P.jsx)(`p`,{className:`semiont-devops-feature__available`,children:e.available})]})]})},e.title))})]}),(0,P.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-content`,children:[(0,P.jsx)(`div`,{className:`semiont-admin__info-box-icon`,children:(0,P.jsx)(c$,{className:`semiont-icon semiont-icon--info`})}),(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-text`,children:[(0,P.jsx)(`h3`,{className:`semiont-admin__info-box-title`,children:i.cliTitle}),(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-description`,children:[(0,P.jsx)(`p`,{children:i.cliDescription}),(0,P.jsx)(`code`,{className:`semiont-admin__info-box-code`,children:`semiont --help`})]})]})]})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(o,{activePanel:r,theme:t,showLineNumbers:n}),(0,P.jsx)(s,{context:`simple`,activePanel:r})]})]})}function V$({onExport:e,isExporting:t,translations:n}){return(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:n.title}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:n.description}),(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:e,disabled:t,children:t?n.exporting:n.exportButton})]})}function H$({onFileSelected:e,onImport:t,onCancel:n,selectedFile:r,preview:i,isImporting:a,translations:o}){let s=(0,m.useRef)(null),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useCallback)(e=>{e.preventDefault(),l(!0)},[]),p=(0,m.useCallback)(()=>{l(!1)},[]),h=(0,m.useCallback)(t=>{t.preventDefault(),l(!1),d(!1);let n=t.dataTransfer.files[0];n&&e(n)},[e]),g=(0,m.useCallback)(t=>{d(!1);let n=t.target.files?.[0];n&&e(n)},[e]);return(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:o.title}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:o.description}),(0,P.jsxs)(`div`,{className:`semiont-exchange__dropzone${c?` semiont-exchange__dropzone--active`:``}`,onDragOver:f,onDragLeave:p,onDrop:h,onClick:()=>s.current?.click(),children:[(0,P.jsx)(`p`,{className:`semiont-exchange__dropzone-text`,children:c?o.dropzoneActive:o.dropzoneLabel}),r&&(0,P.jsxs)(`p`,{className:`semiont-exchange__file-info`,children:[r.name,` (`,(r.size/1024).toFixed(1),` KB)`]})]}),(0,P.jsx)(`input`,{ref:s,type:`file`,accept:`.tar.gz,.jsonl,.gz`,onChange:g,style:{display:`none`}}),i&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview`,children:[(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.detectedFormat}),(0,P.jsxs)(`span`,{className:`semiont-exchange__preview-value`,children:[i.format,` v`,i.version]})]}),i.sourceUrl&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:`Source`}),(0,P.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:i.sourceUrl})]}),Object.keys(i.stats).length>0&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.statsPreview}),(0,P.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:Object.entries(i.stats).map(([e,t])=>`${t} ${e}`).join(`, `)})]})]}),u&&(0,P.jsxs)(`div`,{className:`semiont-exchange__confirm`,children:[(0,P.jsx)(`p`,{className:`semiont-exchange__confirm-title`,children:o.importConfirmTitle}),(0,P.jsx)(`p`,{className:`semiont-exchange__confirm-message`,children:o.importConfirmMessage}),(0,P.jsxs)(`div`,{className:`semiont-exchange__confirm-actions`,children:[(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{d(!1),t()},children:o.confirmImport}),(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:()=>{d(!1)},children:o.cancelImport})]})]}),!u&&(0,P.jsxs)(`div`,{className:`semiont-exchange__actions`,children:[(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{d(!0)},disabled:!i||a,children:a?o.importing:o.importButton}),r&&(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:n,disabled:a,children:o.cancelImport})]})]})}var U$={started:`phaseStarted`,"entity-types":`phaseEntityTypes`,resources:`phaseResources`,annotations:`phaseAnnotations`,complete:`phaseComplete`,error:`phaseError`};function W$({phase:e,message:t,result:n,translations:r}){let i=U$[e],a=i?r[i]:e,o=e===`complete`,s=e===`error`;return(0,P.jsxs)(`div`,{className:`semiont-exchange__progress`,children:[(0,P.jsx)(`div`,{className:`semiont-exchange__phase-label${s?` semiont-exchange__phase-label--error`:o?` semiont-exchange__phase-label--complete`:``}`,children:a}),t&&!o&&!s&&(0,P.jsx)(`p`,{className:`semiont-exchange__progress-message`,children:t}),o&&n&&(0,P.jsxs)(`div`,{className:`semiont-exchange__result`,children:[n.stats!=null&&typeof n.stats==`object`&&(0,P.jsx)(P.Fragment,{children:Object.entries(n.stats).map(([e,t])=>{let n=e===`streams`?r.streams:e===`events`?r.events:e===`blobs`?r.blobs:e;return(0,P.jsxs)(`div`,{className:`semiont-exchange__result-stat`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__result-value`,children:t}),(0,P.jsx)(`span`,{className:`semiont-exchange__result-label`,children:n})]},e)})}),n.hashChainValid!==void 0&&(0,P.jsx)(`div`,{className:`semiont-exchange__hash-badge${n.hashChainValid?` semiont-exchange__hash-badge--valid`:` semiont-exchange__hash-badge--invalid`}`,children:n.hashChainValid?r.hashChainValid:r.hashChainInvalid})]}),s&&t&&(0,P.jsx)(`p`,{className:`semiont-exchange__error-message`,children:t})]})}function G$({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,P.jsxs)(`div`,{className:`semiont-page${p&&I$.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,P.jsx)(V$,{onExport:e,isExporting:t,translations:m.export}),(0,P.jsx)(H$,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,P.jsx)(W$,{phase:c,message:l,result:u,translations:m.progress})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,P.jsx)(g,{context:`simple`,activePanel:p})]})]})}function K$({providers:e,allowedDomains:t,isLoading:n,theme:r,showLineNumbers:i,activePanel:a,translations:o,ToolbarPanels:s,Toolbar:c}){return(0,P.jsxs)(`div`,{className:`semiont-page${a&&I$.includes(a)?` semiont-page--panel-open`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-page__content`,children:(0,P.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:o.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:o.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,P.jsx)(O$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.oauthProviders}),(0,P.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.oauthProvidersDescription})]})]}),n?(0,P.jsx)(`div`,{className:`semiont-skeleton-group`,children:(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--bar`})}):e.length>0?(0,P.jsx)(`div`,{className:`semiont-provider-list`,children:e.map(e=>(0,P.jsxs)(`div`,{className:`semiont-provider-item`,children:[(0,P.jsxs)(`div`,{className:`semiont-provider-item__info`,children:[(0,P.jsx)(i$,{className:`semiont-provider-item__icon semiont-provider-item__icon--success`}),(0,P.jsx)(`span`,{className:`semiont-provider-item__name`,children:e.name}),e.clientId&&(0,P.jsxs)(`span`,{className:`semiont-provider-item__client-id`,children:[o.clientId,`: `,e.clientId]})]}),(0,P.jsx)(`span`,{className:`semiont-badge semiont-badge--success`,children:o.configured})]},e.name))}):(0,P.jsx)(`div`,{className:`semiont-empty-message`,children:o.noProvidersConfigured})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,P.jsx)(m$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.allowedDomains}),(0,P.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.allowedDomainsDescription})]})]}),n?(0,P.jsxs)(`div`,{className:`semiont-skeleton-group`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip`}),(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip semiont-skeleton--chip-lg`})]}):t.length>0?(0,P.jsx)(`div`,{className:`semiont-domain-list`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`semiont-chip semiont-chip--primary`,children:[`@`,e]},e))}):(0,P.jsx)(`div`,{className:`semiont-empty-message`,children:o.noDomainsConfigured})]}),(0,P.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,P.jsxs)(`div`,{className:`semiont-info-box__content`,children:[(0,P.jsx)(g$,{className:`semiont-info-box__icon`}),(0,P.jsxs)(`div`,{className:`semiont-info-box__text`,children:[(0,P.jsx)(`p`,{className:`semiont-info-box__title`,children:o.configManagementTitle}),(0,P.jsx)(`p`,{className:`semiont-info-box__description`,children:o.configManagementDescription}),(0,P.jsxs)(`ul`,{className:`semiont-info-box__list`,children:[(0,P.jsx)(`li`,{children:o.configLocalDev}),(0,P.jsxs)(`li`,{children:[o.configCloudDeploy,` `,(0,P.jsx)(`code`,{className:`semiont-code-inline`,children:o.configCloudDeployCommand}),` `,o.configCloudDeployEnd]}),(0,P.jsx)(`li`,{children:o.configAWS})]})]})]})})]})}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(s,{activePanel:a,theme:r,showLineNumbers:i}),(0,P.jsx)(c,{context:`simple`,activePanel:a})]})]})}function q$({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,P.jsxs)(`div`,{className:`semiont-page${p&&I$.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,P.jsx)(V$,{onExport:e,isExporting:t,translations:m.export}),(0,P.jsx)(H$,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,P.jsx)(W$,{phase:c,message:l,result:u,translations:m.progress})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,P.jsx)(g,{context:`simple`,activePanel:p})]})]})}function J$({user:e,onUpdate:t,onDelete:n,translations:r}){let i={admin:`semiont-badge semiont-badge--danger`,user:`semiont-badge semiont-badge--default`},a={active:`semiont-badge semiont-badge--success`,inactive:`semiont-badge semiont-badge--default`},o=e.isAdmin?`admin`:`user`,s=e.isActive?`active`:`inactive`;return(0,P.jsxs)(`tr`,{className:`semiont-table__row`,children:[(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsxs)(`div`,{className:`semiont-user-info`,children:[(0,P.jsx)(P$,{className:`semiont-user-info__avatar`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-user-info__name`,children:e.name||r.noName}),(0,P.jsx)(`div`,{className:`semiont-user-info__email`,children:e.email})]})]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsxs)(`span`,{className:`semiont-table__text--secondary`,children:[`@`,e.domain]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsx)(`span`,{className:i[o],children:r[o]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsx)(`span`,{className:a[s],children:r[s]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:e.lastLogin?new Date(e.lastLogin).toLocaleDateString():r.never}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:new Date(e.created).toLocaleDateString()}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__cell--actions`,children:(0,P.jsxs)(`div`,{className:`semiont-table__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>t(e.id,{isAdmin:!e.isAdmin}),className:`semiont-action-button semiont-action-button--info`,title:e.isAdmin?r.removeAdmin:r.makeAdmin,children:(0,P.jsx)(O$,{className:`semiont-action-button__icon`})}),(0,P.jsx)(`button`,{onClick:()=>t(e.id,{isActive:!e.isActive}),className:`semiont-action-button semiont-action-button--warning`,title:e.isActive?r.deactivateUser:r.activateUser,children:(0,P.jsx)(S$,{className:`semiont-action-button__icon`})}),(0,P.jsx)(`button`,{onClick:()=>n(e.id),className:`semiont-action-button semiont-action-button--danger`,title:r.deleteUser,children:(0,P.jsx)(M$,{className:`semiont-action-button__icon`})})]})})]})}function Y$({users:e,userStats:t,isLoadingUsers:n,isLoadingStats:r,onUpdateUser:i,onDeleteUser:a,onAddUser:o,onExportUsers:s,theme:c,showLineNumbers:l,activePanel:u,translations:d,ToolbarPanels:f,Toolbar:p,buttonStyles:h}){let[g,_]=(0,m.useState)(``),[v,y]=(0,m.useState)(`all`),[b,x]=(0,m.useState)(`all`),S=e.filter(e=>{let t=(e.name||``).toLowerCase().includes(g.toLowerCase())||e.email.toLowerCase().includes(g.toLowerCase()),n=e.isAdmin?`admin`:`user`,r=e.isActive?`active`:`inactive`;return t&&(v===`all`||n===v)&&(b===`all`||r===b)});return(0,P.jsxs)(`div`,{className:`semiont-page${u&&I$.includes(u)?` semiont-page--panel-open`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-page__content`,children:(0,P.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header-with-action`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:d.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:d.subtitle})]}),(0,P.jsxs)(`button`,{onClick:o,className:h.primary.base,children:[(0,P.jsx)(w$,{className:`semiont-button__icon`}),d.addUser]})]}),(0,P.jsx)(`div`,{className:`semiont-admin__stats-grid`,children:r?[,,,,].fill(0).map((e,t)=>(0,P.jsx)(`div`,{className:`semiont-stat-card semiont-stat-card--loading`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--icon`}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--text`}),(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--number`})]})]})},t)):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(P$,{className:`semiont-stat-card__icon semiont-stat-card__icon--primary`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.totalUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.totalUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-stat-card__status-indicator semiont-stat-card__status-indicator--active`,children:(0,P.jsx)(`div`,{className:`semiont-stat-card__status-dot`})})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.activeUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.activeUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(O$,{className:`semiont-stat-card__icon semiont-stat-card__icon--danger`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.administrators}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.adminUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(f$,{className:`semiont-stat-card__icon semiont-stat-card__icon--warning`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.recentUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.recentSignups?.length??0})]})]})})]})}),(0,P.jsx)(`div`,{className:`semiont-admin__filters-card`,children:(0,P.jsxs)(`div`,{className:`semiont-admin__filters-grid`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`search`,className:`semiont-form__label`,children:d.searchUsers}),(0,P.jsxs)(`div`,{className:`semiont-search-input`,children:[(0,P.jsx)(`div`,{className:`semiont-search-input__icon`,children:(0,P.jsx)(b$,{className:`semiont-icon semiont-icon--small`})}),(0,P.jsx)(`input`,{type:`text`,id:`search`,className:`semiont-search-input__field`,placeholder:d.searchPlaceholder,value:g,onChange:e=>_(e.target.value)})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`role`,className:`semiont-form__label`,children:d.role}),(0,P.jsxs)(`select`,{id:`role`,className:`semiont-select`,value:v,onChange:e=>y(e.target.value),children:[(0,P.jsx)(`option`,{value:`all`,children:d.allRoles}),(0,P.jsx)(`option`,{value:`admin`,children:d.admin}),(0,P.jsx)(`option`,{value:`user`,children:d.user})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`status`,className:`semiont-form__label`,children:d.status}),(0,P.jsxs)(`select`,{id:`status`,className:`semiont-select`,value:b,onChange:e=>x(e.target.value),children:[(0,P.jsx)(`option`,{value:`all`,children:d.allStatus}),(0,P.jsx)(`option`,{value:`active`,children:d.active}),(0,P.jsx)(`option`,{value:`inactive`,children:d.inactive})]})]}),(0,P.jsx)(`div`,{className:`semiont-form__field semiont-form__field--align-end`,children:(0,P.jsx)(`button`,{onClick:s,className:`${h.secondary.base} semiont-button--full-width`,children:d.exportUsers})})]})}),(0,P.jsxs)(`div`,{className:`semiont-admin__table-card`,children:[(0,P.jsx)(`div`,{className:`semiont-table-container`,children:n?(0,P.jsxs)(`div`,{className:`semiont-loading-state`,children:[(0,P.jsx)(`div`,{className:`semiont-spinner`}),(0,P.jsx)(`p`,{className:`semiont-loading-state__text`,children:d.loadingUsers})]}):(0,P.jsxs)(`table`,{className:`semiont-table`,children:[(0,P.jsx)(`thead`,{className:`semiont-table__head`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.userColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.domainColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.roleColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.statusColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.lastLoginColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.joinedColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header semiont-table__header--actions`,children:d.actionsColumn})]})}),(0,P.jsx)(`tbody`,{className:`semiont-table__body`,children:S.map(e=>(0,P.jsx)(J$,{user:e,onUpdate:i,onDelete:a,translations:d},e.id))})]})}),!n&&S.length===0&&(0,P.jsxs)(`div`,{className:`semiont-empty-state`,children:[(0,P.jsx)(P$,{className:`semiont-empty-state__icon`}),(0,P.jsx)(`h3`,{className:`semiont-empty-state__title`,children:d.noUsersFound}),(0,P.jsx)(`p`,{className:`semiont-empty-state__description`,children:d.noUsersFoundDescription})]})]})]})}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(f,{activePanel:u,theme:c,showLineNumbers:l}),(0,P.jsx)(p,{context:`simple`,activePanel:u})]})]})}function X$(){return(0,P.jsxs)(`svg`,{className:`semiont-icon semiont-icon--small semiont-icon--inline`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{fill:`currentColor`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]})}function Z$({onSignUp:e,Link:t,translations:n}){let[r,i]=(0,m.useState)(!1);return(0,P.jsx)(`main`,{className:`semiont-auth__main`,role:`main`,children:(0,P.jsx)(`div`,{className:`semiont-auth__container`,children:(0,P.jsxs)(`div`,{className:`semiont-auth__content`,children:[(0,P.jsxs)(`section`,{"aria-labelledby":`signup-heading`,className:`semiont-auth__branding`,children:[(0,P.jsx)(`h1`,{id:`signup-heading`,className:`sr-only`,children:n.pageTitle}),(0,P.jsx)(qQ,{t:e=>n[e]||e,size:`xl`,animated:!0,className:`semiont-auth__logo`}),(0,P.jsx)(`p`,{className:`semiont-auth__welcome`,children:n.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-auth__subtitle`,children:n.signUpPrompt})]}),(0,P.jsxs)(`div`,{className:`semiont-auth__forms`,children:[(0,P.jsxs)(`button`,{onClick:async()=>{i(!0);try{await e()}catch(e){console.error(`Failed to initiate Google sign-up:`,e),i(!1)}},disabled:r,className:`${Lh.primary.base} semiont-button--full-width`,children:[r?(0,P.jsx)(`div`,{className:`semiont-auth__spinner`}):(0,P.jsx)(X$,{}),r?n.creatingAccount:n.signUpWithGoogle]}),(0,P.jsxs)(`div`,{className:`semiont-auth__info`,children:[n.approvedDomainsInfo,(0,P.jsx)(`br`,{}),n.termsAgreement]})]}),(0,P.jsxs)(`div`,{className:`semiont-auth__links`,children:[(0,P.jsx)(t,{href:`/`,className:Lh.secondary.base,children:n.backToHome}),(0,P.jsx)(t,{href:`/auth/signin`,className:Lh.primary.base,children:n.alreadyHaveAccount})]})]})})})}function Q$(e,t){switch(e){case`Configuration`:return t.errorConfiguration;case`AccessDenied`:return t.errorAccessDenied;case`Verification`:return t.errorVerification;default:return t.errorGeneric}}function $$({errorType:e,Link:t,translations:n}){let r=Q$(e,n);return(0,P.jsx)(`div`,{className:`semiont-auth-error-display`,children:(0,P.jsxs)(`div`,{className:`semiont-auth-error-display__container`,children:[(0,P.jsx)(`div`,{children:(0,P.jsx)(`h2`,{className:`semiont-auth-error-display__title`,children:n.pageTitle})}),(0,P.jsx)(`div`,{className:`semiont-auth-error-display__error-box`,children:(0,P.jsx)(`div`,{className:`semiont-auth-error-display__error-message`,children:r})}),(0,P.jsx)(`div`,{className:`semiont-auth-error-display__actions`,children:(0,P.jsx)(t,{href:`/auth/signin`,className:`semiont-auth-error-display__link`,children:n.tryAgain})})]})})}function e1({userName:e,status:t,isProcessing:n,onAccept:r,onDecline:i,translations:a,PageLayout:o,Link:s}){return t===`loading`?(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__loading`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__loading-content`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__spinner`}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__loading-text`,children:a.loading})]})})}):t===`accepted`?(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__accepted`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__accepted-content`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__accepted-icon`,children:(0,P.jsx)(`svg`,{className:`semiont-welcome-page__accepted-checkmark`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`semiont-welcome-page__accepted-title`,children:a.welcomeTitle}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__accepted-subtitle`,children:a.thanksForAccepting})]})]})})}):(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__form-wrapper`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__form`,children:[(0,P.jsxs)(`div`,{className:`semiont-welcome-page__form-header`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__form-icon`,children:(0,P.jsx)(`svg`,{className:`semiont-welcome-page__form-icon-svg`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,P.jsx)(`h1`,{className:`semiont-welcome-page__form-title`,children:a.welcomeUser.replace(`{firstName}`,e||``)}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__form-subtitle`,children:a.reviewTermsPrompt})]}),(0,P.jsx)(`div`,{className:`semiont-welcome-page__terms-content`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__prose`,children:[(0,P.jsx)(`h3`,{children:a.termsSummaryTitle}),(0,P.jsx)(`p`,{children:a.termsSummaryIntro}),(0,P.jsx)(`h4`,{children:a.acceptableUseTitle}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.acceptableUseResponsible}),(0,P.jsx)(`li`,{children:a.acceptableUseRespect}),(0,P.jsx)(`li`,{children:a.acceptableUseConduct})]}),(0,P.jsx)(`h4`,{children:a.prohibitedContentTitle}),(0,P.jsx)(`p`,{children:a.prohibitedContentIntro}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.prohibitedIllegal}),(0,P.jsx)(`li`,{children:a.prohibitedAdult}),(0,P.jsx)(`li`,{children:a.prohibitedHate}),(0,P.jsx)(`li`,{children:a.prohibitedViolence}),(0,P.jsx)(`li`,{children:a.prohibitedMisinformation}),(0,P.jsx)(`li`,{children:a.prohibitedPrivacy}),(0,P.jsx)(`li`,{children:a.prohibitedCopyright}),(0,P.jsx)(`li`,{children:a.prohibitedMalware}),(0,P.jsx)(`li`,{children:a.prohibitedSpam})]}),(0,P.jsx)(`h4`,{children:a.conductTitle}),(0,P.jsxs)(`p`,{children:[a.conductDescription,` `,(0,P.jsx)(`a`,{href:`https://ai-alliance.cdn.prismic.io/ai-alliance/Zl-MG5m069VX1dgH_AIAllianceCodeofConduct.pdf`,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-link`,children:a.conductLink}),a.conductPromotion]}),(0,P.jsx)(`h4`,{children:a.responsibilitiesTitle}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.responsibilitiesSecure}),(0,P.jsx)(`li`,{children:a.responsibilitiesReport}),(0,P.jsx)(`li`,{children:a.responsibilitiesAccurate}),(0,P.jsx)(`li`,{children:a.responsibilitiesComply})]}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__warning`,children:a.violationsWarning})]})}),(0,P.jsxs)(`div`,{className:`semiont-welcome-page__actions`,children:[(0,P.jsxs)(`p`,{className:`semiont-welcome-page__legal-links`,children:[a.readFullTerms,` `,(0,P.jsx)(s,{href:`/terms`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.termsOfService}),` `,a.and,` `,(0,P.jsx)(s,{href:`/privacy`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.privacyPolicy})]}),(0,P.jsxs)(`div`,{className:`semiont-welcome-page__buttons`,children:[(0,P.jsx)(`button`,{onClick:i,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--secondary`,children:a.declineAndSignOut}),(0,P.jsx)(`button`,{onClick:r,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--primary`,children:n?a.processing:a.acceptAndContinue})]}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__legal-notice`,children:a.legallyBound})]})]})})})}function t1({entityTypes:e,error:t,newTag:n,onNewTagChange:r,onAddTag:i,isAddingTag:a,theme:o,showLineNumbers:s,activePanel:c,translations:l,ToolbarPanels:u,Toolbar:d}){return(0,P.jsxs)(`div`,{className:`semiont-page${c&&I$.includes(c)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:l.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:l.pageDescription})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-entity-tags__header`,children:[(0,P.jsx)(`div`,{className:`semiont-entity-tags__icon-box`,children:(0,P.jsx)(A$,{className:`semiont-entity-tags__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-entity-tags__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-entity-tags__title`,children:l.sectionTitle}),(0,P.jsx)(`p`,{className:`semiont-entity-tags__description`,children:l.sectionDescription})]})]}),(0,P.jsx)(`div`,{className:`semiont-entity-tags__tags-section`,children:(0,P.jsx)(`div`,{className:`semiont-tags`,children:e.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--info semiont-tag--rounded-md`,children:e},e))})}),(0,P.jsxs)(`div`,{className:`semiont-entity-tags__input-group`,children:[(0,P.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},placeholder:l.inputPlaceholder,className:`semiont-entity-tags__input`,disabled:a}),(0,P.jsx)(`button`,{onClick:i,disabled:a||!n.trim(),className:`semiont-button semiont-button--primary`,children:a?l.adding:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w$,{className:`semiont-icon semiont-icon--small semiont-icon--inline`}),l.addTag]})})]}),t&&(0,P.jsxs)(`div`,{className:`semiont-entity-tags__error`,children:[(0,P.jsx)(u$,{className:`semiont-entity-tags__error-icon`}),t]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(u,{activePanel:c,theme:o,showLineNumbers:s}),(0,P.jsx)(d,{context:`simple`,activePanel:c})]})]})}function n1({isLoading:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,ToolbarPanels:a,Toolbar:o}){return e?(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:i.loading})}):(0,P.jsxs)(`div`,{className:`semiont-page${r&&I$.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:i.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.pageDescription})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-recent-docs__header`,children:[(0,P.jsx)(`div`,{className:`semiont-recent-docs__icon-box`,children:(0,P.jsx)(o$,{className:`semiont-recent-docs__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-recent-docs__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-recent-docs__title`,children:i.sectionTitle}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__description`,children:i.sectionDescription})]})]}),(0,P.jsxs)(`div`,{className:`semiont-recent-docs__empty-state`,children:[(0,P.jsx)(`svg`,{className:`semiont-recent-docs__empty-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__empty-message`,children:i.noDocuments}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__empty-hint`,children:i.activityWillAppear})]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(a,{activePanel:r,theme:t,showLineNumbers:n}),(0,P.jsx)(o,{context:`simple`,activePanel:r})]})]})}var r1={legal:E$,scientific:n$,general:v$},i1={legal:`semiont-schema-domain--legal`,scientific:`semiont-schema-domain--scientific`,general:`semiont-schema-domain--general`};function a1({schemas:e,isLoading:t,theme:n,showLineNumbers:r,activePanel:i,translations:a,ToolbarPanels:o,Toolbar:s}){return t?(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:a.loading})}):(0,P.jsxs)(`div`,{className:`semiont-page${i&&I$.includes(i)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:a.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:a.pageDescription})]}),(0,P.jsx)(`div`,{className:`semiont-card-grid semiont-card-grid--two-columns`,children:e.map(e=>{let t=r1[e.domain]||v$,n=i1[e.domain]||i1.general;return(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-schema__header`,children:[(0,P.jsx)(`div`,{className:`semiont-schema__icon-wrapper ${n}`,children:t&&(0,P.jsx)(t,{className:`semiont-schema__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-schema__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-schema__title`,children:e.name}),(0,P.jsx)(`p`,{className:`semiont-schema__description`,children:e.description}),(0,P.jsx)(`span`,{className:`semiont-schema__badge ${n}`,children:e.domain})]})]}),(0,P.jsxs)(`div`,{className:`semiont-schema__categories`,children:[(0,P.jsx)(`h4`,{className:`semiont-schema__categories-title`,children:a.categories}),e.tags.map(e=>(0,P.jsxs)(`div`,{className:`semiont-schema__category`,children:[(0,P.jsx)(`div`,{className:`semiont-schema__category-name`,children:e.name}),(0,P.jsx)(`div`,{className:`semiont-schema__category-description`,children:e.description}),(0,P.jsxs)(`div`,{className:`semiont-schema__examples`,children:[e.examples.slice(0,2).map((e,t)=>(0,P.jsx)(`span`,{className:`semiont-schema__example`,children:e},t)),e.examples.length>2&&(0,P.jsxs)(`span`,{className:`semiont-schema__example-more`,children:[`+`,e.examples.length-2,` more`]})]})]},e.name))]})]},e.id)})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(o,{activePanel:i,theme:n,showLineNumbers:r}),(0,P.jsx)(s,{context:`simple`,activePanel:i})]})]})}function o1(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function s1({progress:e,label:t=`Upload`}){if(!e)return null;if(e.phase===`started`)return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:(0,P.jsxs)(`span`,{children:[t,`: starting…`]})}),(0,P.jsx)(`div`,{className:`semiont-progress semiont-progress--indeterminate`,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill`})})]});if(e.phase===`progress`){let n=e.totalBytes<=0,r=n?0:Math.min(100,Math.round(e.bytesUploaded/e.totalBytes*100));return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:n?(0,P.jsxs)(`span`,{children:[t,`: `,o1(e.bytesUploaded),`…`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[t,`: `,r,`%`]}),(0,P.jsxs)(`span`,{children:[o1(e.bytesUploaded),` / `,o1(e.totalBytes)]})]})}),(0,P.jsx)(`div`,{className:`semiont-progress${n?` semiont-progress--indeterminate`:``}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":n?void 0:100,"aria-valuenow":n?void 0:r,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill`,style:n?void 0:{width:`${r}%`}})})]})}return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:(0,P.jsxs)(`span`,{children:[t,`: uploaded`]})}),(0,P.jsx)(`div`,{className:`semiont-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":100,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill semiont-progress__fill--success`,style:{width:`100%`}})})]})}function c1({mode:e,cloneData:t,referenceData:n,gatheredContext:r,availableEntityTypes:i,initialLocale:a,theme:o,showLineNumbers:s,hoverDelayMs:c,activePanel:l,onSaveResource:u,onCancel:d,uploadProgress:f=null,translations:p,ToolbarPanels:h,Toolbar:g}){let{announceFormSubmitting:_,announceFormSuccess:v,announceFormError:y}=DE(),[b,x]=(0,m.useState)(``),[S,C]=(0,m.useState)(``),[w,T]=(0,m.useState)([]),[E,D]=(0,m.useState)(!1),[O,k]=(0,m.useState)(`write`),[A,ee]=(0,m.useState)(null),[te,j]=(0,m.useState)(`text/markdown`),[ne,re]=(0,m.useState)(null),[ie,ae]=(0,m.useState)(`text/markdown`),[M,oe]=(0,m.useState)(a),[se,ce]=(0,m.useState)(``),[le,ue]=(0,m.useState)(``),[N,de]=(0,m.useState)(!0);(0,m.useEffect)(()=>{e===`clone`&&t?(x(t.sourceResource.name),C(t.sourceContent)):e===`reference`&&n&&(x(n.name),n.entityTypes.length>0&&T(n.entityTypes))},[e,t,n]);let fe=e=>{let t=e.target.files?.[0];if(t)if(ee(t),j(t.type),k(`upload`),b||x(t.name.replace(/\.[^/.]+$/,``)),Fo(t.type)||Lo(t.type))re(URL.createObjectURL(t));else{let e=new FileReader;e.onload=e=>{let t=e.target?.result;C(t)},e.readAsText(t)}};(0,m.useEffect)(()=>()=>{ne&&URL.revokeObjectURL(ne)},[ne]);let pe=async t=>{if(t.preventDefault(),b.trim()){D(!0),_();try{let t={mode:e,name:b,storageUri:`file://${le}`,content:S,format:A?te:ie,entityTypes:w,language:M};A&&(t.file=A),se&&(t.charset=se),e===`clone`&&(t.archiveOriginal=N),n?.annotationUri&&(t.annotationUri=n.annotationUri),n?.sourceDocumentId&&(t.sourceDocumentId=n.sourceDocumentId),await u(t),v(e===`clone`?`Resource cloned successfully`:e===`reference`?`Reference completed successfully`:`Resource created successfully`)}catch(e){throw y(`Failed to save resource. Please try again.`),e}finally{D(!1)}}},me=e===`clone`,he=e===`reference`;return(0,P.jsxs)(`div`,{className:`semiont-page${l&&I$.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content semiont-page__compose`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:me?p.titleEditClone:he?p.titleCompleteReference:p.title}),(me||he)&&(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:me?p.subtitleClone:p.subtitleReference}),he&&(0,P.jsx)(`div`,{className:`semiont-page__reference-notice`,children:(0,P.jsx)(`p`,{className:`semiont-page__reference-notice-text`,children:p.linkedNoticePrefix})})]}),r&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,style:{marginBottom:`1.5rem`,padding:`1rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`},children:[(0,P.jsx)(`h3`,{className:`semiont-form__label`,style:{marginBottom:`0.75rem`},children:`Gathered Context`}),r.sourceContext&&(0,P.jsx)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-primary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`,maxHeight:`150px`,overflowY:`auto`,marginBottom:`0.5rem`},children:(0,P.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[r.sourceContext.before&&(0,P.jsx)(`span`,{children:r.sourceContext.before}),(0,P.jsx)(`span`,{style:{backgroundColor:`var(--semiont-color-primary-100)`,padding:`0 0.25rem`,fontWeight:600,color:`var(--semiont-color-primary-900)`},children:r.sourceContext.selected}),r.sourceContext.after&&(0,P.jsx)(`span`,{children:r.sourceContext.after})]})}),r.graphContext&&r.graphContext.connections&&r.graphContext.connections.length>0&&(0,P.jsxs)(`div`,{style:{padding:`0.5rem 0`,fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-secondary)`},children:[(0,P.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:500,marginRight:`0.5rem`},children:`Connections:`}),r.graphContext.connections.map(e=>(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.5rem`,marginRight:`0.25rem`},children:e.resourceName},e.resourceId))]})]}),(0,P.jsx)(`div`,{className:`semiont-form`,children:(0,P.jsxs)(`form`,{onSubmit:pe,className:`semiont-form__fields semiont-compose-grid`,children:[(0,P.jsxs)(`div`,{className:`semiont-compose-grid__meta`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`docName`,className:`semiont-form__label`,children:p.resourceName}),(0,P.jsx)(`input`,{id:`docName`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:p.resourceNamePlaceholder,className:`semiont-input`,required:!0,disabled:E})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,P.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,P.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,P.jsx)(`input`,{id:`storagePath`,type:`text`,value:le,onChange:e=>ue(e.target.value),placeholder:`docs/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:E})]})]}),(!he||w.length===0)&&(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,P.jsx)(`div`,{className:`semiont-form__label`,children:p.entityTypes}),(0,P.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,"aria-describedby":`entity-types-description`,children:i.map(e=>{let t=w.includes(e);return(0,P.jsx)(`button`,{type:`button`,onClick:()=>{T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`semiont-form__entity-type-button`,"data-selected":t,disabled:E,"aria-pressed":t,"aria-label":`${e} entity type, ${t?`selected`:`not selected`}`,children:e},e)})}),w.length>0&&(0,P.jsxs)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:[w.length,` entity type`,w.length===1?``:`s`,` selected: `,w.join(`, `)]})]}),he&&w.length>0&&(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types-display`,role:`region`,"aria-labelledby":`selected-entity-types-label`,children:[(0,P.jsx)(`h3`,{id:`selected-entity-types-label`,className:`semiont-form__label`,children:p.entityTypes}),(0,P.jsx)(`div`,{className:`semiont-form__entity-type-tags`,role:`list`,children:w.map(e=>(0,P.jsx)(`span`,{role:`listitem`,className:`semiont-form__entity-type-tag`,"aria-label":`Entity type: ${e}`,children:e},e))}),(0,P.jsx)(`p`,{className:`semiont-form__helper-text`,id:`reference-entity-types-description`,children:`These entity types were selected when creating the reference`})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:p.language}),(0,P.jsx)(`select`,{id:`language-select`,value:M,onChange:e=>oe(e.target.value),disabled:E,className:`semiont-select`,children:Co.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]})]}),(0,P.jsxs)(`div`,{className:`semiont-compose-grid__content`,children:[!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{className:`semiont-form__label`,children:p.contentSource}),(0,P.jsxs)(`div`,{className:`semiont-form__content-source-toggle`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>k(`upload`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`upload`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,P.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`📎`}),(0,P.jsx)(`span`,{className:`semiont-form__content-source-label`,children:p.uploadFile})]}),(0,P.jsx)(`div`,{className:`semiont-form__content-source-description`,children:p.uploadFileDescription})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>k(`write`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`write`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,P.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`✍️`}),(0,P.jsx)(`span`,{className:`semiont-form__content-source-label`,children:p.writeContent})]}),(0,P.jsx)(`div`,{className:`semiont-form__content-source-description`,children:p.writeContentDescription})]})]})]}),!me&&!he&&O===`upload`&&(0,P.jsxs)(`div`,{className:`semiont-form__upload-section`,children:[(0,P.jsx)(`div`,{children:(0,P.jsxs)(`div`,{className:`semiont-form__upload-container`,children:[(0,P.jsx)(`label`,{className:`semiont-form__upload-dropzone`,children:(0,P.jsxs)(`div`,{className:`semiont-form__upload-area`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`text/plain,text/markdown,image/png,image/jpeg,application/pdf`,onChange:fe,className:`semiont-form__upload-input`,disabled:E}),(0,P.jsx)(`p`,{className:`semiont-form__upload-text`,children:A?A.name:p.dropFileOrClick}),(0,P.jsx)(`p`,{className:`semiont-form__upload-hint`,children:p.supportedFormats})]})}),A&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>{ee(null),re(null),j(`text/markdown`)},className:`semiont-button semiont-button--danger semiont-button--small`,disabled:E,children:`Clear`})]})}),A&&(0,P.jsxs)(`div`,{className:`semiont-form__media-type`,children:[(0,P.jsxs)(`span`,{className:`semiont-form__media-type-label`,children:[p.mediaType,`:`]}),(0,P.jsx)(`code`,{className:`semiont-form__media-type-value`,children:te}),(0,P.jsx)(`span`,{className:`semiont-form__media-type-lock`,title:p.autoDetected,children:`🔒`})]}),A&&ne&&Fo(te)&&(0,P.jsxs)(`div`,{className:`semiont-form__image-preview`,children:[(0,P.jsx)(`p`,{className:`semiont-form__image-preview-label`,children:`Preview:`}),(0,P.jsx)(`div`,{className:`semiont-form__image-preview-container`,children:(0,P.jsx)(`img`,{src:ne,alt:`Upload preview`,className:`semiont-form__image-preview-img`})})]})]}),(me||he||O===`write`)&&(0,P.jsxs)(`div`,{className:`semiont-form__write-section`,children:[!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`format-select`,className:`semiont-form__label`,children:p.format}),(0,P.jsxs)(`select`,{id:`format-select`,value:ie,onChange:e=>ae(e.target.value),disabled:E,className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:`text/markdown`,children:`Markdown (text/markdown)`}),(0,P.jsx)(`option`,{value:`text/plain`,children:`Plain Text (text/plain)`}),(0,P.jsx)(`option`,{value:`text/html`,children:`HTML (text/html)`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,P.jsx)(`label`,{className:`semiont-form__label`,children:me?p.resourceContent:p.content}),(0,P.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:M,children:(0,P.jsx)(WN,{content:S,editable:!E,sourceView:!0,showLineNumbers:s,hoverDelayMs:c,onChange:e=>C(e)})})]}),!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`charset-select`,className:`semiont-form__label`,children:p.encoding}),(0,P.jsxs)(`select`,{id:`charset-select`,value:se,onChange:e=>ce(e.target.value),disabled:E,className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:``,children:`UTF-8 (default)`}),(0,P.jsx)(`option`,{value:`iso-8859-1`,children:`ISO-8859-1 (Latin-1)`}),(0,P.jsx)(`option`,{value:`windows-1252`,children:`Windows-1252`}),(0,P.jsx)(`option`,{value:`ascii`,children:`ASCII`}),(0,P.jsx)(`option`,{value:`utf-16le`,children:`UTF-16LE`})]})]})]}),me&&(0,P.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,P.jsx)(`input`,{id:`archiveOriginal`,type:`checkbox`,checked:N,onChange:e=>de(e.target.checked),className:`semiont-checkbox`,disabled:E}),(0,P.jsx)(`label`,{htmlFor:`archiveOriginal`,className:`semiont-form__checkbox-label`,children:p.archiveOriginal})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:d,disabled:E||f!==null,className:Lh.tertiary.base,children:p.cancel}),(0,P.jsx)(`button`,{type:`submit`,disabled:E||f!==null||!b.trim(),className:Lh.primary.base,children:E?me?p.saving:he?p.creatingAndLinking:p.creating:me?p.saveClonedResource:he?p.createAndLinkResource:p.createResource})]}),(0,P.jsx)(s1,{progress:f})]})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:l,theme:o,showLineNumbers:s}),(0,P.jsx)(g,{context:`simple`,activePanel:l})]})]})}var l1=m.memo(({resource:e,onOpen:t,tabIndex:n=0,archivedLabel:r,createdLabel:i})=>(0,P.jsxs)(`div`,{onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))},role:`button`,tabIndex:n,"aria-label":`Open resource: ${e.name}`,className:`semiont-resource-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-resource-card__header`,children:[(0,P.jsx)(`h4`,{className:`semiont-resource-card__title`,children:e.name}),e.archived&&(0,P.jsx)(`span`,{className:`semiont-resource-card__badge`,"data-type":`archived`,children:r})]}),(0,P.jsxs)(`div`,{className:`semiont-resource-card__metadata`,children:[(0,P.jsxs)(`span`,{className:`semiont-resource-card__date`,children:[i,` `,e.dateCreated?new Date(e.dateCreated).toLocaleDateString():`N/A`]}),e.entityTypes&&e.entityTypes.length>0&&(0,P.jsxs)(`div`,{className:`semiont-tags`,children:[e.entityTypes.slice(0,2).map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:e},e)),e.entityTypes.length>2&&(0,P.jsxs)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:[`+`,e.entityTypes.length-2]})]})]})]}));l1.displayName=`ResourceCard`;function u1({recentDocuments:e,searchDocuments:t,entityTypes:n,isLoadingRecent:r,isSearching:i,searchQuery:a,onSearchQueryChange:o,theme:s,showLineNumbers:c,activePanel:l,onNavigateToResource:u,onNavigateToCompose:d,translations:f,ToolbarPanels:p}){let[h,g]=(0,m.useState)(``),_=a.trim()!==``,v=_?t:e,y=h?v.filter(e=>e.entityTypes&&e.entityTypes.includes(h)):v,b=mE(n.length+1,{orientation:`horizontal`}),x=mE(y.length,{orientation:`grid`,cols:2}),S=(0,m.useRef)(u);S.current=u;let C=(0,m.useCallback)(e=>{g(e)},[]),w=(0,m.useCallback)(e=>{let t=po(e);t&&S.current(t)},[]);if(r)return(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:f.loadingKnowledgeBase})});let T=_&&t.length===0&&!i;return(0,P.jsxs)(`div`,{className:`semiont-page${l&&I$.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:f.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:f.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsx)(`div`,{className:`semiont-card__search-form`,children:(0,P.jsxs)(`div`,{className:`semiont-card__search-wrapper`,children:[(0,P.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:f.searchPlaceholder,className:`semiont-card__search-input`,"aria-label":f.searchPlaceholder}),i&&(0,P.jsx)(`span`,{className:`semiont-card__search-status`,"aria-live":`polite`,children:f.searching})]})}),n.length>0&&(0,P.jsxs)(`div`,{className:`semiont-card__filters`,children:[(0,P.jsx)(`h3`,{className:`semiont-card__filters-label`,children:f.filterByEntityType}),(0,P.jsxs)(`div`,{ref:b.containerRef,onKeyDown:b.handleKeyDown,className:`semiont-card__filter-buttons`,role:`group`,"aria-label":`Entity type filters`,children:[(0,P.jsx)(`button`,{onClick:()=>C(``),tabIndex:0,"aria-pressed":h===``,className:`semiont-card__filter-button`,"data-active":h===``,children:f.all}),n.map(e=>(0,P.jsx)(`button`,{onClick:()=>C(e),tabIndex:-1,"aria-pressed":h===e,className:`semiont-card__filter-button`,"data-active":h===e,children:e},e))]})]}),(0,P.jsxs)(`div`,{className:`semiont-card__documents`,children:[(0,P.jsx)(`h3`,{className:`semiont-card__documents-label`,children:_&&t.length>0?f.searchResults(t.length):h?f.documentsTaggedWith(h):f.recentResources}),T&&(0,P.jsx)(`div`,{className:`semiont-card__warning`,children:(0,P.jsx)(`p`,{className:`semiont-card__warning-text`,children:f.noResultsFound(a)})}),y.length>0?(0,P.jsx)(`div`,{ref:x.containerRef,onKeyDown:x.handleKeyDown,className:`semiont-card-grid`,role:`group`,"aria-label":`Document grid`,children:y.map((e,t)=>(0,P.jsx)(l1,{resource:e,onOpen:w,tabIndex:t===0?0:-1,archivedLabel:f.archived,createdLabel:f.created},po(e)))}):(0,P.jsxs)(`div`,{className:`semiont-card__empty`,children:[(0,P.jsx)(`p`,{className:`semiont-card__empty-text`,children:f.noResourcesAvailable}),!_&&(0,P.jsx)(`button`,{onClick:d,className:`semiont-card__empty-button`,children:f.composeFirstResource})]})]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(p,{activePanel:l,theme:s,showLineNumbers:c}),(0,P.jsx)(ZN,{context:`simple`,activePanel:l})]})]})}function d1(e){let t=K(R().activeSession$)?.client,[n,r]=(0,m.useState)(void 0),[i,a]=(0,m.useState)(!0);return(0,m.useEffect)(()=>{if(!t||!e){a(!1);return}let n=!1;a(!0),t.auth.mediaToken(e).then(({token:e})=>{n||(r(e),a(!1))}).catch(()=>{n||a(!1)});let i=setInterval(()=>{t.auth.mediaToken(e).then(({token:e})=>{n||r(e)}).catch(()=>{})},240*1e3);return()=>{n=!0,clearInterval(i)}},[t,e]),{token:n,loading:i}}var f1=u(Qm(),1),p1={open:!1,annotationId:null,resourceId:null,defaultTitle:``,entityTypes:[]};function m1(e,t,n,r,i){let a=zu(),o=Vu(e),s=qu(e,t),c=Uu(e,t),l=Wu(e,t),u=Gu(e,t,n);a.add(o),a.add(r),a.add(s),a.add(c),a.add(l),a.add(u);let d=e.browse.annotations(t).pipe((0,f1.map)(e=>e??[])),f=d.pipe((0,f1.map)(e=>{let t={highlights:[],comments:[],assessments:[],references:[],tags:[]};for(let n of e)no(n)?t.highlights.push(n):ao(n)?t.comments.push(n):io(n)?t.assessments.push(n):ro(n)?t.references.push(n):oo(n)&&t.tags.push(n);return t})),p=e.browse.entityTypes().pipe((0,f1.map)(e=>e??[])),m=e.browse.events(t).pipe((0,f1.map)(e=>e??[])),h=e.browse.referencedBy(t).pipe((0,f1.map)(e=>e??[])),g=new f1.BehaviorSubject(``),_=new f1.BehaviorSubject(!1),v=new f1.BehaviorSubject(null),y=i?.mediaType||`text/plain`,b=y.startsWith(`image/`)||y===`application/pdf`;!b&&y&&(_.next(!0),e.browse.resourceRepresentation(t,{accept:y}).then(({data:e})=>{g.next(Po(e,y)),_.next(!1)}).catch(()=>{_.next(!1)})),b&&e.auth.mediaToken(t).then(({token:e})=>v.next(e)).catch(()=>{});let x=new f1.BehaviorSubject(p1),S=e.subscribeToResource(t);a.add(S);let C=e.bus.get(`bind:initiate`).subscribe(t=>{x.next({open:!0,annotationId:t.annotationId,resourceId:t.resourceId,defaultTitle:t.defaultTitle,entityTypes:t.entityTypes}),e.bus.get(`gather:requested`).next({correlationId:crypto.randomUUID(),annotationId:t.annotationId,resourceId:t.resourceId,options:{contextWindow:2e3}})});return a.add(()=>C.unsubscribe()),{beckon:o,browse:r,mark:s,gather:c,yield:u,annotations$:d,annotationGroups$:f,entityTypes$:p,events$:m,referencedBy$:h,content$:g.asObservable(),contentLoading$:_.asObservable(),mediaToken$:v.asObservable(),wizard$:x.asObservable(),closeWizard:()=>x.next(p1),dispose:()=>{x.complete(),g.complete(),_.complete(),v.complete(),a.dispose()}}}function h1(){return typeof window>`u`?null:localStorage.getItem(`activeToolbarPanel`)||`knowledge-base`}function g1(e){typeof window>`u`||(e?localStorage.setItem(`activeToolbarPanel`,e):localStorage.removeItem(`activeToolbarPanel`))}function _1(){let e=R();return iE(()=>z$(e,{initialPanel:h1(),onPanelChange:g1}))}function v1({resource:e,rUri:t,locale:n,Link:r,routes:i,ToolbarPanels:a,refetchDocument:o,streamStatus:s,knowledgeBaseName:c}){let l=hh(`ReferenceWizard`),u=R(),d=K(u.activeSession$),f=d?.client,{showError:p,showSuccess:h,showInfo:g}=sh(),{theme:_,setTheme:v}=vE(),{showLineNumbers:y,toggleLineNumbers:b}=lE(),{hoverDelayMs:x}=dE(),{triggerSparkleAnimation:S,clearNewAnnotationId:C}=jE(),w=Ro(ho(e)||`text/plain`)===`image`,{content:T,loading:E}=bE(t,e,!w),{token:D,loading:O}=d1(t),k=w&&D&&f?`${f.baseUrl}/api/resources/${t}?token=${D}`:``,A=w?k:T,ee=w?O:E,te=_1(),j=iE(()=>m1(f,t,n,te)),ne=K(j.annotations$)??[],re=K(j.annotationGroups$),ie=K(j.entityTypes$)??[],ae=K(j.referencedBy$),M=ae??[],oe=ae===void 0,se=K(j.beckon.hoveredAnnotationId$)??null,ce=K(j.mark.pendingAnnotation$)??null,le=K(j.mark.assistingMotivation$)??null,ue=K(j.mark.progress$)??null,N=K(j.browse.activePanel$)??null,de=K(j.browse.scrollToAnnotationId$)??null,fe=K(j.browse.panelInitialTab$)??null,pe=j.browse.onScrollCompleted,me=K(j.yield.progress$)??null,he=K(j.gather.context$)??null,ge=K(j.gather.loading$)??!1,_e=K(j.gather.error$)??null,ve=K(j.wizard$),ye=ve?.open??!1,be=ve?.annotationId??null,xe=ve?.resourceId??null,Se=ve?.defaultTitle??``,Ce=ve?.entityTypes??[],we=(0,m.useCallback)(()=>{j.closeWizard()},[j]),Te=(0,m.useCallback)((t,n)=>{C(za(t)),j.yield.generate(t,{title:n.title,storageUri:n.storagePath,prompt:n.prompt,language:n.language,sourceLanguage:go(e),temperature:n.temperature,maxTokens:n.maxTokens,context:n.context})},[j,C,e]),Ee=(0,m.useCallback)(async(e,n)=>{if(f)try{await f.bind.body(t,za(e),[{op:`add`,item:{type:`SpecificResource`,source:n,purpose:`linking`}}]),h(`Reference linked successfully`)}catch(e){p(`Failed to link reference: ${e instanceof Error?e.message:String(e)}`)}},[t,f,h,p]),De=(0,m.useCallback)((e,t,n,r,i)=>{sessionStorage.setItem(`gather-context:${t}`,JSON.stringify(e));let a=new URLSearchParams({annotationUri:t,sourceDocumentId:n,name:r,entityTypes:i.join(`,`)});u.emit(`nav:push`,{path:`/know/compose?${a.toString()}`,reason:`compose-from-wizard`})},[d]);(0,m.useEffect)(()=>{if(e&&t){let n=ho(e);u.addOpenResource(t,e.name,n||void 0,e.storageUri),typeof localStorage<`u`&&localStorage.setItem(`lastViewedDocumentId`,t)}},[e,t,u]),(0,m.useEffect)(()=>{ce&&u.emit(`panel:open`,{panel:`annotations`})},[ce,u]);let Oe=(0,m.useCallback)(async()=>{if(f)try{await f.mark.archive(t),await o()}catch(e){console.error(`Failed to archive document:`,e),p(`Failed to archive document`)}},[f,t,o,p]),ke=(0,m.useCallback)(async()=>{if(f)try{await f.mark.unarchive(t),await o()}catch(e){console.error(`Failed to unarchive document:`,e),p(`Failed to unarchive document`)}},[f,t,o,p]),Ae=(0,m.useCallback)(async()=>{if(f)try{let e=(await f.yield.cloneToken(t)).token;u.emit(`nav:push`,{path:`/know/compose?mode=clone&token=${e}`,reason:`clone`})}catch(e){console.error(`Failed to generate clone token:`,e),p(`Failed to generate clone link`)}},[f,t,p,d]),je=(0,m.useCallback)(({annotationId:e})=>{S(e)},[S]),Me=(0,m.useCallback)(e=>{S(e.payload.annotation.id)},[S]),Ne=(0,m.useCallback)(({message:e})=>p(`Failed to create annotation: ${e||`unknown error`}`),[p]),Pe=(0,m.useCallback)(({message:e})=>p(`Failed to delete annotation: ${e||`unknown error`}`),[p]),Fe=(0,m.useCallback)(()=>{},[]),Ie=(0,m.useCallback)(({message:e})=>p(`Failed to update reference: ${e}`),[p]),Le=(0,m.useCallback)(({theme:e})=>v(e),[v]),Re=(0,m.useCallback)(t=>{if(t.resourceId===e.id)if(t.jobType===`generation`){let e=t.result?.resourceName;h(e?`Resource "${e}" created successfully!`:`Resource created successfully!`)}else h(`Annotation complete`)},[e.id,h]),ze=(0,m.useCallback)(t=>{t.resourceId===e.id&&(t.jobType===`generation`?p(`Resource generation failed: ${t.error}`):p(t.error||`Annotation failed`))},[e.id,p]),Be=(0,m.useCallback)(({resourceId:e})=>{if(i.resourceDetail){let t=i.resourceDetail(e);u.emit(`nav:push`,{path:t,reason:`reference-link`})}},[i.resourceDetail,d]),Ve=(0,m.useCallback)(({entityType:e})=>{if(i.know){let t=`${i.know}?entityType=${encodeURIComponent(e)}`;u.emit(`nav:push`,{path:t,reason:`entity-type-filter`})}},[i.know,d]);SE({"mark:mode-toggled":(0,m.useCallback)(()=>{Ye(e=>!e)},[]),"mark:archive":Oe,"mark:unarchive":ke,"yield:clone":Ae,"beckon:sparkle":je,"mark:added":Me,"mark:create-failed":Ne,"mark:delete-failed":Pe,"mark:body-updated":Fe,"bind:body-update-failed":Ie,"settings:theme-changed":Le,"settings:line-numbers-toggled":b,"job:complete":Re,"job:fail":ze,"mark:assist-cancelled":()=>g(`Annotation cancelled`),"browse:reference-navigate":Be,"browse:entity-type-clicked":Ve});let{announceResourceLoading:He,announceResourceLoaded:Ue}=EE();(0,m.useEffect)(()=>{ee?He(e.name):A&&Ue(e.name)},[ee,A,e.name,He,Ue]);let We=e.entityTypes||[],Ge=mo(e),Ke=Ge?.mediaType,qe=Ge?.byteSize,[Je,Ye]=(0,m.useState)(()=>typeof window<`u`?localStorage.getItem(`annotateMode`)===`true`:!1),Xe={...e,content:A},Ze=(0,m.useCallback)(e=>{e&&d?.client.beckon.sparkle(za(e))},[d]),Qe=(0,m.useCallback)(e=>{},[]);return(0,P.jsxs)(`div`,{className:`semiont-document-viewer${N?` semiont-document-viewer--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-document-viewer__main`,children:[(0,P.jsxs)(`div`,{className:`semiont-document-viewer__content`,children:[(0,P.jsx)(`div`,{className:`semiont-document-viewer__header`,children:(0,P.jsx)(`div`,{className:`semiont-document-viewer__header-inner`,children:(0,P.jsx)(`h2`,{className:`semiont-document-viewer__title`,children:e.name})})}),(0,P.jsx)(`div`,{className:`semiont-document-viewer__scrollable-body`,lang:go(e)||void 0,children:(0,P.jsx)(KN,{fallback:(e,t)=>(0,P.jsxs)(`div`,{className:`semiont-document-viewer__error`,children:[(0,P.jsx)(`h3`,{className:`semiont-document-viewer__error-title`,children:`Error loading document viewer`}),(0,P.jsx)(`p`,{className:`semiont-document-viewer__error-message`,children:e.message}),(0,P.jsx)(`button`,{onClick:t,className:`semiont-document-viewer__error-button`,children:`Try again`})]}),children:ee?(0,P.jsx)(`div`,{className:`semiont-document-viewer__loading`,children:`Loading document content...`}):(0,P.jsx)(kJ,{resource:Xe,annotations:re??{highlights:[],comments:[],assessments:[],references:[],tags:[]},generatingReferenceId:me?.annotationId??null,showLineNumbers:y,hoverDelayMs:x,hoveredAnnotationId:se})})})]}),(0,P.jsxs)(`div`,{className:`semiont-document-viewer__sidebar`,children:[(0,P.jsxs)(a,{activePanel:N,theme:_,showLineNumbers:y,width:N===`jsonld`?`w-[600px]`:N===`annotations`?`w-[400px]`:`w-64`,children:[Je&&e.archived&&(0,P.jsx)(`div`,{className:`semiont-document-viewer__archived-status`,children:(0,P.jsx)(`div`,{className:`semiont-document-viewer__archived-text`,children:`📦 Archived`})}),N===`annotations`&&!e.archived&&(0,P.jsx)(sY,{annotations:ne,annotators:Ih,annotateMode:Je,assistingMotivation:le,progress:ue,pendingAnnotation:ce,allEntityTypes:ie,generatingReferenceId:me?.annotationId??null,referencedBy:M,referencedByLoading:oe,resourceId:t,locale:n,sourceLanguage:go(e),scrollToAnnotationId:de,hoveredAnnotationId:se,onScrollCompleted:pe,initialTab:fe?.tab,initialTabGeneration:fe?.generation,Link:r,routes:i}),N===`history`&&(0,P.jsx)(UR,{rUri:t,hoveredAnnotationId:se,onEventHover:Ze,onEventClick:Qe,Link:r,routes:i}),N===`info`&&(0,P.jsx)(tY,{resourceId:t,documentEntityTypes:We,documentLocale:go(e),primaryMediaType:Ke,primaryByteSize:qe,storageUri:e.storageUri,isArchived:e.archived??!1,dateCreated:e.dateCreated,dateModified:e.dateModified,wasAttributedTo:e.wasAttributedTo,wasDerivedFrom:e.wasDerivedFrom,generator:e.generator}),N===`collaboration`&&(0,P.jsx)(zJ,{state:s,eventCount:0,knowledgeBaseName:c}),N===`jsonld`&&(0,P.jsx)(qJ,{resource:e})]}),(0,P.jsx)(ZN,{context:`document`,activePanel:N,isArchived:e.archived??!1})]})]}),(0,P.jsx)(zQ,{isOpen:ye,onClose:we,annotationId:be,resourceId:xe,defaultTitle:Se,entityTypes:Ce,locale:n,context:he,contextLoading:ge,contextError:_e,onGenerateSubmit:Te,onLinkResource:Ee,onComposeNavigate:De,translations:{gatherTitle:l(`gatherTitle`),configureGenerationTitle:l(`configureGenerationTitle`),configureSearchTitle:l(`configureSearchTitle`),searchResultsTitle:l(`searchResultsTitle`),sourceContextLabel:l(`sourceContextLabel`),connectionsLabel:l(`connectionsLabel`),citedByLabel:l(`citedByLabel`),userHintLabel:l(`userHintLabel`),userHintPlaceholder:l(`userHintPlaceholder`),loadingContext:l(`loadingContext`),failedContext:l(`failedContext`),cancel:l(`cancel`),search:l(`search`),searching:l(`searching`),generate:l(`generate`),compose:l(`compose`),resolutionStrategyLabel:l(`resolutionStrategyLabel`),back:l(`back`),link:l(`link`),score:l(`score`),noResults:l(`noResults`),resourceTitle:l(`resourceTitle`),resourceTitlePlaceholder:l(`resourceTitlePlaceholder`),additionalInstructions:l(`additionalInstructions`),additionalInstructionsPlaceholder:l(`additionalInstructionsPlaceholder`),language:l(`language`),languageHelp:l(`languageHelp`),creativity:l(`creativity`),creativityFocused:l(`creativityFocused`),creativityCreative:l(`creativityCreative`),maxLength:l(`maxLength`),maxLengthHelp:l(`maxLengthHelp`),maxResults:l(`maxResults`),semanticScoring:l(`semanticScoring`),semanticScoringHelp:l(`semanticScoringHelp`)}})]})}var y1=u(Qm(),1);function b1(e){let t=new y1.BehaviorSubject(!1);return{isLoggingOut$:t.asObservable(),logout:async()=>{t.next(!0);try{await e.auth.logout()}catch{}finally{t.next(!1)}},dispose:()=>{t.complete()}}}var x1=u(Qm(),1);function S1(e,t,n,r){let i=zu();i.add(t);let a=!!(n.annotationUri&&n.sourceDocumentId&&n.name),o=n.mode===`clone`&&!!n.token,s=o?`clone`:a?`reference`:`new`,c=new x1.BehaviorSubject(s),l=new x1.BehaviorSubject(!0),u=new x1.BehaviorSubject(null),d=new x1.BehaviorSubject(null),f=new x1.BehaviorSubject(null),p=new x1.BehaviorSubject(null),m=e.browse.entityTypes().pipe((0,x1.map)(e=>e??[]));if(a){let e=n.entityTypes?n.entityTypes.split(`,`):[];if(d.next({annotationUri:n.annotationUri,sourceDocumentId:n.sourceDocumentId,name:n.name,entityTypes:e}),n.storedContext)try{f.next(JSON.parse(n.storedContext))}catch{}l.next(!1)}else o?(async()=>{try{let t=await e.yield.fromToken(n.token);if(t&&r){let n=Ra(t[`@id`]),r=ho(t)||`text/plain`,{data:i}=await e.browse.resourceRepresentation(n,{accept:r}),a=Po(i,r);u.next({sourceResource:t,sourceContent:a})}}catch{}l.next(!1)})():l.next(!1);return{browse:t,mode$:c.asObservable(),loading$:l.asObservable(),cloneData$:u.asObservable(),referenceData$:d.asObservable(),gatheredContext$:f.asObservable(),entityTypes$:m,uploadProgress$:p.asObservable(),save:async t=>{if(t.mode===`clone`)return(await e.yield.createFromToken({token:n.token,name:t.name,content:t.content,archiveOriginal:t.archiveOriginal??!0})).resourceId;let r,i;if(t.file)r=t.file,i=t.format??`application/octet-stream`;else{let e=new Blob([t.content||``],{type:t.format??`application/octet-stream`}),n=t.format===`text/plain`?`.txt`:t.format===`text/html`?`.html`:`.md`;r=new File([e],t.name+n,{type:t.format??`application/octet-stream`}),i=t.format??`application/octet-stream`}let a=t.charset&&!t.file?`${i}; charset=${t.charset}`:i,o=await new Promise((n,i)=>{e.yield.resource({name:t.name,file:r,format:a,entityTypes:t.entityTypes||[],language:t.language,storageUri:t.storageUri}).subscribe({next:e=>{p.next(e),e.phase===`finished`&&n(e.resourceId)},error:e=>{p.next(null),i(e)},complete:()=>p.next(null)})});return t.mode===`reference`&&t.annotationUri&&t.sourceDocumentId&&await e.bind.body(Ra(t.sourceDocumentId),za(t.annotationUri),[{op:`add`,item:{type:`SpecificResource`,source:o,purpose:`linking`}}]),o},dispose:()=>{c.complete(),l.complete(),u.complete(),d.complete(),f.complete(),i.dispose()}}}var C1=u(Qm(),1);function w1(e,t){let n=e.browse.resource(t);return{resource$:n,isLoading$:n.pipe((0,C1.map)(e=>e===void 0)),invalidate:()=>e.browse.invalidateResourceDetail(t),dispose:()=>{}}}var T1=u(Qm(),1);function E1(e,t){let n=zu();n.add(t);let r=new T1.BehaviorSubject([]),i=new T1.BehaviorSubject(null),a=new T1.BehaviorSubject(!0),o=new T1.BehaviorSubject(!0),s=()=>{a.next(!0),e.admin.users().then(e=>{r.next(e.users??[]),a.next(!1)}).catch(()=>a.next(!1))},c=()=>{o.next(!0),e.admin.userStats().then(e=>{i.next(e.stats??null),o.next(!1)}).catch(()=>o.next(!1))};return s(),c(),{browse:t,users$:r.asObservable(),stats$:i.asObservable(),usersLoading$:a.asObservable(),statsLoading$:o.asObservable(),updateUser:async(t,n)=>{await e.admin.updateUser(Fa(t),n),s(),c()},dispose:()=>{r.complete(),i.complete(),a.complete(),o.complete(),n.dispose()}}}var D1=u(Qm(),1);function O1(e,t){let n=zu();n.add(t);let r=new D1.BehaviorSubject([]),i=new D1.BehaviorSubject([]),a=new D1.BehaviorSubject(!0);return e.admin.oauthConfig().then(e=>{let t=e;r.next(t.providers??[]),i.next(t.allowedDomains??[]),a.next(!1)}).catch(()=>a.next(!1)),{browse:t,providers$:r.asObservable(),allowedDomains$:i.asObservable(),isLoading$:a.asObservable(),dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}var k1=u(Qm(),1),A1=u(Fh(),1);function j1(e,t,n){let r=zu();r.add(e);let i=new k1.BehaviorSubject(null),a=new k1.BehaviorSubject(null),o=new k1.BehaviorSubject(null),s=new k1.BehaviorSubject(void 0),c=new k1.BehaviorSubject(void 0),l=new k1.BehaviorSubject(!1),u=new k1.BehaviorSubject(!1);return{browse:e,selectedFile$:i.asObservable(),preview$:a.asObservable(),importPhase$:o.asObservable(),importMessage$:s.asObservable(),importResult$:c.asObservable(),isExporting$:l.asObservable(),isImporting$:u.asObservable(),selectFile:e=>{i.next(e),o.next(null),s.next(void 0),c.next(void 0),a.next({format:e.name.endsWith(`.tar.gz`)||e.name.endsWith(`.gz`)?`semiont-linked-data`:`unknown`,version:1,sourceUrl:``,stats:{}})},cancelImport:()=>{i.next(null),a.next(null),o.next(null),s.next(void 0),c.next(void 0)},doExport:async()=>{l.next(!0);try{let e=await t();return{blob:await new Response(e.stream).blob(),filename:e.filename??`semiont-export-${Date.now()}.tar.gz`}}finally{l.next(!1)}},doImport:async()=>{let e=i.getValue();if(e){u.next(!0),o.next(`started`),s.next(void 0),c.next(void 0);try{await(0,k1.lastValueFrom)(n(e).pipe((0,A1.tap)(e=>{o.next(e.phase),s.next(e.message),e.result&&c.next(e.result)})))}finally{u.next(!1)}}},dispose:()=>{i.complete(),a.complete(),o.complete(),s.complete(),c.complete(),l.complete(),u.complete(),r.dispose()}}}var M1=u(Qm(),1);function N1(e){let t=zu(),n=new M1.BehaviorSubject(null),r=new M1.BehaviorSubject(!1);return e.auth.me().then(e=>n.next(e)).catch(()=>{}),{userData$:n.asObservable(),isProcessing$:r.asObservable(),acceptTerms:async()=>{r.next(!0);try{await e.auth.acceptTerms(),n.next({...n.getValue(),termsAcceptedAt:new Date().toISOString()})}finally{r.next(!1)}},dispose:()=>{n.complete(),r.complete(),t.dispose()}}}var P1=u(Qm(),1),F1=10,I1=20;function L1(e,t){let n=zu(),r=Bu(t=>e.browse.resources({search:t,limit:I1}));n.add(r),n.add(t);let i=e.browse.resources({limit:F1,archived:!1}),a=i.pipe((0,P1.map)(e=>e??[])),o=i.pipe((0,P1.map)(e=>e===void 0));return{browse:t,search:r,recentResources$:a,entityTypes$:e.browse.entityTypes().pipe((0,P1.map)(e=>e??[])),isLoadingRecent$:o,dispose:()=>n.dispose()}}var R1=u(Qm(),1);function z1(e,t){let n=zu();n.add(t);let r=new R1.BehaviorSubject(``),i=new R1.BehaviorSubject(``),a=new R1.BehaviorSubject(!1),o=e.browse.entityTypes();return{browse:t,entityTypes$:o.pipe((0,R1.map)(e=>e??[])),isLoading$:o.pipe((0,R1.map)(e=>e===void 0)),newTag$:r.asObservable(),error$:i.asObservable(),isAdding$:a.asObservable(),setNewTag:e=>r.next(e),addTag:async()=>{let t=r.getValue().trim();if(t){i.next(``),a.next(!0);try{await e.frame.addEntityType(t),r.next(``)}catch(e){i.next(e instanceof Error?e.message:`Failed to add entity type`)}finally{a.next(!1)}}},dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}function B1({children:e}){return(0,P.jsxs)(JN,{resetKeys:[et().pathname],children:[(0,P.jsx)(OR,{}),(0,P.jsx)(DR,{}),e]})}var V1=m.lazy(()=>b(()=>import(`./layout-DolG9tOf.js`),__vite__mapDeps([6,3,7,8,4,5]))),H1=m.lazy(()=>b(()=>import(`./page-D6oe9LkY.js`),__vite__mapDeps([9,3,8,4,5]))),U1=m.lazy(()=>b(()=>import(`./page-6YupxiP8.js`),__vite__mapDeps([10,3,11,7,8,4,5,12,13]))),W1=m.lazy(()=>b(()=>import(`./page-CXVPWK3i.js`),__vite__mapDeps([14,3,11,7,8,4,5,12,13]))),G1=m.lazy(()=>b(()=>import(`./page-A6_MoyUb2.js`),__vite__mapDeps([15,3,11,7,8,4,5,12,13]))),K1=m.lazy(()=>b(()=>import(`./page-DbwiMF1N.js`),__vite__mapDeps([16,3,8,4,5]))),q1=m.lazy(()=>b(()=>import(`./page-BrSlkHj9.js`),__vite__mapDeps([17,3,11,7,8,4,5,12,13]))),J1=m.lazy(()=>b(()=>import(`./page-C5gTlI4M.js`),__vite__mapDeps([18,3,11,7,8,4,5,12,13]))),Y1=m.lazy(()=>b(()=>import(`./page-Bl8sZu8k.js`),__vite__mapDeps([19,3,8,4,5]))),X1=m.lazy(()=>b(()=>import(`./layout-xDEqzpvE.js`),__vite__mapDeps([20,3,11,7,8,4,5,12,21,13,22]))),Z1=m.lazy(()=>b(()=>import(`./page-7cCGgkUd.js`),__vite__mapDeps([23,3,8,4,5]))),Q1=m.lazy(()=>b(()=>import(`./page-B9EYfbrY.js`),__vite__mapDeps([24,3,21,8,4,5,12]))),$1=m.lazy(()=>b(()=>import(`./page-BioSV21A.js`),__vite__mapDeps([25,3,21,8,4,5,12]))),e0=m.lazy(()=>b(()=>import(`./page-DVCVvH_S.js`),__vite__mapDeps([26,3,21,8,4,5,12,13]))),t0=m.lazy(()=>b(()=>import(`./layout-BhnmJA6O.js`),__vite__mapDeps([27,3,11,7,8,4,5,12,13,28,22,29]))),n0=m.lazy(()=>b(()=>import(`./page-BOhOKDMk.js`),__vite__mapDeps([30,8,3,4,5]))),r0=m.lazy(()=>b(()=>import(`./client-uEoQ8iJO.js`),__vite__mapDeps([31,3,21,8,4,5,12]))),i0=m.lazy(()=>b(()=>import(`./client-DkMJxPA7.js`),__vite__mapDeps([32,3,21,8,4,5,12]))),a0=m.lazy(()=>b(()=>import(`./client-DvALJ3DL.js`),__vite__mapDeps([33,3,21,8,4,5,12]))),o0=m.lazy(()=>b(()=>import(`./page-D0bYoQZI.js`),__vite__mapDeps([34,3,21,8,4,5,12,29]))),s0=m.lazy(()=>b(()=>import(`./layout-e6QyrD0Y.js`),__vite__mapDeps([35,3,11,7,8,4,5,12,13,28,22]))),c0=m.lazy(()=>b(()=>import(`./page-D1veR3Kp.js`),__vite__mapDeps([36,3,8,4,5]))),l0=m.lazy(()=>b(()=>import(`./page-8sXDEos5.js`),__vite__mapDeps([37,3,21,8,4,5,12]))),u0=m.lazy(()=>b(()=>import(`./page-CkHE2rPM.js`),__vite__mapDeps([38,3,21,8,4,5,12]))),d0=m.lazy(()=>b(()=>import(`./page-CXhfUrZM.js`),__vite__mapDeps([39,3,21,8,4,5,12]))),f0=m.lazy(()=>b(()=>import(`./client-DxlEW_QJ.js`),__vite__mapDeps([40,3,21,8,4,5,12]))),p0=m.lazy(()=>b(()=>import(`./not-found-4iuCkpA7.js`),__vite__mapDeps([41,3,8,4,5])));function m0({children:e}){let{locale:t}=st(),{i18n:n}=r();return(0,m.useEffect)(()=>{if(!t)return;let e=vr(t)?t:`en`;n.language!==e&&n.changeLanguage(e)},[t,n]),!t||!vr(t)?(0,P.jsx)(jt,{to:`/en`,replace:!0}):(0,P.jsx)(P.Fragment,{children:e})}function h0(){return(0,P.jsx)(B1,{children:(0,P.jsx)(Mt,{})})}function g0(){let e=rt();return(0,m.useEffect)(()=>{let t=navigator.language.split(`-`)[0]??`en`;e(`/${vr(t)?t:`en`}`,{replace:!0})},[e]),null}function _0(){return(0,P.jsx)(m.Suspense,{fallback:null,children:(0,P.jsxs)(Ft,{children:[(0,P.jsx)(Nt,{path:`/`,element:(0,P.jsx)(g0,{})}),(0,P.jsxs)(Nt,{path:`/:locale`,element:(0,P.jsx)(m0,{children:(0,P.jsx)(V1,{})}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(H1,{})}),(0,P.jsx)(Nt,{path:`about`,element:(0,P.jsx)(U1,{})}),(0,P.jsx)(Nt,{path:`privacy`,element:(0,P.jsx)(W1,{})}),(0,P.jsx)(Nt,{path:`terms`,element:(0,P.jsx)(G1,{})}),(0,P.jsx)(Nt,{path:`auth/connect`,element:(0,P.jsx)(K1,{})}),(0,P.jsx)(Nt,{path:`auth/signup`,element:(0,P.jsx)(q1,{})}),(0,P.jsx)(Nt,{path:`auth/error`,element:(0,P.jsx)(J1,{})}),(0,P.jsxs)(Nt,{element:(0,P.jsx)(h0,{}),children:[(0,P.jsx)(Nt,{path:`auth/welcome`,element:(0,P.jsx)(Y1,{})}),(0,P.jsxs)(Nt,{path:`know`,element:(0,P.jsx)(X1,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(Z1,{})}),(0,P.jsx)(Nt,{path:`discover`,element:(0,P.jsx)(Q1,{})}),(0,P.jsx)(Nt,{path:`compose`,element:(0,P.jsx)($1,{})}),(0,P.jsx)(Nt,{path:`resource/:id`,element:(0,P.jsx)(e0,{})})]}),(0,P.jsxs)(Nt,{path:`admin`,element:(0,P.jsx)(t0,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(n0,{})}),(0,P.jsx)(Nt,{path:`users`,element:(0,P.jsx)(r0,{})}),(0,P.jsx)(Nt,{path:`security`,element:(0,P.jsx)(i0,{})}),(0,P.jsx)(Nt,{path:`exchange`,element:(0,P.jsx)(a0,{})}),(0,P.jsx)(Nt,{path:`devops`,element:(0,P.jsx)(o0,{})})]}),(0,P.jsxs)(Nt,{path:`moderate`,element:(0,P.jsx)(s0,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(c0,{})}),(0,P.jsx)(Nt,{path:`recent`,element:(0,P.jsx)(l0,{})}),(0,P.jsx)(Nt,{path:`entity-tags`,element:(0,P.jsx)(u0,{})}),(0,P.jsx)(Nt,{path:`tag-schemas`,element:(0,P.jsx)(d0,{})}),(0,P.jsx)(Nt,{path:`linked-data`,element:(0,P.jsx)(f0,{})})]})]}),(0,P.jsx)(Nt,{path:`*`,element:(0,P.jsx)(p0,{})})]}),(0,P.jsx)(Nt,{path:`*`,element:(0,P.jsx)(jt,{to:`/en`,replace:!0})})]})})}var v0={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_OTEL_OTLP_ENDPOINT;v0&&b(async()=>{let{initObservabilityWeb:e}=await import(`./web-Dr6mdA1A.js`);return{initObservabilityWeb:e}},[]).then(({initObservabilityWeb:e})=>{e({serviceName:`semiont-frontend`,otlpEndpoint:v0})});var y0=document.getElementById(`root`);if(!y0)throw Error(`Root element not found`);g.createRoot(y0).render((0,P.jsx)(m.StrictMode,{children:(0,P.jsx)(wn,{children:(0,P.jsx)(_0,{})})}));export{hE as $,a1 as A,Ra as At,j1 as B,WQ as C,Cc as Ct,uY as D,Js as Dt,Z$ as E,tc as Et,O1 as F,et as Ft,rE as G,b1 as H,E1 as I,rt as It,dE as J,cE as K,S1 as L,st as Lt,ZN as M,Dn as Mt,e1 as N,jt as Nt,GQ as O,La as Ot,Lh as P,Mt as Pt,pE as Q,L1 as R,Fn as Rt,v1 as S,Pc as St,QN as T,nc as Tt,N1 as U,w1 as V,aE as W,lE as X,sE as Y,K as Z,XN as _,il as _t,$$ as a,mh as at,u1 as b,Kc as bt,$Q as c,uu as ct,ER as d,Eu as dt,_1 as et,YQ as f,Bl as ft,n1 as g,al as gt,XQ as h,_l as ht,Y$ as i,oh as it,_E as j,vr as jt,KQ as k,to as kt,t1 as l,Hu as lt,TE as m,yl as mt,G$ as n,vE as nt,I$ as o,R as ot,q$ as p,zl as pt,SE as q,K$ as r,th as rt,NQ as s,sh as st,B$ as t,iE as tt,cY as u,wu as ut,AE as v,rl as vt,qQ as w,rc as wt,e$ as x,Fc as xt,c1 as y,Jc as yt,z1 as z};
|
|
141
|
-
//# sourceMappingURL=index-
|
|
140
|
+
`)}QQ();function $Q({message:e}){return(0,P.jsx)(`div`,{className:`semiont-loading-state-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-compose`,children:(0,P.jsx)(`p`,{className:`semiont-loading-message`,children:e})})})}function e$(){return(0,P.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-resource`,children:(0,P.jsx)(`p`,{className:`semiont-loading-message`,children:`Loading resource...`})})}function t$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5`}))}var n$=m.forwardRef(t$);function r$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var i$=m.forwardRef(r$);function a$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`}))}var o$=m.forwardRef(a$);function s$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z`}))}var c$=m.forwardRef(s$);function l$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z`}))}var u$=m.forwardRef(l$);function d$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z`}))}var f$=m.forwardRef(d$);function p$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418`}))}var m$=m.forwardRef(p$);function h$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z`}))}var g$=m.forwardRef(h$);function _$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18`}))}var v$=m.forwardRef(_$);function y$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z`}))}var b$=m.forwardRef(y$);function x$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125`}))}var S$=m.forwardRef(x$);function C$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`}))}var w$=m.forwardRef(C$);function T$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0 0 12 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 0 1-2.031.352 5.988 5.988 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971Zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0 2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 0 1-2.031.352 5.989 5.989 0 0 1-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971Z`}))}var E$=m.forwardRef(T$);function D$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z`}))}var O$=m.forwardRef(D$);function k$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z`}),m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.008v.008H6V6Z`}))}var A$=m.forwardRef(k$);function j$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0`}))}var M$=m.forwardRef(j$);function N$({title:e,titleId:t,...n},r){return m.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?m.createElement(`title`,{id:t},e):null,m.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`}))}var P$=m.forwardRef(N$),F$=u(Qm(),1),I$=[`knowledge-base`,`user`,`settings`],L$={linking:`reference`,commenting:`comment`,tagging:`tag`,highlighting:`highlight`,assessing:`assessment`},R$=0;function z$(e,t){let n=[],r=new F$.BehaviorSubject(t?.initialPanel??null),i=new F$.BehaviorSubject(null),a=new F$.BehaviorSubject(null);if(t?.onPanelChange){let e=t.onPanelChange;n.push(r.subscribe(e))}return n.push(e.stream(`panel:toggle`).subscribe(({panel:e})=>{let t=r.getValue();r.next(t===e?null:e)})),n.push(e.stream(`panel:open`).subscribe(({panel:e,scrollToAnnotationId:t,motivation:n})=>{if(t&&i.next(t),n){let e=L$[n]||`highlight`;a.next({tab:e,generation:++R$})}r.next(e)})),n.push(e.stream(`panel:close`).subscribe(()=>{r.next(null)})),{activePanel$:r.asObservable(),scrollToAnnotationId$:i.asObservable(),panelInitialTab$:a.asObservable(),openPanel:t=>e.emit(`panel:open`,{panel:t}),closePanel:()=>e.emit(`panel:close`,void 0),togglePanel:t=>e.emit(`panel:toggle`,{panel:t}),onScrollCompleted:()=>i.next(null),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete()}}}function B$({suggestedFeatures:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,StatusDisplay:a,ToolbarPanels:o,Toolbar:s}){return(0,P.jsxs)(`div`,{className:`semiont-page${r&&I$.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:i.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.systemStatus}),(0,P.jsx)(a,{})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:i.cliOperations}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:i.cliOperationsDescription}),(0,P.jsx)(`div`,{className:`semiont-admin__features-grid`,children:e.map(e=>(0,P.jsx)(`div`,{className:`semiont-devops-feature`,children:(0,P.jsxs)(`div`,{className:`semiont-devops-feature__header`,children:[(0,P.jsx)(`div`,{className:`semiont-devops-feature__icon-box`,children:(0,P.jsx)(e.icon,{className:`semiont-devops-feature__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-devops-feature__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-devops-feature__title`,children:e.title}),(0,P.jsx)(`p`,{className:`semiont-devops-feature__description`,children:e.description}),(0,P.jsx)(`p`,{className:`semiont-devops-feature__available`,children:e.available})]})]})},e.title))})]}),(0,P.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-content`,children:[(0,P.jsx)(`div`,{className:`semiont-admin__info-box-icon`,children:(0,P.jsx)(c$,{className:`semiont-icon semiont-icon--info`})}),(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-text`,children:[(0,P.jsx)(`h3`,{className:`semiont-admin__info-box-title`,children:i.cliTitle}),(0,P.jsxs)(`div`,{className:`semiont-admin__info-box-description`,children:[(0,P.jsx)(`p`,{children:i.cliDescription}),(0,P.jsx)(`code`,{className:`semiont-admin__info-box-code`,children:`semiont --help`})]})]})]})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(o,{activePanel:r,theme:t,showLineNumbers:n}),(0,P.jsx)(s,{context:`simple`,activePanel:r})]})]})}function V$({onExport:e,isExporting:t,translations:n}){return(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:n.title}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:n.description}),(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:e,disabled:t,children:t?n.exporting:n.exportButton})]})}function H$({onFileSelected:e,onImport:t,onCancel:n,selectedFile:r,preview:i,isImporting:a,translations:o}){let s=(0,m.useRef)(null),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useCallback)(e=>{e.preventDefault(),l(!0)},[]),p=(0,m.useCallback)(()=>{l(!1)},[]),h=(0,m.useCallback)(t=>{t.preventDefault(),l(!1),d(!1);let n=t.dataTransfer.files[0];n&&e(n)},[e]),g=(0,m.useCallback)(t=>{d(!1);let n=t.target.files?.[0];n&&e(n)},[e]);return(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsx)(`h2`,{className:`semiont-admin__section-title`,children:o.title}),(0,P.jsx)(`p`,{className:`semiont-admin__section-description`,children:o.description}),(0,P.jsxs)(`div`,{className:`semiont-exchange__dropzone${c?` semiont-exchange__dropzone--active`:``}`,onDragOver:f,onDragLeave:p,onDrop:h,onClick:()=>s.current?.click(),children:[(0,P.jsx)(`p`,{className:`semiont-exchange__dropzone-text`,children:c?o.dropzoneActive:o.dropzoneLabel}),r&&(0,P.jsxs)(`p`,{className:`semiont-exchange__file-info`,children:[r.name,` (`,(r.size/1024).toFixed(1),` KB)`]})]}),(0,P.jsx)(`input`,{ref:s,type:`file`,accept:`.tar.gz,.jsonl,.gz`,onChange:g,style:{display:`none`}}),i&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview`,children:[(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.detectedFormat}),(0,P.jsxs)(`span`,{className:`semiont-exchange__preview-value`,children:[i.format,` v`,i.version]})]}),i.sourceUrl&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:`Source`}),(0,P.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:i.sourceUrl})]}),Object.keys(i.stats).length>0&&(0,P.jsxs)(`div`,{className:`semiont-exchange__preview-row`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__preview-label`,children:o.statsPreview}),(0,P.jsx)(`span`,{className:`semiont-exchange__preview-value`,children:Object.entries(i.stats).map(([e,t])=>`${t} ${e}`).join(`, `)})]})]}),u&&(0,P.jsxs)(`div`,{className:`semiont-exchange__confirm`,children:[(0,P.jsx)(`p`,{className:`semiont-exchange__confirm-title`,children:o.importConfirmTitle}),(0,P.jsx)(`p`,{className:`semiont-exchange__confirm-message`,children:o.importConfirmMessage}),(0,P.jsxs)(`div`,{className:`semiont-exchange__confirm-actions`,children:[(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{d(!1),t()},children:o.confirmImport}),(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:()=>{d(!1)},children:o.cancelImport})]})]}),!u&&(0,P.jsxs)(`div`,{className:`semiont-exchange__actions`,children:[(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--primary`,onClick:()=>{d(!0)},disabled:!i||a,children:a?o.importing:o.importButton}),r&&(0,P.jsx)(`button`,{className:`semiont-exchange__button semiont-exchange__button--secondary`,onClick:n,disabled:a,children:o.cancelImport})]})]})}var U$={started:`phaseStarted`,"entity-types":`phaseEntityTypes`,resources:`phaseResources`,annotations:`phaseAnnotations`,complete:`phaseComplete`,error:`phaseError`};function W$({phase:e,message:t,result:n,translations:r}){let i=U$[e],a=i?r[i]:e,o=e===`complete`,s=e===`error`;return(0,P.jsxs)(`div`,{className:`semiont-exchange__progress`,children:[(0,P.jsx)(`div`,{className:`semiont-exchange__phase-label${s?` semiont-exchange__phase-label--error`:o?` semiont-exchange__phase-label--complete`:``}`,children:a}),t&&!o&&!s&&(0,P.jsx)(`p`,{className:`semiont-exchange__progress-message`,children:t}),o&&n&&(0,P.jsxs)(`div`,{className:`semiont-exchange__result`,children:[n.stats!=null&&typeof n.stats==`object`&&(0,P.jsx)(P.Fragment,{children:Object.entries(n.stats).map(([e,t])=>{let n=e===`streams`?r.streams:e===`events`?r.events:e===`blobs`?r.blobs:e;return(0,P.jsxs)(`div`,{className:`semiont-exchange__result-stat`,children:[(0,P.jsx)(`span`,{className:`semiont-exchange__result-value`,children:t}),(0,P.jsx)(`span`,{className:`semiont-exchange__result-label`,children:n})]},e)})}),n.hashChainValid!==void 0&&(0,P.jsx)(`div`,{className:`semiont-exchange__hash-badge${n.hashChainValid?` semiont-exchange__hash-badge--valid`:` semiont-exchange__hash-badge--invalid`}`,children:n.hashChainValid?r.hashChainValid:r.hashChainInvalid})]}),s&&t&&(0,P.jsx)(`p`,{className:`semiont-exchange__error-message`,children:t})]})}function G$({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,P.jsxs)(`div`,{className:`semiont-page${p&&I$.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,P.jsx)(V$,{onExport:e,isExporting:t,translations:m.export}),(0,P.jsx)(H$,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,P.jsx)(W$,{phase:c,message:l,result:u,translations:m.progress})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,P.jsx)(g,{context:`simple`,activePanel:p})]})]})}function K$({providers:e,allowedDomains:t,isLoading:n,theme:r,showLineNumbers:i,activePanel:a,translations:o,ToolbarPanels:s,Toolbar:c}){return(0,P.jsxs)(`div`,{className:`semiont-page${a&&I$.includes(a)?` semiont-page--panel-open`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-page__content`,children:(0,P.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:o.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:o.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,P.jsx)(O$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.oauthProviders}),(0,P.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.oauthProvidersDescription})]})]}),n?(0,P.jsx)(`div`,{className:`semiont-skeleton-group`,children:(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--bar`})}):e.length>0?(0,P.jsx)(`div`,{className:`semiont-provider-list`,children:e.map(e=>(0,P.jsxs)(`div`,{className:`semiont-provider-item`,children:[(0,P.jsxs)(`div`,{className:`semiont-provider-item__info`,children:[(0,P.jsx)(i$,{className:`semiont-provider-item__icon semiont-provider-item__icon--success`}),(0,P.jsx)(`span`,{className:`semiont-provider-item__name`,children:e.name}),e.clientId&&(0,P.jsxs)(`span`,{className:`semiont-provider-item__client-id`,children:[o.clientId,`: `,e.clientId]})]}),(0,P.jsx)(`span`,{className:`semiont-badge semiont-badge--success`,children:o.configured})]},e.name))}):(0,P.jsx)(`div`,{className:`semiont-empty-message`,children:o.noProvidersConfigured})]}),(0,P.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,P.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,P.jsx)(m$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`semiont-admin__card-title`,children:o.allowedDomains}),(0,P.jsx)(`p`,{className:`semiont-admin__card-description`,children:o.allowedDomainsDescription})]})]}),n?(0,P.jsxs)(`div`,{className:`semiont-skeleton-group`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip`}),(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip semiont-skeleton--chip-lg`})]}):t.length>0?(0,P.jsx)(`div`,{className:`semiont-domain-list`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`semiont-chip semiont-chip--primary`,children:[`@`,e]},e))}):(0,P.jsx)(`div`,{className:`semiont-empty-message`,children:o.noDomainsConfigured})]}),(0,P.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,P.jsxs)(`div`,{className:`semiont-info-box__content`,children:[(0,P.jsx)(g$,{className:`semiont-info-box__icon`}),(0,P.jsxs)(`div`,{className:`semiont-info-box__text`,children:[(0,P.jsx)(`p`,{className:`semiont-info-box__title`,children:o.configManagementTitle}),(0,P.jsx)(`p`,{className:`semiont-info-box__description`,children:o.configManagementDescription}),(0,P.jsxs)(`ul`,{className:`semiont-info-box__list`,children:[(0,P.jsx)(`li`,{children:o.configLocalDev}),(0,P.jsxs)(`li`,{children:[o.configCloudDeploy,` `,(0,P.jsx)(`code`,{className:`semiont-code-inline`,children:o.configCloudDeployCommand}),` `,o.configCloudDeployEnd]}),(0,P.jsx)(`li`,{children:o.configAWS})]})]})]})})]})}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(s,{activePanel:a,theme:r,showLineNumbers:i}),(0,P.jsx)(c,{context:`simple`,activePanel:a})]})]})}function q$({onExport:e,isExporting:t,onFileSelected:n,onImport:r,onCancelImport:i,selectedFile:a,preview:o,isImporting:s,importPhase:c,importMessage:l,importResult:u,theme:d,showLineNumbers:f,activePanel:p,translations:m,ToolbarPanels:h,Toolbar:g}){return(0,P.jsxs)(`div`,{className:`semiont-page${p&&I$.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:m.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:m.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-exchange__cards`,children:[(0,P.jsx)(V$,{onExport:e,isExporting:t,translations:m.export}),(0,P.jsx)(H$,{onFileSelected:n,onImport:r,onCancel:i,selectedFile:a,preview:o,isImporting:s,translations:m.import})]}),c&&(0,P.jsx)(W$,{phase:c,message:l,result:u,translations:m.progress})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:p,theme:d,showLineNumbers:f}),(0,P.jsx)(g,{context:`simple`,activePanel:p})]})]})}function J$({user:e,onUpdate:t,onDelete:n,translations:r}){let i={admin:`semiont-badge semiont-badge--danger`,user:`semiont-badge semiont-badge--default`},a={active:`semiont-badge semiont-badge--success`,inactive:`semiont-badge semiont-badge--default`},o=e.isAdmin?`admin`:`user`,s=e.isActive?`active`:`inactive`;return(0,P.jsxs)(`tr`,{className:`semiont-table__row`,children:[(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsxs)(`div`,{className:`semiont-user-info`,children:[(0,P.jsx)(P$,{className:`semiont-user-info__avatar`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`semiont-user-info__name`,children:e.name||r.noName}),(0,P.jsx)(`div`,{className:`semiont-user-info__email`,children:e.email})]})]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsxs)(`span`,{className:`semiont-table__text--secondary`,children:[`@`,e.domain]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsx)(`span`,{className:i[o],children:r[o]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell`,children:(0,P.jsx)(`span`,{className:a[s],children:r[s]})}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:e.lastLogin?new Date(e.lastLogin).toLocaleDateString():r.never}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:new Date(e.created).toLocaleDateString()}),(0,P.jsx)(`td`,{className:`semiont-table__cell semiont-table__cell--actions`,children:(0,P.jsxs)(`div`,{className:`semiont-table__actions`,children:[(0,P.jsx)(`button`,{onClick:()=>t(e.id,{isAdmin:!e.isAdmin}),className:`semiont-action-button semiont-action-button--info`,title:e.isAdmin?r.removeAdmin:r.makeAdmin,children:(0,P.jsx)(O$,{className:`semiont-action-button__icon`})}),(0,P.jsx)(`button`,{onClick:()=>t(e.id,{isActive:!e.isActive}),className:`semiont-action-button semiont-action-button--warning`,title:e.isActive?r.deactivateUser:r.activateUser,children:(0,P.jsx)(S$,{className:`semiont-action-button__icon`})}),(0,P.jsx)(`button`,{onClick:()=>n(e.id),className:`semiont-action-button semiont-action-button--danger`,title:r.deleteUser,children:(0,P.jsx)(M$,{className:`semiont-action-button__icon`})})]})})]})}function Y$({users:e,userStats:t,isLoadingUsers:n,isLoadingStats:r,onUpdateUser:i,onDeleteUser:a,onAddUser:o,onExportUsers:s,theme:c,showLineNumbers:l,activePanel:u,translations:d,ToolbarPanels:f,Toolbar:p,buttonStyles:h}){let[g,_]=(0,m.useState)(``),[v,y]=(0,m.useState)(`all`),[b,x]=(0,m.useState)(`all`),S=e.filter(e=>{let t=(e.name||``).toLowerCase().includes(g.toLowerCase())||e.email.toLowerCase().includes(g.toLowerCase()),n=e.isAdmin?`admin`:`user`,r=e.isActive?`active`:`inactive`;return t&&(v===`all`||n===v)&&(b===`all`||r===b)});return(0,P.jsxs)(`div`,{className:`semiont-page${u&&I$.includes(u)?` semiont-page--panel-open`:``}`,children:[(0,P.jsx)(`div`,{className:`semiont-page__content`,children:(0,P.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header-with-action`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:d.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:d.subtitle})]}),(0,P.jsxs)(`button`,{onClick:o,className:h.primary.base,children:[(0,P.jsx)(w$,{className:`semiont-button__icon`}),d.addUser]})]}),(0,P.jsx)(`div`,{className:`semiont-admin__stats-grid`,children:r?[,,,,].fill(0).map((e,t)=>(0,P.jsx)(`div`,{className:`semiont-stat-card semiont-stat-card--loading`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--icon`}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--text`}),(0,P.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--number`})]})]})},t)):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(P$,{className:`semiont-stat-card__icon semiont-stat-card__icon--primary`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.totalUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.totalUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(`div`,{className:`semiont-stat-card__status-indicator semiont-stat-card__status-indicator--active`,children:(0,P.jsx)(`div`,{className:`semiont-stat-card__status-dot`})})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.activeUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.activeUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(O$,{className:`semiont-stat-card__icon semiont-stat-card__icon--danger`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.administrators}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.adminUsers??0})]})]})}),(0,P.jsx)(`div`,{className:`semiont-stat-card`,children:(0,P.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,P.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,P.jsx)(f$,{className:`semiont-stat-card__icon semiont-stat-card__icon--warning`})}),(0,P.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,P.jsx)(`p`,{className:`semiont-stat-card__label`,children:d.recentUsers}),(0,P.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.recentSignups?.length??0})]})]})})]})}),(0,P.jsx)(`div`,{className:`semiont-admin__filters-card`,children:(0,P.jsxs)(`div`,{className:`semiont-admin__filters-grid`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`search`,className:`semiont-form__label`,children:d.searchUsers}),(0,P.jsxs)(`div`,{className:`semiont-search-input`,children:[(0,P.jsx)(`div`,{className:`semiont-search-input__icon`,children:(0,P.jsx)(b$,{className:`semiont-icon semiont-icon--small`})}),(0,P.jsx)(`input`,{type:`text`,id:`search`,className:`semiont-search-input__field`,placeholder:d.searchPlaceholder,value:g,onChange:e=>_(e.target.value)})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`role`,className:`semiont-form__label`,children:d.role}),(0,P.jsxs)(`select`,{id:`role`,className:`semiont-select`,value:v,onChange:e=>y(e.target.value),children:[(0,P.jsx)(`option`,{value:`all`,children:d.allRoles}),(0,P.jsx)(`option`,{value:`admin`,children:d.admin}),(0,P.jsx)(`option`,{value:`user`,children:d.user})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`status`,className:`semiont-form__label`,children:d.status}),(0,P.jsxs)(`select`,{id:`status`,className:`semiont-select`,value:b,onChange:e=>x(e.target.value),children:[(0,P.jsx)(`option`,{value:`all`,children:d.allStatus}),(0,P.jsx)(`option`,{value:`active`,children:d.active}),(0,P.jsx)(`option`,{value:`inactive`,children:d.inactive})]})]}),(0,P.jsx)(`div`,{className:`semiont-form__field semiont-form__field--align-end`,children:(0,P.jsx)(`button`,{onClick:s,className:`${h.secondary.base} semiont-button--full-width`,children:d.exportUsers})})]})}),(0,P.jsxs)(`div`,{className:`semiont-admin__table-card`,children:[(0,P.jsx)(`div`,{className:`semiont-table-container`,children:n?(0,P.jsxs)(`div`,{className:`semiont-loading-state`,children:[(0,P.jsx)(`div`,{className:`semiont-spinner`}),(0,P.jsx)(`p`,{className:`semiont-loading-state__text`,children:d.loadingUsers})]}):(0,P.jsxs)(`table`,{className:`semiont-table`,children:[(0,P.jsx)(`thead`,{className:`semiont-table__head`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.userColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.domainColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.roleColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.statusColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.lastLoginColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header`,children:d.joinedColumn}),(0,P.jsx)(`th`,{className:`semiont-table__header semiont-table__header--actions`,children:d.actionsColumn})]})}),(0,P.jsx)(`tbody`,{className:`semiont-table__body`,children:S.map(e=>(0,P.jsx)(J$,{user:e,onUpdate:i,onDelete:a,translations:d},e.id))})]})}),!n&&S.length===0&&(0,P.jsxs)(`div`,{className:`semiont-empty-state`,children:[(0,P.jsx)(P$,{className:`semiont-empty-state__icon`}),(0,P.jsx)(`h3`,{className:`semiont-empty-state__title`,children:d.noUsersFound}),(0,P.jsx)(`p`,{className:`semiont-empty-state__description`,children:d.noUsersFoundDescription})]})]})]})}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(f,{activePanel:u,theme:c,showLineNumbers:l}),(0,P.jsx)(p,{context:`simple`,activePanel:u})]})]})}function X$(){return(0,P.jsxs)(`svg`,{className:`semiont-icon semiont-icon--small semiont-icon--inline`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{fill:`currentColor`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,P.jsx)(`path`,{fill:`currentColor`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]})}function Z$({onSignUp:e,Link:t,translations:n}){let[r,i]=(0,m.useState)(!1);return(0,P.jsx)(`main`,{className:`semiont-auth__main`,role:`main`,children:(0,P.jsx)(`div`,{className:`semiont-auth__container`,children:(0,P.jsxs)(`div`,{className:`semiont-auth__content`,children:[(0,P.jsxs)(`section`,{"aria-labelledby":`signup-heading`,className:`semiont-auth__branding`,children:[(0,P.jsx)(`h1`,{id:`signup-heading`,className:`sr-only`,children:n.pageTitle}),(0,P.jsx)(qQ,{t:e=>n[e]||e,size:`xl`,animated:!0,className:`semiont-auth__logo`}),(0,P.jsx)(`p`,{className:`semiont-auth__welcome`,children:n.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-auth__subtitle`,children:n.signUpPrompt})]}),(0,P.jsxs)(`div`,{className:`semiont-auth__forms`,children:[(0,P.jsxs)(`button`,{onClick:async()=>{i(!0);try{await e()}catch(e){console.error(`Failed to initiate Google sign-up:`,e),i(!1)}},disabled:r,className:`${Lh.primary.base} semiont-button--full-width`,children:[r?(0,P.jsx)(`div`,{className:`semiont-auth__spinner`}):(0,P.jsx)(X$,{}),r?n.creatingAccount:n.signUpWithGoogle]}),(0,P.jsxs)(`div`,{className:`semiont-auth__info`,children:[n.approvedDomainsInfo,(0,P.jsx)(`br`,{}),n.termsAgreement]})]}),(0,P.jsxs)(`div`,{className:`semiont-auth__links`,children:[(0,P.jsx)(t,{href:`/`,className:Lh.secondary.base,children:n.backToHome}),(0,P.jsx)(t,{href:`/auth/signin`,className:Lh.primary.base,children:n.alreadyHaveAccount})]})]})})})}function Q$(e,t){switch(e){case`Configuration`:return t.errorConfiguration;case`AccessDenied`:return t.errorAccessDenied;case`Verification`:return t.errorVerification;default:return t.errorGeneric}}function $$({errorType:e,Link:t,translations:n}){let r=Q$(e,n);return(0,P.jsx)(`div`,{className:`semiont-auth-error-display`,children:(0,P.jsxs)(`div`,{className:`semiont-auth-error-display__container`,children:[(0,P.jsx)(`div`,{children:(0,P.jsx)(`h2`,{className:`semiont-auth-error-display__title`,children:n.pageTitle})}),(0,P.jsx)(`div`,{className:`semiont-auth-error-display__error-box`,children:(0,P.jsx)(`div`,{className:`semiont-auth-error-display__error-message`,children:r})}),(0,P.jsx)(`div`,{className:`semiont-auth-error-display__actions`,children:(0,P.jsx)(t,{href:`/auth/signin`,className:`semiont-auth-error-display__link`,children:n.tryAgain})})]})})}function e1({userName:e,status:t,isProcessing:n,onAccept:r,onDecline:i,translations:a,PageLayout:o,Link:s}){return t===`loading`?(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__loading`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__loading-content`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__spinner`}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__loading-text`,children:a.loading})]})})}):t===`accepted`?(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__accepted`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__accepted-content`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__accepted-icon`,children:(0,P.jsx)(`svg`,{className:`semiont-welcome-page__accepted-checkmark`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})})}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`semiont-welcome-page__accepted-title`,children:a.welcomeTitle}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__accepted-subtitle`,children:a.thanksForAccepting})]})]})})}):(0,P.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,P.jsx)(`div`,{className:`semiont-welcome-page__form-wrapper`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__form`,children:[(0,P.jsxs)(`div`,{className:`semiont-welcome-page__form-header`,children:[(0,P.jsx)(`div`,{className:`semiont-welcome-page__form-icon`,children:(0,P.jsx)(`svg`,{className:`semiont-welcome-page__form-icon-svg`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,P.jsx)(`h1`,{className:`semiont-welcome-page__form-title`,children:a.welcomeUser.replace(`{firstName}`,e||``)}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__form-subtitle`,children:a.reviewTermsPrompt})]}),(0,P.jsx)(`div`,{className:`semiont-welcome-page__terms-content`,children:(0,P.jsxs)(`div`,{className:`semiont-welcome-page__prose`,children:[(0,P.jsx)(`h3`,{children:a.termsSummaryTitle}),(0,P.jsx)(`p`,{children:a.termsSummaryIntro}),(0,P.jsx)(`h4`,{children:a.acceptableUseTitle}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.acceptableUseResponsible}),(0,P.jsx)(`li`,{children:a.acceptableUseRespect}),(0,P.jsx)(`li`,{children:a.acceptableUseConduct})]}),(0,P.jsx)(`h4`,{children:a.prohibitedContentTitle}),(0,P.jsx)(`p`,{children:a.prohibitedContentIntro}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.prohibitedIllegal}),(0,P.jsx)(`li`,{children:a.prohibitedAdult}),(0,P.jsx)(`li`,{children:a.prohibitedHate}),(0,P.jsx)(`li`,{children:a.prohibitedViolence}),(0,P.jsx)(`li`,{children:a.prohibitedMisinformation}),(0,P.jsx)(`li`,{children:a.prohibitedPrivacy}),(0,P.jsx)(`li`,{children:a.prohibitedCopyright}),(0,P.jsx)(`li`,{children:a.prohibitedMalware}),(0,P.jsx)(`li`,{children:a.prohibitedSpam})]}),(0,P.jsx)(`h4`,{children:a.conductTitle}),(0,P.jsxs)(`p`,{children:[a.conductDescription,` `,(0,P.jsx)(`a`,{href:`https://ai-alliance.cdn.prismic.io/ai-alliance/Zl-MG5m069VX1dgH_AIAllianceCodeofConduct.pdf`,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-link`,children:a.conductLink}),a.conductPromotion]}),(0,P.jsx)(`h4`,{children:a.responsibilitiesTitle}),(0,P.jsxs)(`ul`,{children:[(0,P.jsx)(`li`,{children:a.responsibilitiesSecure}),(0,P.jsx)(`li`,{children:a.responsibilitiesReport}),(0,P.jsx)(`li`,{children:a.responsibilitiesAccurate}),(0,P.jsx)(`li`,{children:a.responsibilitiesComply})]}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__warning`,children:a.violationsWarning})]})}),(0,P.jsxs)(`div`,{className:`semiont-welcome-page__actions`,children:[(0,P.jsxs)(`p`,{className:`semiont-welcome-page__legal-links`,children:[a.readFullTerms,` `,(0,P.jsx)(s,{href:`/terms`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.termsOfService}),` `,a.and,` `,(0,P.jsx)(s,{href:`/privacy`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.privacyPolicy})]}),(0,P.jsxs)(`div`,{className:`semiont-welcome-page__buttons`,children:[(0,P.jsx)(`button`,{onClick:i,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--secondary`,children:a.declineAndSignOut}),(0,P.jsx)(`button`,{onClick:r,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--primary`,children:n?a.processing:a.acceptAndContinue})]}),(0,P.jsx)(`p`,{className:`semiont-welcome-page__legal-notice`,children:a.legallyBound})]})]})})})}function t1({entityTypes:e,error:t,newTag:n,onNewTagChange:r,onAddTag:i,isAddingTag:a,theme:o,showLineNumbers:s,activePanel:c,translations:l,ToolbarPanels:u,Toolbar:d}){return(0,P.jsxs)(`div`,{className:`semiont-page${c&&I$.includes(c)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:l.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:l.pageDescription})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-entity-tags__header`,children:[(0,P.jsx)(`div`,{className:`semiont-entity-tags__icon-box`,children:(0,P.jsx)(A$,{className:`semiont-entity-tags__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-entity-tags__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-entity-tags__title`,children:l.sectionTitle}),(0,P.jsx)(`p`,{className:`semiont-entity-tags__description`,children:l.sectionDescription})]})]}),(0,P.jsx)(`div`,{className:`semiont-entity-tags__tags-section`,children:(0,P.jsx)(`div`,{className:`semiont-tags`,children:e.map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--info semiont-tag--rounded-md`,children:e},e))})}),(0,P.jsxs)(`div`,{className:`semiont-entity-tags__input-group`,children:[(0,P.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},placeholder:l.inputPlaceholder,className:`semiont-entity-tags__input`,disabled:a}),(0,P.jsx)(`button`,{onClick:i,disabled:a||!n.trim(),className:`semiont-button semiont-button--primary`,children:a?l.adding:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w$,{className:`semiont-icon semiont-icon--small semiont-icon--inline`}),l.addTag]})})]}),t&&(0,P.jsxs)(`div`,{className:`semiont-entity-tags__error`,children:[(0,P.jsx)(u$,{className:`semiont-entity-tags__error-icon`}),t]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(u,{activePanel:c,theme:o,showLineNumbers:s}),(0,P.jsx)(d,{context:`simple`,activePanel:c})]})]})}function n1({isLoading:e,theme:t,showLineNumbers:n,activePanel:r,translations:i,ToolbarPanels:a,Toolbar:o}){return e?(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:i.loading})}):(0,P.jsxs)(`div`,{className:`semiont-page${r&&I$.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:i.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.pageDescription})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-recent-docs__header`,children:[(0,P.jsx)(`div`,{className:`semiont-recent-docs__icon-box`,children:(0,P.jsx)(o$,{className:`semiont-recent-docs__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-recent-docs__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-recent-docs__title`,children:i.sectionTitle}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__description`,children:i.sectionDescription})]})]}),(0,P.jsxs)(`div`,{className:`semiont-recent-docs__empty-state`,children:[(0,P.jsx)(`svg`,{className:`semiont-recent-docs__empty-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__empty-message`,children:i.noDocuments}),(0,P.jsx)(`p`,{className:`semiont-recent-docs__empty-hint`,children:i.activityWillAppear})]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(a,{activePanel:r,theme:t,showLineNumbers:n}),(0,P.jsx)(o,{context:`simple`,activePanel:r})]})]})}var r1={legal:E$,scientific:n$,general:v$},i1={legal:`semiont-schema-domain--legal`,scientific:`semiont-schema-domain--scientific`,general:`semiont-schema-domain--general`};function a1({schemas:e,isLoading:t,theme:n,showLineNumbers:r,activePanel:i,translations:a,ToolbarPanels:o,Toolbar:s}){return t?(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:a.loading})}):(0,P.jsxs)(`div`,{className:`semiont-page${i&&I$.includes(i)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:a.pageTitle}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:a.pageDescription})]}),(0,P.jsx)(`div`,{className:`semiont-card-grid semiont-card-grid--two-columns`,children:e.map(e=>{let t=r1[e.domain]||v$,n=i1[e.domain]||i1.general;return(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-schema__header`,children:[(0,P.jsx)(`div`,{className:`semiont-schema__icon-wrapper ${n}`,children:t&&(0,P.jsx)(t,{className:`semiont-schema__icon`})}),(0,P.jsxs)(`div`,{className:`semiont-schema__content`,children:[(0,P.jsx)(`h3`,{className:`semiont-schema__title`,children:e.name}),(0,P.jsx)(`p`,{className:`semiont-schema__description`,children:e.description}),(0,P.jsx)(`span`,{className:`semiont-schema__badge ${n}`,children:e.domain})]})]}),(0,P.jsxs)(`div`,{className:`semiont-schema__categories`,children:[(0,P.jsx)(`h4`,{className:`semiont-schema__categories-title`,children:a.categories}),e.tags.map(e=>(0,P.jsxs)(`div`,{className:`semiont-schema__category`,children:[(0,P.jsx)(`div`,{className:`semiont-schema__category-name`,children:e.name}),(0,P.jsx)(`div`,{className:`semiont-schema__category-description`,children:e.description}),(0,P.jsxs)(`div`,{className:`semiont-schema__examples`,children:[e.examples.slice(0,2).map((e,t)=>(0,P.jsx)(`span`,{className:`semiont-schema__example`,children:e},t)),e.examples.length>2&&(0,P.jsxs)(`span`,{className:`semiont-schema__example-more`,children:[`+`,e.examples.length-2,` more`]})]})]},e.name))]})]},e.id)})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(o,{activePanel:i,theme:n,showLineNumbers:r}),(0,P.jsx)(s,{context:`simple`,activePanel:i})]})]})}function o1(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function s1({progress:e,label:t=`Upload`}){if(!e)return null;if(e.phase===`started`)return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:(0,P.jsxs)(`span`,{children:[t,`: starting…`]})}),(0,P.jsx)(`div`,{className:`semiont-progress semiont-progress--indeterminate`,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill`})})]});if(e.phase===`progress`){let n=e.totalBytes<=0,r=n?0:Math.min(100,Math.round(e.bytesUploaded/e.totalBytes*100));return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:n?(0,P.jsxs)(`span`,{children:[t,`: `,o1(e.bytesUploaded),`…`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[t,`: `,r,`%`]}),(0,P.jsxs)(`span`,{children:[o1(e.bytesUploaded),` / `,o1(e.totalBytes)]})]})}),(0,P.jsx)(`div`,{className:`semiont-progress${n?` semiont-progress--indeterminate`:``}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":n?void 0:100,"aria-valuenow":n?void 0:r,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill`,style:n?void 0:{width:`${r}%`}})})]})}return(0,P.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`div`,{className:`semiont-progress__label`,children:(0,P.jsxs)(`span`,{children:[t,`: uploaded`]})}),(0,P.jsx)(`div`,{className:`semiont-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":100,children:(0,P.jsx)(`div`,{className:`semiont-progress__fill semiont-progress__fill--success`,style:{width:`100%`}})})]})}function c1({mode:e,cloneData:t,referenceData:n,gatheredContext:r,availableEntityTypes:i,initialLocale:a,theme:o,showLineNumbers:s,hoverDelayMs:c,activePanel:l,onSaveResource:u,onCancel:d,uploadProgress:f=null,translations:p,ToolbarPanels:h,Toolbar:g}){let{announceFormSubmitting:_,announceFormSuccess:v,announceFormError:y}=DE(),[b,x]=(0,m.useState)(``),[S,C]=(0,m.useState)(``),[w,T]=(0,m.useState)([]),[E,D]=(0,m.useState)(!1),[O,k]=(0,m.useState)(`write`),[A,ee]=(0,m.useState)(null),[te,j]=(0,m.useState)(`text/markdown`),[ne,re]=(0,m.useState)(null),[ie,ae]=(0,m.useState)(`text/markdown`),[M,oe]=(0,m.useState)(a),[se,ce]=(0,m.useState)(``),[le,ue]=(0,m.useState)(``),[N,de]=(0,m.useState)(!0);(0,m.useEffect)(()=>{e===`clone`&&t?(x(t.sourceResource.name),C(t.sourceContent)):e===`reference`&&n&&(x(n.name),n.entityTypes.length>0&&T(n.entityTypes))},[e,t,n]);let fe=e=>{let t=e.target.files?.[0];if(t)if(ee(t),j(t.type),k(`upload`),b||x(t.name.replace(/\.[^/.]+$/,``)),Fo(t.type)||Lo(t.type))re(URL.createObjectURL(t));else{let e=new FileReader;e.onload=e=>{let t=e.target?.result;C(t)},e.readAsText(t)}};(0,m.useEffect)(()=>()=>{ne&&URL.revokeObjectURL(ne)},[ne]);let pe=async t=>{if(t.preventDefault(),b.trim()){D(!0),_();try{let t={mode:e,name:b,storageUri:`file://${le}`,content:S,format:A?te:ie,entityTypes:w,language:M};A&&(t.file=A),se&&(t.charset=se),e===`clone`&&(t.archiveOriginal=N),n?.annotationUri&&(t.annotationUri=n.annotationUri),n?.sourceDocumentId&&(t.sourceDocumentId=n.sourceDocumentId),await u(t),v(e===`clone`?`Resource cloned successfully`:e===`reference`?`Reference completed successfully`:`Resource created successfully`)}catch(e){throw y(`Failed to save resource. Please try again.`),e}finally{D(!1)}}},me=e===`clone`,he=e===`reference`;return(0,P.jsxs)(`div`,{className:`semiont-page${l&&I$.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content semiont-page__compose`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:me?p.titleEditClone:he?p.titleCompleteReference:p.title}),(me||he)&&(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:me?p.subtitleClone:p.subtitleReference}),he&&(0,P.jsx)(`div`,{className:`semiont-page__reference-notice`,children:(0,P.jsx)(`p`,{className:`semiont-page__reference-notice-text`,children:p.linkedNoticePrefix})})]}),r&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,style:{marginBottom:`1.5rem`,padding:`1rem`,backgroundColor:`var(--semiont-bg-secondary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`},children:[(0,P.jsx)(`h3`,{className:`semiont-form__label`,style:{marginBottom:`0.75rem`},children:`Gathered Context`}),r.sourceContext&&(0,P.jsx)(`div`,{style:{padding:`0.75rem`,backgroundColor:`var(--semiont-bg-primary)`,borderRadius:`var(--semiont-radius-md)`,border:`1px solid var(--semiont-border-primary)`,maxHeight:`150px`,overflowY:`auto`,marginBottom:`0.5rem`},children:(0,P.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,fontFamily:`monospace`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[r.sourceContext.before&&(0,P.jsx)(`span`,{children:r.sourceContext.before}),(0,P.jsx)(`span`,{style:{backgroundColor:`var(--semiont-color-primary-100)`,padding:`0 0.25rem`,fontWeight:600,color:`var(--semiont-color-primary-900)`},children:r.sourceContext.selected}),r.sourceContext.after&&(0,P.jsx)(`span`,{children:r.sourceContext.after})]})}),r.graphContext&&r.graphContext.connections&&r.graphContext.connections.length>0&&(0,P.jsxs)(`div`,{style:{padding:`0.5rem 0`,fontSize:`var(--semiont-text-sm)`,color:`var(--semiont-text-secondary)`},children:[(0,P.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,fontWeight:500,marginRight:`0.5rem`},children:`Connections:`}),r.graphContext.connections.map(e=>(0,P.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.5rem`,marginRight:`0.25rem`},children:e.resourceName},e.resourceId))]})]}),(0,P.jsx)(`div`,{className:`semiont-form`,children:(0,P.jsxs)(`form`,{onSubmit:pe,className:`semiont-form__fields semiont-compose-grid`,children:[(0,P.jsxs)(`div`,{className:`semiont-compose-grid__meta`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`docName`,className:`semiont-form__label`,children:p.resourceName}),(0,P.jsx)(`input`,{id:`docName`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:p.resourceNamePlaceholder,className:`semiont-input`,required:!0,disabled:E})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,P.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,P.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,P.jsx)(`input`,{id:`storagePath`,type:`text`,value:le,onChange:e=>ue(e.target.value),placeholder:`docs/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:E})]})]}),(!he||w.length===0)&&(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,P.jsx)(`div`,{className:`semiont-form__label`,children:p.entityTypes}),(0,P.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,"aria-describedby":`entity-types-description`,children:i.map(e=>{let t=w.includes(e);return(0,P.jsx)(`button`,{type:`button`,onClick:()=>{T(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`semiont-form__entity-type-button`,"data-selected":t,disabled:E,"aria-pressed":t,"aria-label":`${e} entity type, ${t?`selected`:`not selected`}`,children:e},e)})}),w.length>0&&(0,P.jsxs)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:[w.length,` entity type`,w.length===1?``:`s`,` selected: `,w.join(`, `)]})]}),he&&w.length>0&&(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types-display`,role:`region`,"aria-labelledby":`selected-entity-types-label`,children:[(0,P.jsx)(`h3`,{id:`selected-entity-types-label`,className:`semiont-form__label`,children:p.entityTypes}),(0,P.jsx)(`div`,{className:`semiont-form__entity-type-tags`,role:`list`,children:w.map(e=>(0,P.jsx)(`span`,{role:`listitem`,className:`semiont-form__entity-type-tag`,"aria-label":`Entity type: ${e}`,children:e},e))}),(0,P.jsx)(`p`,{className:`semiont-form__helper-text`,id:`reference-entity-types-description`,children:`These entity types were selected when creating the reference`})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:p.language}),(0,P.jsx)(`select`,{id:`language-select`,value:M,onChange:e=>oe(e.target.value),disabled:E,className:`semiont-select`,children:Co.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]})]}),(0,P.jsxs)(`div`,{className:`semiont-compose-grid__content`,children:[!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{className:`semiont-form__label`,children:p.contentSource}),(0,P.jsxs)(`div`,{className:`semiont-form__content-source-toggle`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>k(`upload`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`upload`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,P.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`📎`}),(0,P.jsx)(`span`,{className:`semiont-form__content-source-label`,children:p.uploadFile})]}),(0,P.jsx)(`div`,{className:`semiont-form__content-source-description`,children:p.uploadFileDescription})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>k(`write`),disabled:E,className:`semiont-form__content-source-button`,"data-active":O===`write`,children:[(0,P.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,P.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`✍️`}),(0,P.jsx)(`span`,{className:`semiont-form__content-source-label`,children:p.writeContent})]}),(0,P.jsx)(`div`,{className:`semiont-form__content-source-description`,children:p.writeContentDescription})]})]})]}),!me&&!he&&O===`upload`&&(0,P.jsxs)(`div`,{className:`semiont-form__upload-section`,children:[(0,P.jsx)(`div`,{children:(0,P.jsxs)(`div`,{className:`semiont-form__upload-container`,children:[(0,P.jsx)(`label`,{className:`semiont-form__upload-dropzone`,children:(0,P.jsxs)(`div`,{className:`semiont-form__upload-area`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`text/plain,text/markdown,image/png,image/jpeg,application/pdf`,onChange:fe,className:`semiont-form__upload-input`,disabled:E}),(0,P.jsx)(`p`,{className:`semiont-form__upload-text`,children:A?A.name:p.dropFileOrClick}),(0,P.jsx)(`p`,{className:`semiont-form__upload-hint`,children:p.supportedFormats})]})}),A&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>{ee(null),re(null),j(`text/markdown`)},className:`semiont-button semiont-button--danger semiont-button--small`,disabled:E,children:`Clear`})]})}),A&&(0,P.jsxs)(`div`,{className:`semiont-form__media-type`,children:[(0,P.jsxs)(`span`,{className:`semiont-form__media-type-label`,children:[p.mediaType,`:`]}),(0,P.jsx)(`code`,{className:`semiont-form__media-type-value`,children:te}),(0,P.jsx)(`span`,{className:`semiont-form__media-type-lock`,title:p.autoDetected,children:`🔒`})]}),A&&ne&&Fo(te)&&(0,P.jsxs)(`div`,{className:`semiont-form__image-preview`,children:[(0,P.jsx)(`p`,{className:`semiont-form__image-preview-label`,children:`Preview:`}),(0,P.jsx)(`div`,{className:`semiont-form__image-preview-container`,children:(0,P.jsx)(`img`,{src:ne,alt:`Upload preview`,className:`semiont-form__image-preview-img`})})]})]}),(me||he||O===`write`)&&(0,P.jsxs)(`div`,{className:`semiont-form__write-section`,children:[!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`format-select`,className:`semiont-form__label`,children:p.format}),(0,P.jsxs)(`select`,{id:`format-select`,value:ie,onChange:e=>ae(e.target.value),disabled:E,className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:`text/markdown`,children:`Markdown (text/markdown)`}),(0,P.jsx)(`option`,{value:`text/plain`,children:`Plain Text (text/plain)`}),(0,P.jsx)(`option`,{value:`text/html`,children:`HTML (text/html)`})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,P.jsx)(`label`,{className:`semiont-form__label`,children:me?p.resourceContent:p.content}),(0,P.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:M,children:(0,P.jsx)(WN,{content:S,editable:!E,sourceView:!0,showLineNumbers:s,hoverDelayMs:c,onChange:e=>C(e)})})]}),!me&&!he&&(0,P.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,P.jsx)(`label`,{htmlFor:`charset-select`,className:`semiont-form__label`,children:p.encoding}),(0,P.jsxs)(`select`,{id:`charset-select`,value:se,onChange:e=>ce(e.target.value),disabled:E,className:`semiont-select`,children:[(0,P.jsx)(`option`,{value:``,children:`UTF-8 (default)`}),(0,P.jsx)(`option`,{value:`iso-8859-1`,children:`ISO-8859-1 (Latin-1)`}),(0,P.jsx)(`option`,{value:`windows-1252`,children:`Windows-1252`}),(0,P.jsx)(`option`,{value:`ascii`,children:`ASCII`}),(0,P.jsx)(`option`,{value:`utf-16le`,children:`UTF-16LE`})]})]})]}),me&&(0,P.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,P.jsx)(`input`,{id:`archiveOriginal`,type:`checkbox`,checked:N,onChange:e=>de(e.target.checked),className:`semiont-checkbox`,disabled:E}),(0,P.jsx)(`label`,{htmlFor:`archiveOriginal`,className:`semiont-form__checkbox-label`,children:p.archiveOriginal})]})]}),(0,P.jsxs)(`div`,{className:`semiont-form__actions`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:d,disabled:E||f!==null,className:Lh.tertiary.base,children:p.cancel}),(0,P.jsx)(`button`,{type:`submit`,disabled:E||f!==null||!b.trim(),className:Lh.primary.base,children:E?me?p.saving:he?p.creatingAndLinking:p.creating:me?p.saveClonedResource:he?p.createAndLinkResource:p.createResource})]}),(0,P.jsx)(s1,{progress:f})]})})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(h,{activePanel:l,theme:o,showLineNumbers:s}),(0,P.jsx)(g,{context:`simple`,activePanel:l})]})]})}var l1=m.memo(({resource:e,onOpen:t,tabIndex:n=0,archivedLabel:r,createdLabel:i})=>(0,P.jsxs)(`div`,{onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))},role:`button`,tabIndex:n,"aria-label":`Open resource: ${e.name}`,className:`semiont-resource-card`,children:[(0,P.jsxs)(`div`,{className:`semiont-resource-card__header`,children:[(0,P.jsx)(`h4`,{className:`semiont-resource-card__title`,children:e.name}),e.archived&&(0,P.jsx)(`span`,{className:`semiont-resource-card__badge`,"data-type":`archived`,children:r})]}),(0,P.jsxs)(`div`,{className:`semiont-resource-card__metadata`,children:[(0,P.jsxs)(`span`,{className:`semiont-resource-card__date`,children:[i,` `,e.dateCreated?new Date(e.dateCreated).toLocaleDateString():`N/A`]}),e.entityTypes&&e.entityTypes.length>0&&(0,P.jsxs)(`div`,{className:`semiont-tags`,children:[e.entityTypes.slice(0,2).map(e=>(0,P.jsx)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:e},e)),e.entityTypes.length>2&&(0,P.jsxs)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:[`+`,e.entityTypes.length-2]})]})]})]}));l1.displayName=`ResourceCard`;function u1({recentDocuments:e,searchDocuments:t,entityTypes:n,isLoadingRecent:r,isSearching:i,searchQuery:a,onSearchQueryChange:o,theme:s,showLineNumbers:c,activePanel:l,onNavigateToResource:u,onNavigateToCompose:d,translations:f,ToolbarPanels:p}){let[h,g]=(0,m.useState)(``),_=a.trim()!==``,v=_?t:e,y=h?v.filter(e=>e.entityTypes&&e.entityTypes.includes(h)):v,b=mE(n.length+1,{orientation:`horizontal`}),x=mE(y.length,{orientation:`grid`,cols:2}),S=(0,m.useRef)(u);S.current=u;let C=(0,m.useCallback)(e=>{g(e)},[]),w=(0,m.useCallback)(e=>{let t=po(e);t&&S.current(t)},[]);if(r)return(0,P.jsx)(`div`,{className:`semiont-page__loading`,children:(0,P.jsx)(`p`,{className:`semiont-page__loading-text`,children:f.loadingKnowledgeBase})});let T=_&&t.length===0&&!i;return(0,P.jsxs)(`div`,{className:`semiont-page${l&&I$.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,P.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,P.jsx)(`h1`,{className:`semiont-page__title`,children:f.title}),(0,P.jsx)(`p`,{className:`semiont-page__subtitle`,children:f.subtitle})]}),(0,P.jsxs)(`div`,{className:`semiont-card`,children:[(0,P.jsx)(`div`,{className:`semiont-card__search-form`,children:(0,P.jsxs)(`div`,{className:`semiont-card__search-wrapper`,children:[(0,P.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:f.searchPlaceholder,className:`semiont-card__search-input`,"aria-label":f.searchPlaceholder}),i&&(0,P.jsx)(`span`,{className:`semiont-card__search-status`,"aria-live":`polite`,children:f.searching})]})}),n.length>0&&(0,P.jsxs)(`div`,{className:`semiont-card__filters`,children:[(0,P.jsx)(`h3`,{className:`semiont-card__filters-label`,children:f.filterByEntityType}),(0,P.jsxs)(`div`,{ref:b.containerRef,onKeyDown:b.handleKeyDown,className:`semiont-card__filter-buttons`,role:`group`,"aria-label":`Entity type filters`,children:[(0,P.jsx)(`button`,{onClick:()=>C(``),tabIndex:0,"aria-pressed":h===``,className:`semiont-card__filter-button`,"data-active":h===``,children:f.all}),n.map(e=>(0,P.jsx)(`button`,{onClick:()=>C(e),tabIndex:-1,"aria-pressed":h===e,className:`semiont-card__filter-button`,"data-active":h===e,children:e},e))]})]}),(0,P.jsxs)(`div`,{className:`semiont-card__documents`,children:[(0,P.jsx)(`h3`,{className:`semiont-card__documents-label`,children:_&&t.length>0?f.searchResults(t.length):h?f.documentsTaggedWith(h):f.recentResources}),T&&(0,P.jsx)(`div`,{className:`semiont-card__warning`,children:(0,P.jsx)(`p`,{className:`semiont-card__warning-text`,children:f.noResultsFound(a)})}),y.length>0?(0,P.jsx)(`div`,{ref:x.containerRef,onKeyDown:x.handleKeyDown,className:`semiont-card-grid`,role:`group`,"aria-label":`Document grid`,children:y.map((e,t)=>(0,P.jsx)(l1,{resource:e,onOpen:w,tabIndex:t===0?0:-1,archivedLabel:f.archived,createdLabel:f.created},po(e)))}):(0,P.jsxs)(`div`,{className:`semiont-card__empty`,children:[(0,P.jsx)(`p`,{className:`semiont-card__empty-text`,children:f.noResourcesAvailable}),!_&&(0,P.jsx)(`button`,{onClick:d,className:`semiont-card__empty-button`,children:f.composeFirstResource})]})]})]})]}),(0,P.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,P.jsx)(p,{activePanel:l,theme:s,showLineNumbers:c}),(0,P.jsx)(ZN,{context:`simple`,activePanel:l})]})]})}function d1(e){let t=K(R().activeSession$)?.client,[n,r]=(0,m.useState)(void 0),[i,a]=(0,m.useState)(!0);return(0,m.useEffect)(()=>{if(!t||!e){a(!1);return}let n=!1;a(!0),t.auth.mediaToken(e).then(({token:e})=>{n||(r(e),a(!1))}).catch(()=>{n||a(!1)});let i=setInterval(()=>{t.auth.mediaToken(e).then(({token:e})=>{n||r(e)}).catch(()=>{})},240*1e3);return()=>{n=!0,clearInterval(i)}},[t,e]),{token:n,loading:i}}var f1=u(Qm(),1),p1={open:!1,annotationId:null,resourceId:null,defaultTitle:``,entityTypes:[]};function m1(e,t,n,r,i){let a=zu(),o=Vu(e),s=qu(e,t),c=Uu(e,t),l=Wu(e,t),u=Gu(e,t,n);a.add(o),a.add(r),a.add(s),a.add(c),a.add(l),a.add(u);let d=e.browse.annotations(t).pipe((0,f1.map)(e=>e??[])),f=d.pipe((0,f1.map)(e=>{let t={highlights:[],comments:[],assessments:[],references:[],tags:[]};for(let n of e)no(n)?t.highlights.push(n):ao(n)?t.comments.push(n):io(n)?t.assessments.push(n):ro(n)?t.references.push(n):oo(n)&&t.tags.push(n);return t})),p=e.browse.entityTypes().pipe((0,f1.map)(e=>e??[])),m=e.browse.events(t).pipe((0,f1.map)(e=>e??[])),h=e.browse.referencedBy(t).pipe((0,f1.map)(e=>e??[])),g=new f1.BehaviorSubject(``),_=new f1.BehaviorSubject(!1),v=new f1.BehaviorSubject(null),y=i?.mediaType||`text/plain`,b=y.startsWith(`image/`)||y===`application/pdf`;!b&&y&&(_.next(!0),e.browse.resourceRepresentation(t,{accept:y}).then(({data:e})=>{g.next(Po(e,y)),_.next(!1)}).catch(()=>{_.next(!1)})),b&&e.auth.mediaToken(t).then(({token:e})=>v.next(e)).catch(()=>{});let x=new f1.BehaviorSubject(p1),S=e.subscribeToResource(t);a.add(S);let C=e.bus.get(`bind:initiate`).subscribe(t=>{x.next({open:!0,annotationId:t.annotationId,resourceId:t.resourceId,defaultTitle:t.defaultTitle,entityTypes:t.entityTypes}),e.bus.get(`gather:requested`).next({correlationId:crypto.randomUUID(),annotationId:t.annotationId,resourceId:t.resourceId,options:{contextWindow:2e3}})});return a.add(()=>C.unsubscribe()),{beckon:o,browse:r,mark:s,gather:c,yield:u,annotations$:d,annotationGroups$:f,entityTypes$:p,events$:m,referencedBy$:h,content$:g.asObservable(),contentLoading$:_.asObservable(),mediaToken$:v.asObservable(),wizard$:x.asObservable(),closeWizard:()=>x.next(p1),dispose:()=>{x.complete(),g.complete(),_.complete(),v.complete(),a.dispose()}}}function h1(){return typeof window>`u`?null:localStorage.getItem(`activeToolbarPanel`)||`knowledge-base`}function g1(e){typeof window>`u`||(e?localStorage.setItem(`activeToolbarPanel`,e):localStorage.removeItem(`activeToolbarPanel`))}function _1(){let e=R();return iE(()=>z$(e,{initialPanel:h1(),onPanelChange:g1}))}function v1({resource:e,rUri:t,locale:n,Link:r,routes:i,ToolbarPanels:a,refetchDocument:o,streamStatus:s,knowledgeBaseName:c}){let l=hh(`ReferenceWizard`),u=R(),d=K(u.activeSession$),f=d?.client,{showError:p,showSuccess:h,showInfo:g}=sh(),{theme:_,setTheme:v}=vE(),{showLineNumbers:y,toggleLineNumbers:b}=lE(),{hoverDelayMs:x}=dE(),{triggerSparkleAnimation:S,clearNewAnnotationId:C}=jE(),w=Ro(ho(e)||`text/plain`)===`image`,{content:T,loading:E}=bE(t,e,!w),{token:D,loading:O}=d1(t),k=w&&D&&f?`${f.baseUrl}/api/resources/${t}?token=${D}`:``,A=w?k:T,ee=w?O:E,te=_1(),j=iE(()=>m1(f,t,n,te)),ne=K(j.annotations$)??[],re=K(j.annotationGroups$),ie=K(j.entityTypes$)??[],ae=K(j.referencedBy$),M=ae??[],oe=ae===void 0,se=K(j.beckon.hoveredAnnotationId$)??null,ce=K(j.mark.pendingAnnotation$)??null,le=K(j.mark.assistingMotivation$)??null,ue=K(j.mark.progress$)??null,N=K(j.browse.activePanel$)??null,de=K(j.browse.scrollToAnnotationId$)??null,fe=K(j.browse.panelInitialTab$)??null,pe=j.browse.onScrollCompleted,me=K(j.yield.progress$)??null,he=K(j.gather.context$)??null,ge=K(j.gather.loading$)??!1,_e=K(j.gather.error$)??null,ve=K(j.wizard$),ye=ve?.open??!1,be=ve?.annotationId??null,xe=ve?.resourceId??null,Se=ve?.defaultTitle??``,Ce=ve?.entityTypes??[],we=(0,m.useCallback)(()=>{j.closeWizard()},[j]),Te=(0,m.useCallback)((t,n)=>{C(za(t)),j.yield.generate(t,{title:n.title,storageUri:n.storagePath,prompt:n.prompt,language:n.language,sourceLanguage:go(e),temperature:n.temperature,maxTokens:n.maxTokens,context:n.context})},[j,C,e]),Ee=(0,m.useCallback)(async(e,n)=>{if(f)try{await f.bind.body(t,za(e),[{op:`add`,item:{type:`SpecificResource`,source:n,purpose:`linking`}}]),h(`Reference linked successfully`)}catch(e){p(`Failed to link reference: ${e instanceof Error?e.message:String(e)}`)}},[t,f,h,p]),De=(0,m.useCallback)((e,t,n,r,i)=>{sessionStorage.setItem(`gather-context:${t}`,JSON.stringify(e));let a=new URLSearchParams({annotationUri:t,sourceDocumentId:n,name:r,entityTypes:i.join(`,`)});u.emit(`nav:push`,{path:`/know/compose?${a.toString()}`,reason:`compose-from-wizard`})},[d]);(0,m.useEffect)(()=>{if(e&&t){let n=ho(e);u.addOpenResource(t,e.name,n||void 0,e.storageUri),typeof localStorage<`u`&&localStorage.setItem(`lastViewedDocumentId`,t)}},[e,t,u]),(0,m.useEffect)(()=>{ce&&u.emit(`panel:open`,{panel:`annotations`})},[ce,u]);let Oe=(0,m.useCallback)(async()=>{if(f)try{await f.mark.archive(t),await o()}catch(e){console.error(`Failed to archive document:`,e),p(`Failed to archive document`)}},[f,t,o,p]),ke=(0,m.useCallback)(async()=>{if(f)try{await f.mark.unarchive(t),await o()}catch(e){console.error(`Failed to unarchive document:`,e),p(`Failed to unarchive document`)}},[f,t,o,p]),Ae=(0,m.useCallback)(async()=>{if(f)try{let e=(await f.yield.cloneToken(t)).token;u.emit(`nav:push`,{path:`/know/compose?mode=clone&token=${e}`,reason:`clone`})}catch(e){console.error(`Failed to generate clone token:`,e),p(`Failed to generate clone link`)}},[f,t,p,d]),je=(0,m.useCallback)(({annotationId:e})=>{S(e)},[S]),Me=(0,m.useCallback)(e=>{S(e.payload.annotation.id)},[S]),Ne=(0,m.useCallback)(({message:e})=>p(`Failed to create annotation: ${e||`unknown error`}`),[p]),Pe=(0,m.useCallback)(({message:e})=>p(`Failed to delete annotation: ${e||`unknown error`}`),[p]),Fe=(0,m.useCallback)(()=>{},[]),Ie=(0,m.useCallback)(({message:e})=>p(`Failed to update reference: ${e}`),[p]),Le=(0,m.useCallback)(({theme:e})=>v(e),[v]),Re=(0,m.useCallback)(t=>{if(t.resourceId===e.id)if(t.jobType===`generation`){let e=t.result?.resourceName;h(e?`Resource "${e}" created successfully!`:`Resource created successfully!`)}else h(`Annotation complete`)},[e.id,h]),ze=(0,m.useCallback)(t=>{t.resourceId===e.id&&(t.jobType===`generation`?p(`Resource generation failed: ${t.error}`):p(t.error||`Annotation failed`))},[e.id,p]),Be=(0,m.useCallback)(({resourceId:e})=>{if(i.resourceDetail){let t=i.resourceDetail(e);u.emit(`nav:push`,{path:t,reason:`reference-link`})}},[i.resourceDetail,d]),Ve=(0,m.useCallback)(({entityType:e})=>{if(i.know){let t=`${i.know}?entityType=${encodeURIComponent(e)}`;u.emit(`nav:push`,{path:t,reason:`entity-type-filter`})}},[i.know,d]);SE({"mark:mode-toggled":(0,m.useCallback)(()=>{Ye(e=>!e)},[]),"mark:archive":Oe,"mark:unarchive":ke,"yield:clone":Ae,"beckon:sparkle":je,"mark:added":Me,"mark:create-failed":Ne,"mark:delete-failed":Pe,"mark:body-updated":Fe,"bind:body-update-failed":Ie,"settings:theme-changed":Le,"settings:line-numbers-toggled":b,"job:complete":Re,"job:fail":ze,"mark:assist-cancelled":()=>g(`Annotation cancelled`),"browse:reference-navigate":Be,"browse:entity-type-clicked":Ve});let{announceResourceLoading:He,announceResourceLoaded:Ue}=EE();(0,m.useEffect)(()=>{ee?He(e.name):A&&Ue(e.name)},[ee,A,e.name,He,Ue]);let We=e.entityTypes||[],Ge=mo(e),Ke=Ge?.mediaType,qe=Ge?.byteSize,[Je,Ye]=(0,m.useState)(()=>typeof window<`u`?localStorage.getItem(`annotateMode`)===`true`:!1),Xe={...e,content:A},Ze=(0,m.useCallback)(e=>{e&&d?.client.beckon.sparkle(za(e))},[d]),Qe=(0,m.useCallback)(e=>{},[]);return(0,P.jsxs)(`div`,{className:`semiont-document-viewer${N?` semiont-document-viewer--panel-open`:``}`,children:[(0,P.jsxs)(`div`,{className:`semiont-document-viewer__main`,children:[(0,P.jsxs)(`div`,{className:`semiont-document-viewer__content`,children:[(0,P.jsx)(`div`,{className:`semiont-document-viewer__header`,children:(0,P.jsx)(`div`,{className:`semiont-document-viewer__header-inner`,children:(0,P.jsx)(`h2`,{className:`semiont-document-viewer__title`,children:e.name})})}),(0,P.jsx)(`div`,{className:`semiont-document-viewer__scrollable-body`,lang:go(e)||void 0,children:(0,P.jsx)(KN,{fallback:(e,t)=>(0,P.jsxs)(`div`,{className:`semiont-document-viewer__error`,children:[(0,P.jsx)(`h3`,{className:`semiont-document-viewer__error-title`,children:`Error loading document viewer`}),(0,P.jsx)(`p`,{className:`semiont-document-viewer__error-message`,children:e.message}),(0,P.jsx)(`button`,{onClick:t,className:`semiont-document-viewer__error-button`,children:`Try again`})]}),children:ee?(0,P.jsx)(`div`,{className:`semiont-document-viewer__loading`,children:`Loading document content...`}):(0,P.jsx)(kJ,{resource:Xe,annotations:re??{highlights:[],comments:[],assessments:[],references:[],tags:[]},generatingReferenceId:me?.annotationId??null,showLineNumbers:y,hoverDelayMs:x,hoveredAnnotationId:se})})})]}),(0,P.jsxs)(`div`,{className:`semiont-document-viewer__sidebar`,children:[(0,P.jsxs)(a,{activePanel:N,theme:_,showLineNumbers:y,width:N===`jsonld`?`w-[600px]`:N===`annotations`?`w-[400px]`:`w-64`,children:[Je&&e.archived&&(0,P.jsx)(`div`,{className:`semiont-document-viewer__archived-status`,children:(0,P.jsx)(`div`,{className:`semiont-document-viewer__archived-text`,children:`📦 Archived`})}),N===`annotations`&&!e.archived&&(0,P.jsx)(sY,{annotations:ne,annotators:Ih,annotateMode:Je,assistingMotivation:le,progress:ue,pendingAnnotation:ce,allEntityTypes:ie,generatingReferenceId:me?.annotationId??null,referencedBy:M,referencedByLoading:oe,resourceId:t,locale:n,sourceLanguage:go(e),scrollToAnnotationId:de,hoveredAnnotationId:se,onScrollCompleted:pe,initialTab:fe?.tab,initialTabGeneration:fe?.generation,Link:r,routes:i}),N===`history`&&(0,P.jsx)(UR,{rUri:t,hoveredAnnotationId:se,onEventHover:Ze,onEventClick:Qe,Link:r,routes:i}),N===`info`&&(0,P.jsx)(tY,{resourceId:t,documentEntityTypes:We,documentLocale:go(e),primaryMediaType:Ke,primaryByteSize:qe,storageUri:e.storageUri,isArchived:e.archived??!1,dateCreated:e.dateCreated,dateModified:e.dateModified,wasAttributedTo:e.wasAttributedTo,wasDerivedFrom:e.wasDerivedFrom,generator:e.generator}),N===`collaboration`&&(0,P.jsx)(zJ,{state:s,eventCount:0,knowledgeBaseName:c}),N===`jsonld`&&(0,P.jsx)(qJ,{resource:e})]}),(0,P.jsx)(ZN,{context:`document`,activePanel:N,isArchived:e.archived??!1})]})]}),(0,P.jsx)(zQ,{isOpen:ye,onClose:we,annotationId:be,resourceId:xe,defaultTitle:Se,entityTypes:Ce,locale:n,context:he,contextLoading:ge,contextError:_e,onGenerateSubmit:Te,onLinkResource:Ee,onComposeNavigate:De,translations:{gatherTitle:l(`gatherTitle`),configureGenerationTitle:l(`configureGenerationTitle`),configureSearchTitle:l(`configureSearchTitle`),searchResultsTitle:l(`searchResultsTitle`),sourceContextLabel:l(`sourceContextLabel`),connectionsLabel:l(`connectionsLabel`),citedByLabel:l(`citedByLabel`),userHintLabel:l(`userHintLabel`),userHintPlaceholder:l(`userHintPlaceholder`),loadingContext:l(`loadingContext`),failedContext:l(`failedContext`),cancel:l(`cancel`),search:l(`search`),searching:l(`searching`),generate:l(`generate`),compose:l(`compose`),resolutionStrategyLabel:l(`resolutionStrategyLabel`),back:l(`back`),link:l(`link`),score:l(`score`),noResults:l(`noResults`),resourceTitle:l(`resourceTitle`),resourceTitlePlaceholder:l(`resourceTitlePlaceholder`),additionalInstructions:l(`additionalInstructions`),additionalInstructionsPlaceholder:l(`additionalInstructionsPlaceholder`),language:l(`language`),languageHelp:l(`languageHelp`),creativity:l(`creativity`),creativityFocused:l(`creativityFocused`),creativityCreative:l(`creativityCreative`),maxLength:l(`maxLength`),maxLengthHelp:l(`maxLengthHelp`),maxResults:l(`maxResults`),semanticScoring:l(`semanticScoring`),semanticScoringHelp:l(`semanticScoringHelp`)}})]})}var y1=u(Qm(),1);function b1(e){let t=new y1.BehaviorSubject(!1);return{isLoggingOut$:t.asObservable(),logout:async()=>{t.next(!0);try{await e.auth.logout()}catch{}finally{t.next(!1)}},dispose:()=>{t.complete()}}}var x1=u(Qm(),1);function S1(e,t,n,r){let i=zu();i.add(t);let a=!!(n.annotationUri&&n.sourceDocumentId&&n.name),o=n.mode===`clone`&&!!n.token,s=o?`clone`:a?`reference`:`new`,c=new x1.BehaviorSubject(s),l=new x1.BehaviorSubject(!0),u=new x1.BehaviorSubject(null),d=new x1.BehaviorSubject(null),f=new x1.BehaviorSubject(null),p=new x1.BehaviorSubject(null),m=e.browse.entityTypes().pipe((0,x1.map)(e=>e??[]));if(a){let e=n.entityTypes?n.entityTypes.split(`,`):[];if(d.next({annotationUri:n.annotationUri,sourceDocumentId:n.sourceDocumentId,name:n.name,entityTypes:e}),n.storedContext)try{f.next(JSON.parse(n.storedContext))}catch{}l.next(!1)}else o?(async()=>{try{let t=await e.yield.fromToken(n.token);if(t&&r){let n=Ra(t[`@id`]),r=ho(t)||`text/plain`,{data:i}=await e.browse.resourceRepresentation(n,{accept:r}),a=Po(i,r);u.next({sourceResource:t,sourceContent:a})}}catch{}l.next(!1)})():l.next(!1);return{browse:t,mode$:c.asObservable(),loading$:l.asObservable(),cloneData$:u.asObservable(),referenceData$:d.asObservable(),gatheredContext$:f.asObservable(),entityTypes$:m,uploadProgress$:p.asObservable(),save:async t=>{if(t.mode===`clone`)return(await e.yield.createFromToken({token:n.token,name:t.name,content:t.content,archiveOriginal:t.archiveOriginal??!0})).resourceId;let r,i;if(t.file)r=t.file,i=t.format??`application/octet-stream`;else{let e=new Blob([t.content||``],{type:t.format??`application/octet-stream`}),n=t.format===`text/plain`?`.txt`:t.format===`text/html`?`.html`:`.md`;r=new File([e],t.name+n,{type:t.format??`application/octet-stream`}),i=t.format??`application/octet-stream`}let a=t.charset&&!t.file?`${i}; charset=${t.charset}`:i,o=await new Promise((n,i)=>{e.yield.resource({name:t.name,file:r,format:a,entityTypes:t.entityTypes||[],language:t.language,storageUri:t.storageUri}).subscribe({next:e=>{p.next(e),e.phase===`finished`&&n(e.resourceId)},error:e=>{p.next(null),i(e)},complete:()=>p.next(null)})});return t.mode===`reference`&&t.annotationUri&&t.sourceDocumentId&&await e.bind.body(Ra(t.sourceDocumentId),za(t.annotationUri),[{op:`add`,item:{type:`SpecificResource`,source:o,purpose:`linking`}}]),o},dispose:()=>{c.complete(),l.complete(),u.complete(),d.complete(),f.complete(),i.dispose()}}}var C1=u(Qm(),1);function w1(e,t){let n=e.browse.resource(t);return{resource$:n,isLoading$:n.pipe((0,C1.map)(e=>e===void 0)),invalidate:()=>e.browse.invalidateResourceDetail(t),dispose:()=>{}}}var T1=u(Qm(),1);function E1(e,t){let n=zu();n.add(t);let r=new T1.BehaviorSubject([]),i=new T1.BehaviorSubject(null),a=new T1.BehaviorSubject(!0),o=new T1.BehaviorSubject(!0),s=()=>{a.next(!0),e.admin.users().then(e=>{r.next(e.users??[]),a.next(!1)}).catch(()=>a.next(!1))},c=()=>{o.next(!0),e.admin.userStats().then(e=>{i.next(e.stats??null),o.next(!1)}).catch(()=>o.next(!1))};return s(),c(),{browse:t,users$:r.asObservable(),stats$:i.asObservable(),usersLoading$:a.asObservable(),statsLoading$:o.asObservable(),updateUser:async(t,n)=>{await e.admin.updateUser(Fa(t),n),s(),c()},dispose:()=>{r.complete(),i.complete(),a.complete(),o.complete(),n.dispose()}}}var D1=u(Qm(),1);function O1(e,t){let n=zu();n.add(t);let r=new D1.BehaviorSubject([]),i=new D1.BehaviorSubject([]),a=new D1.BehaviorSubject(!0);return e.admin.oauthConfig().then(e=>{let t=e;r.next(t.providers??[]),i.next(t.allowedDomains??[]),a.next(!1)}).catch(()=>a.next(!1)),{browse:t,providers$:r.asObservable(),allowedDomains$:i.asObservable(),isLoading$:a.asObservable(),dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}var k1=u(Qm(),1),A1=u(Fh(),1);function j1(e,t,n){let r=zu();r.add(e);let i=new k1.BehaviorSubject(null),a=new k1.BehaviorSubject(null),o=new k1.BehaviorSubject(null),s=new k1.BehaviorSubject(void 0),c=new k1.BehaviorSubject(void 0),l=new k1.BehaviorSubject(!1),u=new k1.BehaviorSubject(!1);return{browse:e,selectedFile$:i.asObservable(),preview$:a.asObservable(),importPhase$:o.asObservable(),importMessage$:s.asObservable(),importResult$:c.asObservable(),isExporting$:l.asObservable(),isImporting$:u.asObservable(),selectFile:e=>{i.next(e),o.next(null),s.next(void 0),c.next(void 0),a.next({format:e.name.endsWith(`.tar.gz`)||e.name.endsWith(`.gz`)?`semiont-linked-data`:`unknown`,version:1,sourceUrl:``,stats:{}})},cancelImport:()=>{i.next(null),a.next(null),o.next(null),s.next(void 0),c.next(void 0)},doExport:async()=>{l.next(!0);try{let e=await t();return{blob:await new Response(e.stream).blob(),filename:e.filename??`semiont-export-${Date.now()}.tar.gz`}}finally{l.next(!1)}},doImport:async()=>{let e=i.getValue();if(e){u.next(!0),o.next(`started`),s.next(void 0),c.next(void 0);try{await(0,k1.lastValueFrom)(n(e).pipe((0,A1.tap)(e=>{o.next(e.phase),s.next(e.message),e.result&&c.next(e.result)})))}finally{u.next(!1)}}},dispose:()=>{i.complete(),a.complete(),o.complete(),s.complete(),c.complete(),l.complete(),u.complete(),r.dispose()}}}var M1=u(Qm(),1);function N1(e){let t=zu(),n=new M1.BehaviorSubject(null),r=new M1.BehaviorSubject(!1);return e.auth.me().then(e=>n.next(e)).catch(()=>{}),{userData$:n.asObservable(),isProcessing$:r.asObservable(),acceptTerms:async()=>{r.next(!0);try{await e.auth.acceptTerms(),n.next({...n.getValue(),termsAcceptedAt:new Date().toISOString()})}finally{r.next(!1)}},dispose:()=>{n.complete(),r.complete(),t.dispose()}}}var P1=u(Qm(),1),F1=10,I1=20;function L1(e,t){let n=zu(),r=Bu(t=>e.browse.resources({search:t,limit:I1}));n.add(r),n.add(t);let i=e.browse.resources({limit:F1,archived:!1}),a=i.pipe((0,P1.map)(e=>e??[])),o=i.pipe((0,P1.map)(e=>e===void 0));return{browse:t,search:r,recentResources$:a,entityTypes$:e.browse.entityTypes().pipe((0,P1.map)(e=>e??[])),isLoadingRecent$:o,dispose:()=>n.dispose()}}var R1=u(Qm(),1);function z1(e,t){let n=zu();n.add(t);let r=new R1.BehaviorSubject(``),i=new R1.BehaviorSubject(``),a=new R1.BehaviorSubject(!1),o=e.browse.entityTypes();return{browse:t,entityTypes$:o.pipe((0,R1.map)(e=>e??[])),isLoading$:o.pipe((0,R1.map)(e=>e===void 0)),newTag$:r.asObservable(),error$:i.asObservable(),isAdding$:a.asObservable(),setNewTag:e=>r.next(e),addTag:async()=>{let t=r.getValue().trim();if(t){i.next(``),a.next(!0);try{await e.frame.addEntityType(t),r.next(``)}catch(e){i.next(e instanceof Error?e.message:`Failed to add entity type`)}finally{a.next(!1)}}},dispose:()=>{r.complete(),i.complete(),a.complete(),n.dispose()}}}function B1({children:e}){return(0,P.jsxs)(JN,{resetKeys:[et().pathname],children:[(0,P.jsx)(OR,{}),(0,P.jsx)(DR,{}),e]})}var V1=m.lazy(()=>b(()=>import(`./layout-osn4jTJF.js`),__vite__mapDeps([6,3,7,8,4,5]))),H1=m.lazy(()=>b(()=>import(`./page-vxSCIznX.js`),__vite__mapDeps([9,3,8,4,5]))),U1=m.lazy(()=>b(()=>import(`./page-D74-p81B.js`),__vite__mapDeps([10,3,11,7,8,4,5,12,13]))),W1=m.lazy(()=>b(()=>import(`./page-Crea7MLa.js`),__vite__mapDeps([14,3,11,7,8,4,5,12,13]))),G1=m.lazy(()=>b(()=>import(`./page-DWTT4pP82.js`),__vite__mapDeps([15,3,11,7,8,4,5,12,13]))),K1=m.lazy(()=>b(()=>import(`./page-V3GB89Xa.js`),__vite__mapDeps([16,3,8,4,5]))),q1=m.lazy(()=>b(()=>import(`./page-BXDwcCLI.js`),__vite__mapDeps([17,3,11,7,8,4,5,12,13]))),J1=m.lazy(()=>b(()=>import(`./page-ClOO6d4L.js`),__vite__mapDeps([18,3,11,7,8,4,5,12,13]))),Y1=m.lazy(()=>b(()=>import(`./page-pid5J2JR.js`),__vite__mapDeps([19,3,8,4,5]))),X1=m.lazy(()=>b(()=>import(`./layout-CpxxVgZl.js`),__vite__mapDeps([20,3,11,7,8,4,5,12,21,13,22]))),Z1=m.lazy(()=>b(()=>import(`./page-D3vt40lt.js`),__vite__mapDeps([23,3,8,4,5]))),Q1=m.lazy(()=>b(()=>import(`./page-yaV9evoV.js`),__vite__mapDeps([24,3,21,8,4,5,12]))),$1=m.lazy(()=>b(()=>import(`./page-DAaiG0_S.js`),__vite__mapDeps([25,3,21,8,4,5,12]))),e0=m.lazy(()=>b(()=>import(`./page-3_orURnj.js`),__vite__mapDeps([26,3,21,8,4,5,12,13]))),t0=m.lazy(()=>b(()=>import(`./layout-DGddEk2F.js`),__vite__mapDeps([27,3,11,7,8,4,5,12,13,28,22,29]))),n0=m.lazy(()=>b(()=>import(`./page-DGGXDS8h.js`),__vite__mapDeps([30,8,3,4,5]))),r0=m.lazy(()=>b(()=>import(`./client-D5yyxFbt.js`),__vite__mapDeps([31,3,21,8,4,5,12]))),i0=m.lazy(()=>b(()=>import(`./client-DgzjF497.js`),__vite__mapDeps([32,3,21,8,4,5,12]))),a0=m.lazy(()=>b(()=>import(`./client-C54EWgTc.js`),__vite__mapDeps([33,3,21,8,4,5,12]))),o0=m.lazy(()=>b(()=>import(`./page-CR97hIaP.js`),__vite__mapDeps([34,3,21,8,4,5,12,29]))),s0=m.lazy(()=>b(()=>import(`./layout-WUjhuEFR.js`),__vite__mapDeps([35,3,11,7,8,4,5,12,13,28,22]))),c0=m.lazy(()=>b(()=>import(`./page-Db8QDovL.js`),__vite__mapDeps([36,3,8,4,5]))),l0=m.lazy(()=>b(()=>import(`./page-CoU19X7P.js`),__vite__mapDeps([37,3,21,8,4,5,12]))),u0=m.lazy(()=>b(()=>import(`./page-D9VjQ4Ci.js`),__vite__mapDeps([38,3,21,8,4,5,12]))),d0=m.lazy(()=>b(()=>import(`./page-A0bP7R9_.js`),__vite__mapDeps([39,3,21,8,4,5,12]))),f0=m.lazy(()=>b(()=>import(`./client-myF3ozNf.js`),__vite__mapDeps([40,3,21,8,4,5,12]))),p0=m.lazy(()=>b(()=>import(`./not-found-CXjr3aHk.js`),__vite__mapDeps([41,3,8,4,5])));function m0({children:e}){let{locale:t}=st(),{i18n:n}=r();return(0,m.useEffect)(()=>{if(!t)return;let e=vr(t)?t:`en`;n.language!==e&&n.changeLanguage(e)},[t,n]),!t||!vr(t)?(0,P.jsx)(jt,{to:`/en`,replace:!0}):(0,P.jsx)(P.Fragment,{children:e})}function h0(){return(0,P.jsx)(B1,{children:(0,P.jsx)(Mt,{})})}function g0(){let e=rt();return(0,m.useEffect)(()=>{let t=navigator.language.split(`-`)[0]??`en`;e(`/${vr(t)?t:`en`}`,{replace:!0})},[e]),null}function _0(){return(0,P.jsx)(m.Suspense,{fallback:null,children:(0,P.jsxs)(Ft,{children:[(0,P.jsx)(Nt,{path:`/`,element:(0,P.jsx)(g0,{})}),(0,P.jsxs)(Nt,{path:`/:locale`,element:(0,P.jsx)(m0,{children:(0,P.jsx)(V1,{})}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(H1,{})}),(0,P.jsx)(Nt,{path:`about`,element:(0,P.jsx)(U1,{})}),(0,P.jsx)(Nt,{path:`privacy`,element:(0,P.jsx)(W1,{})}),(0,P.jsx)(Nt,{path:`terms`,element:(0,P.jsx)(G1,{})}),(0,P.jsx)(Nt,{path:`auth/connect`,element:(0,P.jsx)(K1,{})}),(0,P.jsx)(Nt,{path:`auth/signup`,element:(0,P.jsx)(q1,{})}),(0,P.jsx)(Nt,{path:`auth/error`,element:(0,P.jsx)(J1,{})}),(0,P.jsxs)(Nt,{element:(0,P.jsx)(h0,{}),children:[(0,P.jsx)(Nt,{path:`auth/welcome`,element:(0,P.jsx)(Y1,{})}),(0,P.jsxs)(Nt,{path:`know`,element:(0,P.jsx)(X1,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(Z1,{})}),(0,P.jsx)(Nt,{path:`discover`,element:(0,P.jsx)(Q1,{})}),(0,P.jsx)(Nt,{path:`compose`,element:(0,P.jsx)($1,{})}),(0,P.jsx)(Nt,{path:`resource/:id`,element:(0,P.jsx)(e0,{})})]}),(0,P.jsxs)(Nt,{path:`admin`,element:(0,P.jsx)(t0,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(n0,{})}),(0,P.jsx)(Nt,{path:`users`,element:(0,P.jsx)(r0,{})}),(0,P.jsx)(Nt,{path:`security`,element:(0,P.jsx)(i0,{})}),(0,P.jsx)(Nt,{path:`exchange`,element:(0,P.jsx)(a0,{})}),(0,P.jsx)(Nt,{path:`devops`,element:(0,P.jsx)(o0,{})})]}),(0,P.jsxs)(Nt,{path:`moderate`,element:(0,P.jsx)(s0,{}),children:[(0,P.jsx)(Nt,{index:!0,element:(0,P.jsx)(c0,{})}),(0,P.jsx)(Nt,{path:`recent`,element:(0,P.jsx)(l0,{})}),(0,P.jsx)(Nt,{path:`entity-tags`,element:(0,P.jsx)(u0,{})}),(0,P.jsx)(Nt,{path:`tag-schemas`,element:(0,P.jsx)(d0,{})}),(0,P.jsx)(Nt,{path:`linked-data`,element:(0,P.jsx)(f0,{})})]})]}),(0,P.jsx)(Nt,{path:`*`,element:(0,P.jsx)(p0,{})})]}),(0,P.jsx)(Nt,{path:`*`,element:(0,P.jsx)(jt,{to:`/en`,replace:!0})})]})})}var v0={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_OTEL_OTLP_ENDPOINT;v0&&b(async()=>{let{initObservabilityWeb:e}=await import(`./web-DAgGdiC_.js`);return{initObservabilityWeb:e}},[]).then(({initObservabilityWeb:e})=>{e({serviceName:`semiont-frontend`,otlpEndpoint:v0})});var y0=document.getElementById(`root`);if(!y0)throw Error(`Root element not found`);g.createRoot(y0).render((0,P.jsx)(m.StrictMode,{children:(0,P.jsx)(wn,{children:(0,P.jsx)(_0,{})})}));export{hE as $,a1 as A,Ra as At,j1 as B,WQ as C,Cc as Ct,uY as D,Js as Dt,Z$ as E,tc as Et,O1 as F,et as Ft,rE as G,b1 as H,E1 as I,rt as It,dE as J,cE as K,S1 as L,st as Lt,ZN as M,Dn as Mt,e1 as N,jt as Nt,GQ as O,La as Ot,Lh as P,Mt as Pt,pE as Q,L1 as R,Fn as Rt,v1 as S,Pc as St,QN as T,nc as Tt,N1 as U,w1 as V,aE as W,lE as X,sE as Y,K as Z,XN as _,il as _t,$$ as a,mh as at,u1 as b,Kc as bt,$Q as c,uu as ct,ER as d,Eu as dt,_1 as et,YQ as f,Bl as ft,n1 as g,al as gt,XQ as h,_l as ht,Y$ as i,oh as it,_E as j,vr as jt,KQ as k,to as kt,t1 as l,Hu as lt,TE as m,yl as mt,G$ as n,vE as nt,I$ as o,R as ot,q$ as p,zl as pt,SE as q,K$ as r,th as rt,NQ as s,sh as st,B$ as t,iE as tt,cY as u,wu as ut,AE as v,rl as vt,qQ as w,rc as wt,e$ as x,Fc as xt,c1 as y,Jc as yt,z1 as z};
|
|
141
|
+
//# sourceMappingURL=index-DojEUBpq.js.map
|