@semiont/browser 0.5.31 → 0.5.32

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.
Files changed (70) hide show
  1. package/dist/assets/{CookiePreferences-BEYpCWeE.js → CookiePreferences-CWZIFYNC.js} +2 -2
  2. package/dist/assets/{CookiePreferences-BEYpCWeE.js.map → CookiePreferences-CWZIFYNC.js.map} +1 -1
  3. package/dist/assets/{KeyboardShortcutsContext-16_iLSFD.js → KeyboardShortcutsContext-CSFk3vP6.js} +2 -2
  4. package/dist/assets/{KeyboardShortcutsContext-16_iLSFD.js.map → KeyboardShortcutsContext-CSFk3vP6.js.map} +1 -1
  5. package/dist/assets/{PdfAnnotationCanvas.client-LSH3PZPY-DzZPOyF8.js → PdfAnnotationCanvas.client-LSH3PZPY-D-7UQNP4.js} +2 -2
  6. package/dist/assets/{PdfAnnotationCanvas.client-LSH3PZPY-DzZPOyF8.js.map → PdfAnnotationCanvas.client-LSH3PZPY-D-7UQNP4.js.map} +1 -1
  7. package/dist/assets/{ToolbarPanels-YKoVdldK.js → ToolbarPanels-CbF3qEos.js} +2 -2
  8. package/dist/assets/{ToolbarPanels-YKoVdldK.js.map → ToolbarPanels-CbF3qEos.js.map} +1 -1
  9. package/dist/assets/{client-BbUuG4bp.js → client-CXKycZZZ.js} +2 -2
  10. package/dist/assets/{client-BbUuG4bp.js.map → client-CXKycZZZ.js.map} +1 -1
  11. package/dist/assets/{client-VGmNWvcK.js → client-CiXdSyqF.js} +2 -2
  12. package/dist/assets/{client-VGmNWvcK.js.map → client-CiXdSyqF.js.map} +1 -1
  13. package/dist/assets/{en-R5XA26NF-BKJaPGLP.js → en-R5XA26NF-BxJGw0oZ.js} +1 -1
  14. package/dist/assets/{index-aqrUF2g1.js → index-cHWd4mGO.js} +6 -6
  15. package/dist/assets/index-cHWd4mGO.js.map +1 -0
  16. package/dist/assets/{layout-CFJ1R_4B.js → layout-3T2CwuLU.js} +2 -2
  17. package/dist/assets/{layout-CFJ1R_4B.js.map → layout-3T2CwuLU.js.map} +1 -1
  18. package/dist/assets/{layout-DF_w0YXA.js → layout-B4A7CIsE.js} +2 -2
  19. package/dist/assets/{layout-DF_w0YXA.js.map → layout-B4A7CIsE.js.map} +1 -1
  20. package/dist/assets/{layout-CYYeGb9E.js → layout-CGq5doN0.js} +2 -2
  21. package/dist/assets/{layout-CYYeGb9E.js.map → layout-CGq5doN0.js.map} +1 -1
  22. package/dist/assets/{layout-F2_0FMvR.js → layout-DSvS5iO0.js} +2 -2
  23. package/dist/assets/{layout-F2_0FMvR.js.map → layout-DSvS5iO0.js.map} +1 -1
  24. package/dist/assets/{not-found---rVdVl1.js → not-found-k9OeYO0z.js} +2 -2
  25. package/dist/assets/{not-found---rVdVl1.js.map → not-found-k9OeYO0z.js.map} +1 -1
  26. package/dist/assets/{page-DF2F98fp.js → page-BNXN9uWs.js} +2 -2
  27. package/dist/assets/{page-DF2F98fp.js.map → page-BNXN9uWs.js.map} +1 -1
  28. package/dist/assets/{page-dj5t_vyE.js → page-BWTL-Lea.js} +2 -2
  29. package/dist/assets/{page-dj5t_vyE.js.map → page-BWTL-Lea.js.map} +1 -1
  30. package/dist/assets/{page-Dut8Hf_3.js → page-BfbTxteF.js} +2 -2
  31. package/dist/assets/{page-Dut8Hf_3.js.map → page-BfbTxteF.js.map} +1 -1
  32. package/dist/assets/{page-hlJ8ul_N.js → page-BhPjX09z.js} +2 -2
  33. package/dist/assets/{page-hlJ8ul_N.js.map → page-BhPjX09z.js.map} +1 -1
  34. package/dist/assets/{page-DrsJN1kz.js → page-Bk2UhTqA.js} +2 -2
  35. package/dist/assets/{page-DrsJN1kz.js.map → page-Bk2UhTqA.js.map} +1 -1
  36. package/dist/assets/{page-DeVJFcR4.js → page-CJnENX8F.js} +2 -2
  37. package/dist/assets/{page-DeVJFcR4.js.map → page-CJnENX8F.js.map} +1 -1
  38. package/dist/assets/{page-3MD_eERg.js → page-Ct7GNMjQ.js} +2 -2
  39. package/dist/assets/{page-3MD_eERg.js.map → page-Ct7GNMjQ.js.map} +1 -1
  40. package/dist/assets/{page-CUFFFOO5.js → page-CywSuXyN.js} +2 -2
  41. package/dist/assets/{page-CUFFFOO5.js.map → page-CywSuXyN.js.map} +1 -1
  42. package/dist/assets/{page-BXVIH3ZH.js → page-D-_kPKxI.js} +2 -2
  43. package/dist/assets/{page-BXVIH3ZH.js.map → page-D-_kPKxI.js.map} +1 -1
  44. package/dist/assets/{page-BQdzLSAm.js → page-DLiS_avb.js} +2 -2
  45. package/dist/assets/{page-BQdzLSAm.js.map → page-DLiS_avb.js.map} +1 -1
  46. package/dist/assets/{page-DajyPLX8.js → page-DS47DLy5.js} +2 -2
  47. package/dist/assets/{page-DajyPLX8.js.map → page-DS47DLy5.js.map} +1 -1
  48. package/dist/assets/{page-UJpd-iOP.js → page-DYcAqNIR.js} +2 -2
  49. package/dist/assets/{page-UJpd-iOP.js.map → page-DYcAqNIR.js.map} +1 -1
  50. package/dist/assets/{page-jq9pHwMZ.js → page-DYqW4iWr.js} +2 -2
  51. package/dist/assets/{page-jq9pHwMZ.js.map → page-DYqW4iWr.js.map} +1 -1
  52. package/dist/assets/{page-BGEAwvTK.js → page-De7BG-0h.js} +2 -2
  53. package/dist/assets/{page-BGEAwvTK.js.map → page-De7BG-0h.js.map} +1 -1
  54. package/dist/assets/{page-DBTvP7FS.js → page-DwyBQfbg.js} +2 -2
  55. package/dist/assets/{page-DBTvP7FS.js.map → page-DwyBQfbg.js.map} +1 -1
  56. package/dist/assets/{page-C6DNYsX4.js → page-OhVx5cMH.js} +2 -2
  57. package/dist/assets/{page-C6DNYsX4.js.map → page-OhVx5cMH.js.map} +1 -1
  58. package/dist/assets/{page-CeVHoag3.js → page-XISoI7Ji.js} +2 -2
  59. package/dist/assets/{page-CeVHoag3.js.map → page-XISoI7Ji.js.map} +1 -1
  60. package/dist/assets/{page-qNST6B2B.js → page-bR7KMw9p.js} +2 -2
  61. package/dist/assets/{page-qNST6B2B.js.map → page-bR7KMw9p.js.map} +1 -1
  62. package/dist/assets/{routing-UUaI7fkQ.js → routing-D-GkAfgE.js} +2 -2
  63. package/dist/assets/{routing-UUaI7fkQ.js.map → routing-D-GkAfgE.js.map} +1 -1
  64. package/dist/assets/{routing-Bp2n08tp.js → routing-D5d0e59H.js} +2 -2
  65. package/dist/assets/{routing-Bp2n08tp.js.map → routing-D5d0e59H.js.map} +1 -1
  66. package/dist/assets/{web-Cjbkk4IZ.js → web-DWjmWGs5.js} +2 -2
  67. package/dist/assets/{web-Cjbkk4IZ.js.map → web-DWjmWGs5.js.map} +1 -1
  68. package/dist/index.html +1 -1
  69. package/package.json +1 -1
  70. package/dist/assets/index-aqrUF2g1.js.map +0 -1
@@ -1,12 +1,12 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-BFxsW_Qg.js","assets/vendor-vK2W55bZ.js","assets/rolldown-runtime-hePW80VL.js","assets/i18n-CywLsdxn.js","assets/PdfAnnotationCanvas.client-LSH3PZPY-DzZPOyF8.js","assets/layout-CFJ1R_4B.js","assets/KeyboardShortcutsContext-16_iLSFD.js","assets/routing-UUaI7fkQ.js","assets/page-BQdzLSAm.js","assets/page-qNST6B2B.js","assets/CookiePreferences-BEYpCWeE.js","assets/XMarkIcon-Dt8lUQLh.js","assets/routing-Bp2n08tp.js","assets/page-C6DNYsX4.js","assets/page-CUFFFOO5.js","assets/page-DrsJN1kz.js","assets/page-jq9pHwMZ.js","assets/page-DF2F98fp.js","assets/page-UJpd-iOP.js","assets/layout-F2_0FMvR.js","assets/ToolbarPanels-YKoVdldK.js","assets/ChevronLeftIcon-ikKcEfM5.js","assets/page-3MD_eERg.js","assets/page-hlJ8ul_N.js","assets/page-DajyPLX8.js","assets/page-DBTvP7FS.js","assets/not-found---rVdVl1.js","assets/layout-CYYeGb9E.js","assets/CommandLineIcon-B3W-9AYr.js","assets/page-BGEAwvTK.js","assets/client-BbUuG4bp.js","assets/client-VGmNWvcK.js","assets/page-BXVIH3ZH.js","assets/layout-DF_w0YXA.js","assets/page-CeVHoag3.js","assets/page-Dut8Hf_3.js","assets/page-dj5t_vyE.js","assets/page-DeVJFcR4.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-BFxsW_Qg.js","assets/vendor-vK2W55bZ.js","assets/rolldown-runtime-hePW80VL.js","assets/i18n-CywLsdxn.js","assets/PdfAnnotationCanvas.client-LSH3PZPY-D-7UQNP4.js","assets/layout-3T2CwuLU.js","assets/KeyboardShortcutsContext-CSFk3vP6.js","assets/routing-D-GkAfgE.js","assets/page-DLiS_avb.js","assets/page-bR7KMw9p.js","assets/CookiePreferences-CWZIFYNC.js","assets/XMarkIcon-Dt8lUQLh.js","assets/routing-D5d0e59H.js","assets/page-OhVx5cMH.js","assets/page-CywSuXyN.js","assets/page-Bk2UhTqA.js","assets/page-DYqW4iWr.js","assets/page-BNXN9uWs.js","assets/page-DYcAqNIR.js","assets/layout-DSvS5iO0.js","assets/ToolbarPanels-CbF3qEos.js","assets/ChevronLeftIcon-ikKcEfM5.js","assets/page-Ct7GNMjQ.js","assets/page-BhPjX09z.js","assets/page-DS47DLy5.js","assets/page-DwyBQfbg.js","assets/not-found-k9OeYO0z.js","assets/layout-CGq5doN0.js","assets/CommandLineIcon-B3W-9AYr.js","assets/page-De7BG-0h.js","assets/client-CXKycZZZ.js","assets/client-CiXdSyqF.js","assets/page-D-_kPKxI.js","assets/layout-B4A7CIsE.js","assets/page-XISoI7Ji.js","assets/page-BfbTxteF.js","assets/page-BWTL-Lea.js","assets/page-CJnENX8F.js"])))=>i.map(i=>d[i]);
2
2
  import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{i as r,n as i,r as a,t as o}from"./i18n-CywLsdxn.js";import{a as s,c,d as l,f as u,l as d,m as f,n as p,o as m,p as h,s as g,t as _,u as v}from"./vendor-vK2W55bZ.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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var y=t(r(),1),b=t(h()),x=[];x.forEach,x.slice;var S=[`__proto__`,`constructor`,`prototype`];function C(e){return!(typeof e!=`string`||e.length===0||e.length>128||S.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%:\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function w(e){return!(!C(e)||e.indexOf(`/`)>-1||e.indexOf(`@`)>-1)}function T(e){return!(!C(e)||e.indexOf(`//`)>-1)}var E={lng:w,ns:T};function D(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function O(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 k(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function A(e){return!!e&&typeof e.then==`function`}function j(e){return A(e)?e:Promise.resolve(e)}var M=/\{\{(.+?)\}\}/g;function ee(e,t){let n=!1,r=e.replace(M,(e,r)=>{let i=r.trim();if(S.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=E[i]||w,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var N=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,te;typeof fetch==`function`?te=fetch:N&&typeof N.fetch==`function`&&(te=N.fetch);var P=k()&&N?N.XMLHttpRequest:void 0,F=typeof ActiveXObject==`function`&&N?N.ActiveXObject:void 0,ne=[`__proto__`,`constructor`,`prototype`],re=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))ne.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},ie=(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):te(e,t).then(i).catch(n)},ae=(e,t,n,r)=>{e.queryStringParams&&(t=re(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{ie(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]}),ie(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},oe=(e,t,n,r)=>{n&&typeof n==`object`&&(n=re(``,n).slice(1)),e.queryStringParams&&(t=re(t,e.queryStringParams));try{let i=P?new P:new F(`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))ne.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)}},se=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),te&&t.indexOf(`file:`)!==0)return ae(e,t,n,r);if(k()||typeof ActiveXObject==`function`)return oe(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},I=()=>({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:se,reloadInterval:typeof window<`u`?!1:36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),L=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={...I(),...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=j(a),a.then(a=>{if(!a)return i(null,{});let o=ee(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(D).join(`, `),r=n.map(D).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=D(O(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+`: `+D(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=ee(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)})})})}};L.type=`backend`;var ce=`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 le(e){return ce.includes(e)}a.use(L).use(i).init({ns:[`translation`],defaultNS:`translation`,fallbackLng:`en`,supportedLngs:[...ce],backend:{loadPath:`/messages/{{lng}}.json`},interpolation:{escapeValue:!1},initAsync:!1});var R=_(),ue;function de(e){ue=e}var fe;async function pe(){return fe||=s(()=>import(`./pdf-BFxsW_Qg.js`).then(e=>(ue&&(e.GlobalWorkerOptions.workerSrc=ue),e)),__vite__mapDeps([0,1,2,3])),fe}async function me(e){return(await pe()).getDocument({url:e}).promise}async function he(e,t=1){let n=e.getViewport({scale:t}),r=document.createElement(`canvas`);return r.width=n.width,r.height=n.height,await e.render({canvas:r,viewport:n}).promise,{dataUrl:r.toDataURL(`image/png`),width:n.width,height:n.height}}function ge(e,t,n,r,i){let a=e.left+t,o=e.top+n;return{x:a,y:o,width:r,height:i,top:o,right:a+r,bottom:o+i,left:a}}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,xe=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty,Ce=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},z=(e,t)=>function(){try{return t||(0,e[be(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of be(t))!Se.call(e,i)&&i!==n&&ve(e,i,{get:()=>t[i],enumerable:!(r=ye(t,i))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(xe(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=function(e,t){return Ee=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])},Ee(e,t)};function De(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Ee(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Oe(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 ke(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 Ae(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 je(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 Me(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 Ne(e){return this instanceof Ne?(this.v=e,this):new Ne(e)}function Pe(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 Ne?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 Fe(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Ae==`function`?Ae(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 Ie(e){return typeof e==`function`}function Le(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 Re=Le(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
3
3
  `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
4
4
  `):``,this.name=`UnsubscriptionError`,this.errors=t}});function ze(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Be=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=Ae(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(Ie(c))try{c()}catch(e){i=e instanceof Re?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Ae(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Ue(f)}catch(e){i??=[],e instanceof Re?i=Me(Me([],je(i)),je(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 Re(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Ue(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)&&ze(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&ze(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),Ve=Be.EMPTY;function He(e){return e instanceof Be||e&&`closed`in e&&Ie(e.remove)&&Ie(e.add)&&Ie(e.unsubscribe)}function Ue(e){Ie(e)?e():e.unsubscribe()}var We={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ge={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Ge.delegate;return r?.setTimeout?r.setTimeout.apply(r,Me([e,t],je(n))):setTimeout.apply(void 0,Me([e,t],je(n)))},clearTimeout:function(e){return(Ge.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ke(e){Ge.setTimeout(function(){var t=We.onUnhandledError;if(t)t(e);else throw e})}function qe(){}var Je=(function(){return Ze(`C`,void 0,void 0)})();function Ye(e){return Ze(`E`,void 0,e)}function Xe(e){return Ze(`N`,e,void 0)}function Ze(e,t,n){return{kind:e,value:t,error:n}}var Qe=null;function $e(e){if(We.useDeprecatedSynchronousErrorHandling){var t=!Qe;if(t&&(Qe={errorThrown:!1,error:null}),e(),t){var n=Qe,r=n.errorThrown,i=n.error;if(Qe=null,r)throw i}}else e()}function et(e){We.useDeprecatedSynchronousErrorHandling&&Qe&&(Qe.errorThrown=!0,Qe.error=e)}var tt=function(e){De(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,He(t)&&t.add(n)):n.destination=lt,n}return t.create=function(e,t,n){return new at(e,t,n)},t.prototype.next=function(e){this.isStopped?ct(Xe(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?ct(Ye(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?ct(Je,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}(Be),nt=Function.prototype.bind;function rt(e,t){return nt.call(e,t)}var it=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){ot(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ot(e)}else ot(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ot(e)}},e}(),at=function(e){De(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Ie(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&We.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&rt(t.next,o),error:t.error&&rt(t.error,o),complete:t.complete&&rt(t.complete,o)}):a=t}return i.destination=new it(a),i}return t}(tt);function ot(e){We.useDeprecatedSynchronousErrorHandling?et(e):Ke(e)}function st(e){throw e}function ct(e,t){var n=We.onStoppedNotification;n&&Ge.setTimeout(function(){return n(e,t)})}var lt={closed:!0,next:qe,error:st,complete:qe},ut=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function dt(e){return e}function ft(e){return e.length===0?dt:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var pt=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=gt(e)?e:new at(e,t,n);return $e(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=mt(t),new t(function(t,r){var i=new at({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[ut]=function(){return this},e.prototype.pipe=function(){return ft([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=mt(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 mt(e){return e??We.Promise??Promise}function ht(e){return e&&Ie(e.next)&&Ie(e.error)&&Ie(e.complete)}function gt(e){return e&&e instanceof tt||ht(e)&&He(e)}function _t(e){return Ie(e?.lift)}function vt(e){return function(t){if(_t(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 yt(e,t,n,r,i){return new bt(e,t,n,r,i)}var bt=function(e){De(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}(tt),xt=Le(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),St=function(e){De(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 Ct(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new xt},t.prototype.next=function(e){var t=this;$e(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Ae(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;$e(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;$e(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?Ve:(this.currentObservers=null,a.push(e),new Be(function(){t.currentObservers=null,ze(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 pt;return e.source=this,e},t.create=function(e,t){return new Ct(e,t)},t}(pt),Ct=function(e){De(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)??Ve},t}(St),wt=function(e){De(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}(St),Tt={now:function(){return(Tt.delegate||Date).now()},delegate:void 0},Et=function(e){De(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}(Be),Dt={setInterval:function(e,t){var n=[...arguments].slice(2),r=Dt.delegate;return r?.setInterval?r.setInterval.apply(r,Me([e,t],je(n))):setInterval.apply(void 0,Me([e,t],je(n)))},clearInterval:function(e){return(Dt.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Ot=function(e){De(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),Dt.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&&Dt.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,ze(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Et),kt=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=Tt.now,e}(),At=new(function(e){De(t,e);function t(t,n){n===void 0&&(n=kt.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}(kt))(Ot),jt=new pt(function(e){return e.complete()});function Mt(e){return e&&Ie(e.schedule)}function Nt(e){return e[e.length-1]}function Pt(e){return Mt(Nt(e))?e.pop():void 0}function Ft(e,t){return typeof Nt(e)==`number`?e.pop():t}var It=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Lt(e){return Ie(e?.then)}function Rt(e){return Ie(e[ut])}function zt(e){return Symbol.asyncIterator&&Ie(e?.[Symbol.asyncIterator])}function Bt(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 Vt(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Ht=Vt();function Ut(e){return Ie(e?.[Ht])}function Wt(e){return Pe(this,arguments,function(){var t,n,r,i;return ke(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,Ne(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,Ne(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ne(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 Gt(e){return Ie(e?.getReader)}function Kt(e){if(e instanceof pt)return e;if(e!=null){if(Rt(e))return qt(e);if(It(e))return Jt(e);if(Lt(e))return Yt(e);if(zt(e))return Zt(e);if(Ut(e))return Xt(e);if(Gt(e))return Qt(e)}throw Bt(e)}function qt(e){return new pt(function(t){var n=e[ut]();if(Ie(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Jt(e){return new pt(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Yt(e){return new pt(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Ke)})}function Xt(e){return new pt(function(t){var n,r;try{for(var i=Ae(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 Zt(e){return new pt(function(t){$t(e,t).catch(function(e){return t.error(e)})})}function Qt(e){return Zt(Wt(e))}function $t(e,t){var n,r,i,a;return Oe(this,void 0,void 0,function(){var o,s;return ke(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Fe(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 en(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 tn(e,t){return t===void 0&&(t=0),vt(function(n,r){n.subscribe(yt(r,function(n){return en(r,e,function(){return r.next(n)},t)},function(){return en(r,e,function(){return r.complete()},t)},function(n){return en(r,e,function(){return r.error(n)},t)}))})}function nn(e,t){return t===void 0&&(t=0),vt(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function rn(e,t){return Kt(e).pipe(nn(t),tn(t))}function an(e,t){return Kt(e).pipe(nn(t),tn(t))}function on(e,t){return new pt(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function sn(e,t){return new pt(function(n){var r;return en(n,t,function(){r=e[Ht](),en(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 Ie(r?.return)&&r.return()}})}function cn(e,t){if(!e)throw Error(`Iterable cannot be null`);return new pt(function(n){en(n,t,function(){var r=e[Symbol.asyncIterator]();en(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function ln(e,t){return cn(Wt(e),t)}function un(e,t){if(e!=null){if(Rt(e))return rn(e,t);if(It(e))return on(e,t);if(Lt(e))return an(e,t);if(zt(e))return cn(e,t);if(Ut(e))return sn(e,t);if(Gt(e))return ln(e,t)}throw Bt(e)}function dn(e,t){return t?un(e,t):Kt(e)}function fn(){var e=[...arguments];return dn(e,Pt(e))}function pn(e,t){var n=Ie(e)?e:function(){return e},r=function(e){return e.error(n())};return new pt(t?function(e){return t.schedule(r,0,e)}:r)}var mn=Le(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function hn(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 mn)}})})}function gn(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new at({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new mn)}});e.subscribe(a)})}function _n(e){return e instanceof Date&&!isNaN(e)}var vn=Le(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function yn(e,t){var n=_n(e)?{first:e}:typeof e==`number`?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?bn:a,s=n.scheduler,c=s===void 0?t??At:s,l=n.meta,u=l===void 0?null:l;if(r==null&&i==null)throw TypeError(`No timeout provided.`);return vt(function(e,t){var n,a,s=null,l=0,d=function(e){a=en(t,c,function(){try{n.unsubscribe(),Kt(o({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(yt(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 bn(e){throw new vn(e)}function xn(e,t){return vt(function(n,r){var i=0;n.subscribe(yt(r,function(n){r.next(e.call(t,n,i++))}))})}function Sn(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;Kt(n(e,u++)).subscribe(yt(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?en(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(yt(t,p,function(){d=!0,f()})),function(){s?.()}}function Cn(e,t,n){return n===void 0&&(n=1/0),Ie(t)?Cn(function(n,r){return xn(function(e,i){return t(n,e,r,i)})(Kt(e(n,r)))},n):(typeof t==`number`&&(n=t),vt(function(t,r){return Sn(t,r,e,n)}))}function wn(e){return e===void 0&&(e=1/0),Cn(dt,e)}function Tn(){return wn(1)}function En(){var e=[...arguments];return Tn()(dn(e,Pt(e)))}function Dn(){var e=[...arguments],t=Pt(e),n=Ft(e,1/0),r=e;return r.length?r.length===1?Kt(r[0]):wn(n)(dn(r,t)):jt}function On(e,t){return vt(function(n,r){var i=0;n.subscribe(yt(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function kn(e){return vt(function(t,n){var r=null,i=!1,a;r=t.subscribe(yt(n,void 0,void 0,function(o){a=Kt(e(o,kn(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function An(e,t){return t===void 0&&(t=At),vt(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(yt(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 jn(e){return vt(function(t,n){var r=!1;t.subscribe(yt(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function Mn(e){return e<=0?function(){return jt}:vt(function(t,n){var r=0;t.subscribe(yt(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function Nn(e,t){return t===void 0&&(t=dt),e??=Pn,vt(function(n,r){var i,a=!0;n.subscribe(yt(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function Pn(e,t){return e===t}function Fn(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new St}:t,r=e.resetOnError,i=r===void 0||r,a=e.resetOnComplete,o=a===void 0||a,s=e.resetOnRefCountZero,c=s===void 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 vt(function(e,m){s++,!u&&!l&&d();var h=a??=n();m.add(function(){s--,s===0&&!u&&!l&&(r=In(p,c))}),h.subscribe(m),!t&&s>0&&(t=new at({next:function(e){return h.next(e)},error:function(e){u=!0,d(),r=In(f,i,e),h.error(e)},complete:function(){l=!0,d(),r=In(f,o),h.complete()}}),Kt(e).subscribe(t))})(e)}}function In(e,t){var n=[...arguments].slice(2);if(t===!0){e();return}if(t!==!1){var r=new at({next:function(){r.unsubscribe(),e()}});return Kt(t.apply(void 0,Me([],je(n)))).subscribe(r)}}function Ln(e){return On(function(t,n){return e<=n})}function Rn(){var e=[...arguments],t=Pt(e);return vt(function(n,r){(t?En(e,n,t):En(e,n)).subscribe(r)})}function zn(e,t){return vt(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(yt(r,function(n){i?.unsubscribe();var o=0,c=a++;Kt(e(n,c)).subscribe(i=yt(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function Bn(e){return vt(function(t,n){Kt(e).subscribe(yt(n,function(){return n.complete()},qe)),!n.closed&&t.subscribe(n)})}function Vn(e){return e}function Hn(e){return e}function Un(e){return e}function Wn(e){return e}function Gn(e){return e}function Kn(e){return e}function qn(e){return e}var Jn={"bind:update-body":{result:`bind:body-updated`,failure:`bind:body-update-failed`},"browse:resource-requested":{result:`browse:resource-result`,failure:`browse:resource-failed`},"browse:anchored-text-requested":{result:`browse:anchored-text-result`,failure:`browse:anchored-text-failed`},"browse:resources-requested":{result:`browse:resources-result`,failure:`browse:resources-failed`},"browse:annotation-requested":{result:`browse:annotation-result`,failure:`browse:annotation-failed`},"browse:annotations-requested":{result:`browse:annotations-result`,failure:`browse:annotations-failed`},"browse:annotation-history-requested":{result:`browse:annotation-history-result`,failure:`browse:annotation-history-failed`},"browse:events-requested":{result:`browse:events-result`,failure:`browse:events-failed`},"browse:referenced-by-requested":{result:`browse:referenced-by-result`,failure:`browse:referenced-by-failed`},"browse:entity-types-requested":{result:`browse:entity-types-result`,failure:`browse:entity-types-failed`},"browse:tag-schemas-requested":{result:`browse:tag-schemas-result`,failure:`browse:tag-schemas-failed`},"browse:agents-requested":{result:`browse:agents-result`,failure:`browse:agents-failed`},"browse:directory-requested":{result:`browse:directory-result`,failure:`browse:directory-failed`},"browse:annotation-context-requested":{result:`browse:annotation-context-result`,failure:`browse:annotation-context-failed`},"frame:add-entity-type":{result:`frame:entity-type-add-ok`,failure:`frame:entity-type-add-failed`},"frame:add-tag-schema":{result:`frame:tag-schema-add-ok`,failure:`frame:tag-schema-add-failed`},"gather:requested":{result:`gather:complete`,failure:`gather:failed`,progress:`gather:annotation-progress`},"gather:resource-requested":{result:`gather:resource-complete`,failure:`gather:resource-failed`},"gather:summary-requested":{result:`gather:summary-result`,failure:`gather:summary-failed`},"job:create":{result:`job:created`,failure:`job:create-failed`},"job:status-requested":{result:`job:status-result`,failure:`job:status-failed`},"job:cancel-requested":{result:`job:cancel-ok`,failure:`job:cancel-failed`},"job:claim":{result:`job:claimed`,failure:`job:claim-failed`},"mark:create-request":{result:`mark:create-ok`,failure:`mark:create-failed`},"mark:commit":{result:`mark:commit-ok`,failure:`mark:commit-failed`},"mark:delete":{result:`mark:delete-ok`,failure:`mark:delete-failed`},"mark:archive":{result:`mark:archive-ok`,failure:`mark:archive-failed`},"mark:unarchive":{result:`mark:unarchive-ok`,failure:`mark:unarchive-failed`},"mark:update-entity-types":{result:`mark:update-entity-types-ok`,failure:`mark:update-entity-types-failed`},"match:search-requested":{result:`match:search-results`,failure:`match:search-failed`},"weave:rebuild":{result:`weave:rebuild-ok`,failure:`weave:rebuild-failed`},"smelt:rebuild-anchors":{result:`smelt:rebuild-anchors-ok`,failure:`smelt:rebuild-anchors-failed`},"yield:create":{result:`yield:create-ok`,failure:`yield:create-failed`},"yield:clone-persist":{result:`yield:clone-persist-ok`,failure:`yield:clone-persist-failed`},"yield:update":{result:`yield:update-ok`,failure:`yield:update-failed`},"yield:clone-create":{result:`yield:clone-created`,failure:`yield:clone-create-failed`},"yield:clone-resource-requested":{result:`yield:clone-resource-result`,failure:`yield:clone-resource-failed`},"yield:clone-token-requested":{result:`yield:clone-token-generated`,failure:`yield:clone-token-failed`}},Yn=[`job:report-progress`,`job:complete`,`job:fail`,`frame:entity-type-added`,`frame:tag-schema-added`,`yield:created`,`yield:updated`,`yield:cloned`,`yield:moved`,`beckon:focus`,`beckon:sparkle`,`bus:resume-gap`,`browse:resource-open`,`browse:resource-viewed`,`session:joined`,`session:left`,`browse:click`],Xn=[...Object.keys(Jn).flatMap(e=>{let t=Jn[e];return`progress`in t?[t.result,t.failure,t.progress]:[t.result,t.failure]}),...Yn],Zn=typeof process<`u`&&!!{}.SEMIONT_BUS_LOG,Qn=typeof process<`u`&&!!process.versions?.node;function $n(){return globalThis.__SEMIONT_BUS_LOG__?!0:Zn}var er;function tr(e){er=e}function nr(e,t,n,r){if(!$n())return;let i=n?.correlationId,a=typeof i==`string`?i.slice(0,8):void 0,o;if(er)try{o=er()}catch{}let s=`[bus ${e}] ${t}`+(r?` scope=${r}`:``)+(a?` cid=${a}`:``)+(o?` trace=${o.slice(0,8)}`:``);console.debug(s,n)}function rr(){return Qn}var ir=new Set;function ar(e,t,n){if(n>0)return;let r=t?.correlationId;typeof r==`string`&&r.length!==0&&(Xn.includes(e)||ir.has(e)||(ir.add(e),console.warn(`[bus DROP] ${e} cid=${r.slice(0,8)} emitted with 0 subscribers and not in BRIDGED_CHANNELS \u2014 a correlation reply with no forwarder is dropped, so the awaiting client times out (no error). Bridge it by declaring its operation in BUS_OPERATIONS (packages/core/src/bus-operations.ts) \u2014 or, if it is a non-reply broadcast, add it to BRIDGED_BROADCASTS (packages/core/src/bridged-channels.ts) \u2014 so transports subscribe to it.`)))}var or=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 St,n=$n(),r=rr();if(n||r){let i=t,a=t.next.bind(t);t.next=t=>{n&&nr(`EMIT`,String(e),t),r&&ar(String(e),t,i.observers.length),a(t)}}this.subjects.set(e,t)}return this.subjects.get(e)}getDomainEvent(e){return this.get(e)}observedChannels(){let e=[];for(let[t,n]of this.subjects)n.observed&&e.push(String(t));return 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 sr(this,e)}},sr=class e{constructor(e,t){this.parent=e,this.scopePrefix=t}parent;scopePrefix;get(e){let t=`${this.scopePrefix}:${e}`,n=this.parent.subjects;return n.has(t)||n.set(t,new St),n.get(t)}getDomainEvent(e){return this.get(e)}scope(t){return new e(this.parent,`${this.scopePrefix}:${t}`)}};function cr(e){if(e.includes(`/`))throw TypeError(`Expected ResourceId, got URI: ${e}`);return e}function lr(e){if(e.includes(`/`))throw TypeError(`Expected AnnotationId, got URI: ${e}`);return e}var ur=[`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:completed`,`job:failed`],dr=[];function fr(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}function pr(){let e=crypto.getRandomValues(new Uint8Array(16));return e[6]=e[6]&15|64,e[8]=e[8]&63|128,e}function mr(e){return Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function hr(){let e=mr(pr());return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`}function gr(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 _r(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 vr(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 yr(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 br(e){return yr(e)!==null}function xr(e){if(typeof e!=`string`)return e.selector}function Sr(e){return e.motivation===`highlighting`}function Cr(e){return e.motivation===`linking`}function wr(e){return e.motivation===`assessing`}function Tr(e){return e.motivation===`commenting`}function Er(e){return e.motivation===`tagging`}function Dr(e){if(!Tr(e))return;let t=Array.isArray(e.body)?e.body[0]:e.body;if(t&&`value`in t)return t.value}function Or(e){return Cr(e)&&br(e.body)}function kr(e){if(!e)return``;let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t?t.exact:``}function Ar(e){return kr(xr(e.target))}function jr(e){let t=(Array.isArray(e)?e:[e]).find(e=>e.type===`TextQuoteSelector`);return t&&t.type===`TextQuoteSelector`?t:null}function Mr(e){return`page=${e.page}&viewrect=${e.x},${e.y},${e.width},${e.height}`}function Nr(e){let t=e.match(/page=(\d+)/);if(!t)return null;let n=e.match(/viewrect=(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/);return n?{page:parseInt(t[1],10),x:parseFloat(n[1]),y:parseFloat(n[2]),width:parseFloat(n[3]),height:parseFloat(n[4])}:null}function Pr(e){return typeof e==`object`&&!!e&&`str`in e}function Fr(e,t){let n=[],r=``;for(let i of e)if(i.str.trim()){let e=r.length;r+=i.str;let a=r.length,[,,,,o,s]=i.transform;n.push({start:e,end:a,page:t,x:o,y:s,width:i.width,height:i.height}),r+=i.hasEOL?`
5
5
  `:` `}else i.hasEOL&&(r+=`
6
- `);return{text:r,items:n}}function Ir(e,t){let n=e.items.filter(e=>e.page===t.page&&zr(e,t)).sort((e,t)=>e.start-t.start);if(n.length===0)return``;let r=Lr(e,n[0]);for(let t=1;t<n.length;t++){let i=e.text.slice(n[t-1].end,n[t].start);r+=(i.trim()===``?i:` `)+Lr(e,n[t])}return r.trim()}var Lr=(e,t)=>e.text.slice(t.start,t.end),Rr=.5;function zr(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n<=0||r<=0?!1:n*r>=Rr*e.width*e.height}function Br(e){if(e)return e[`@id`]||void 0}function Vr(e){if(e?.representations)return(Array.isArray(e.representations)?e.representations:[e.representations])[0]}function Hr(e){return Vr(e)?.mediaType}function Ur(e){return Vr(e)?.language}function Wr(e){return Vr(e)?.storageUri}var Gr=class extends Error{constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`SemiontError`,Error.captureStackTrace(this,this.constructor)}code;details},Kr=class extends Gr{constructor(e,t,n){super(e,t,n),this.name=`BusRequestError`}};async function qr(e,t,n,r=3e4){let i=hr(),a={...n,correlationId:i},{result:o,failure:s}=Jn[t];if(e.isSubscribed){for(let n of[o,s])if(!e.isSubscribed(n))throw new Kr(`Transport is not subscribed to reply channel ${n} \u2014 a reply to ${t} can never arrive. Add this operation's reply channels to the transport's channel set.`,`bus.unsubscribed`,{channel:t,resultChannel:o,failureChannel:s})}let c=gn(Dn(e.stream(o).pipe(On(e=>e.correlationId===i),xn(e=>({ok:!0,response:e.response}))),e.stream(s).pipe(On(e=>e.correlationId===i),xn(e=>({ok:!1,error:new Kr(e.message??`Bus request rejected`,`bus.rejected`,{channel:s,correlationId:i,payload:e})})))).pipe(Mn(1),yn(r),kn(e=>e instanceof vn?pn(()=>new Kr(`Bus request timed out after ${r}ms on ${o}`,`bus.timeout`,{channel:t,resultChannel:o,correlationId:i,timeoutMs:r})):pn(()=>e)),jn({ok:!1,error:new Kr(`Bus closed before a reply on ${o}`,`bus.closed`,{channel:t,resultChannel:o,correlationId:i})}))),l=()=>(c.catch(()=>{}),new Kr(`Bus closed before emit on ${t}`,`bus.closed`,{channel:t,correlationId:i})),u;if(e.state$.subscribe(e=>{u=e}).unsubscribe(),u===`closed`)throw l();let d=u===`open`;if(!d){let t=gn(e.state$.pipe(On(e=>e===`open`||e===`closed`),Mn(1),jn(`closed`))),n=await Promise.race([t,c.then(()=>`settled`,()=>`settled`)]);if(n===`closed`)throw l();d=n===`open`}let f;if(d){f=e.trackReply?.(i);try{await e.emit(t,a)}catch(e){throw f?.(),f=void 0,c.catch(()=>{}),e}}try{let e=await c;if(!e.ok)throw e.error;return e.response}finally{f?.()}}var Jr=1024;function Yr(e,t){let{position:n,quote:r}=t;if(!r||!r.exact)return!n||n.start<0||n.end>e.length||n.start>=n.end?null:{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`};let{exact:i,prefix:a,suffix:o}=r;if(n){let t=n.start+i.length;if(n.start>=0&&t<=e.length&&e.substring(n.start,t)===i)return{start:n.start,end:t,strategy:`fast-path`,confidence:`high`}}let s=Xr(e,i);if(s.length===1){let e=s[0];return{start:e,end:e+i.length,strategy:`unique-occurrence`,confidence:`high`}}return s.length>1?$r(e,s,i,a,o,n?.start):n&&n.start>=0&&n.end<=e.length&&n.start<n.end?{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`}:null}function Xr(e,t){let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Zr(e,t,n,r,i){let a=0,o=!0,s=!0;if(r){let n=e.substring(Math.max(0,t-r.length),t);n.endsWith(r)?(a+=10,o=!0):(n.includes(r.trim())&&r.trim().length>0&&(a+=5),o=!1)}if(i){let r=e.substring(t+n.length,Math.min(e.length,t+n.length+i.length));r.startsWith(i)?(a+=10,s=!0):(r.includes(i.trim())&&i.trim().length>0&&(a+=5),s=!1)}return{score:a,full:(r===void 0||o)&&(i===void 0||s)&&(r!==void 0||i!==void 0)}}function Qr(e,t){if(t===void 0)return 0;let n=Math.abs(e-t);return n>=1024?0:5*(1-n/Jr)}function $r(e,t,n,r,i,a){let o=t[0],s=-1,c=!1,l=!1,u=!1;for(let d of t){let t=Zr(e,d,n,r,i),f=Qr(d,a),p=t.score+f;p>s&&(s=p,o=d,c=t.full,l=t.score>0,u=f>0)}let d,f;return c?(d=`context-disambiguated`,f=`high`):l&&!u?(d=`context-disambiguated`,f=`medium`):l&&u||u?(d=`position-tiebreaker`,f=`medium`):(d=`position-tiebreaker`,f=`low`),{start:o,end:o+n.length,strategy:d,confidence:f}}var ei=[{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`}],ti=new Map(ei.map(e=>[e.code.toLowerCase(),e]));function ni(e){if(e)return ti.get(e.toLowerCase())}function ri(e){if(!e)return;let t=ni(e);return t?`${t.nativeName} (${e.toLowerCase()})`:e}function ii(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 ai(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 oi(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 si(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 ci(e,t,n,r,i){let a=si(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 ii({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 oi({x:e*o,y:t*s},n*Math.min(o,s))}case`polygon`:return ai(a.data.points.map(e=>({x:e.x*o,y:e.y*s})))}return e}var li=64,ui=32;function di(e,t,n){let r={};if(t>0){let n=Math.max(0,t-li),i=0;for(;n>0&&i<ui;){let t=e[n-1];if(!t||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(t))break;n--,i++}r.prefix=e.substring(n,t)}if(n<e.length){let t=Math.min(e.length,n+li),i=0;for(;t<e.length&&i<ui;){let n=e[t];if(!n||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(n))break;t++,i++}r.suffix=e.substring(n,t)}return r}function fi(e){return(e.match(/charset=([^\s;]+)/i)?.[1]||`utf-8`).toLowerCase()}function pi(e,t){let n=fi(t);return new TextDecoder(n).decode(e)}var mi=(e,t)=>({extension:e,label:t,render:`none`,anchoring:`none`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1}),hi=(e,t)=>({...mi(e,t),textSource:`decode`}),gi={"text/markdown":{extension:`.md`,label:`Markdown`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!0},"text/plain":{extension:`.txt`,label:`Plain Text`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!0},"text/html":{extension:`.html`,label:`HTML`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!1},"application/json":{extension:`.json`,label:`JSON`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!1,uploadable:!0,generatable:!1},"image/png":{extension:`.png`,label:`PNG image`,render:`image`,anchoring:`spatial`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1},"image/jpeg":{extension:`.jpg`,label:`JPEG image`,render:`image`,anchoring:`spatial`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1},"application/pdf":{extension:`.pdf`,label:`PDF`,render:`pdf`,anchoring:`spatial`,textSource:`pdf-text-layer`,authorable:!1,uploadable:!0,generatable:!0},"text/css":hi(`.css`,`CSS`),"text/csv":hi(`.csv`,`CSV`),"text/xml":hi(`.xml`,`XML`),"application/xml":hi(`.xml`,`XML`),"application/yaml":hi(`.yaml`,`YAML`),"application/x-yaml":hi(`.yaml`,`YAML`),"text/javascript":hi(`.js`,`JavaScript`),"application/javascript":hi(`.js`,`JavaScript`),"text/x-typescript":hi(`.ts`,`TypeScript`),"application/typescript":hi(`.ts`,`TypeScript`),"text/x-python":hi(`.py`,`Python source`),"text/x-java":hi(`.java`,`Java source`),"text/x-c":hi(`.c`,`C source`),"text/x-c++":hi(`.cpp`,`C++ source`),"text/x-csharp":hi(`.cs`,`C# source`),"text/x-go":hi(`.go`,`Go source`),"text/x-rust":hi(`.rs`,`Rust source`),"text/x-ruby":hi(`.rb`,`Ruby source`),"text/x-php":hi(`.php`,`PHP source`),"text/x-swift":hi(`.swift`,`Swift source`),"text/x-kotlin":hi(`.kt`,`Kotlin source`),"text/x-shell":hi(`.sh`,`Shell script`),"application/msword":mi(`.doc`,`Word document (legacy)`),"application/vnd.openxmlformats-officedocument.wordprocessingml.document":mi(`.docx`,`Word document`),"application/vnd.ms-excel":mi(`.xls`,`Excel spreadsheet (legacy)`),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":mi(`.xlsx`,`Excel spreadsheet`),"application/vnd.ms-powerpoint":mi(`.ppt`,`PowerPoint presentation (legacy)`),"application/vnd.openxmlformats-officedocument.presentationml.presentation":mi(`.pptx`,`PowerPoint presentation`),"application/zip":mi(`.zip`,`ZIP archive`),"application/gzip":mi(`.gz`,`Gzip archive`),"application/x-tar":mi(`.tar`,`TAR archive`),"application/x-7z-compressed":mi(`.7z`,`7z archive`),"application/octet-stream":mi(`.bin`,`Binary`),"application/wasm":mi(`.wasm`,`WebAssembly module`),"image/gif":mi(`.gif`,`GIF image`),"image/webp":mi(`.webp`,`WebP image`),"image/svg+xml":mi(`.svg`,`SVG image`),"image/bmp":mi(`.bmp`,`BMP image`),"image/tiff":mi(`.tiff`,`TIFF image`),"image/x-icon":mi(`.ico`,`Icon`),"video/mp4":mi(`.mp4`,`MP4 video`),"video/mpeg":mi(`.mpeg`,`MPEG video`),"video/webm":mi(`.webm`,`WebM video`),"video/ogg":mi(`.ogv`,`Ogg video`),"video/quicktime":mi(`.mov`,`QuickTime video`),"video/x-msvideo":mi(`.avi`,`AVI video`),"audio/mpeg":mi(`.mp3`,`MP3 audio`),"audio/wav":mi(`.wav`,`WAV audio`),"audio/ogg":mi(`.ogg`,`Ogg audio`),"audio/webm":mi(`.webm`,`WebM audio`),"audio/aac":mi(`.aac`,`AAC audio`),"audio/flac":mi(`.flac`,`FLAC audio`),"font/woff":mi(`.woff`,`WOFF font`),"font/woff2":mi(`.woff2`,`WOFF2 font`),"font/ttf":mi(`.ttf`,`TrueType font`),"font/otf":mi(`.otf`,`OpenType font`)},_i=gi;function vi(e){return e.split(`;`)[0].trim().toLowerCase()}function yi(e){return Object.hasOwn(gi,e)}function bi(e){return _i[vi(e)]}function xi(e){let t=vi(e??`text/plain`);return yi(t)&&bi(t)?.authorable?t:`text/plain`}function Si(e){return bi(e)?.extension??`.dat`}var Ci=(()=>{let e=new Map;for(let t of Object.keys(gi)){let n=gi[t].extension;e.has(n)||e.set(n,t)}return e})(),wi={".markdown":`.md`,".htm":`.html`,".jpeg":`.jpg`,".yml":`.yaml`};function Ti(e){let t=e.trim().toLowerCase(),n=t.startsWith(`.`)?t:`.${t}`;return Ci.get(wi[n]??n)}function Ei(e){let t=bi(e);return t?t.textSource:vi(e).startsWith(`text/`)?`decode`:`none`}var Di=Object.keys(gi),Oi=Di.filter(e=>gi[e].authorable);Di.filter(e=>gi[e].textSource!==`none`);var ki=Di.filter(e=>gi[e].generatable);function Ai(e,t){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}${gi[t].extension}`}function ji(e,t){return`file://${Ai(e,t)}`}function Mi(e){let t=(e??``).replace(/^file:\/\//,``),n=t.lastIndexOf(`/`);return n===-1?``:t.slice(0,n)}function Ni(e,t,n){let r=Ai(t,n);return r===gi[n].extension?``:e?`${e}/${r}`:r}function Pi(e){return typeof e==`string`}function Fi(e){return typeof e==`number`&&!isNaN(e)}function Ii(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Li(e){return Array.isArray(e)}function Ri(e,t,n){let r=new Map(e.nodes.map(e=>[e.id,e])),i=new Map;for(let t of e.edges)t.type===`annotation-of`&&i.set(t.source,t.target);let a=[],o=[],s=new Set;for(let n of e.edges){let e=n.type===`cites`&&n.target===t?i.get(n.source):void 0;if(e!==void 0){if(s.has(e))continue;s.add(e);let t=r.get(e);o.push({resourceId:e,resourceName:t?.label??e})}else if(n.source===t){let e=r.get(n.target);a.push({resourceId:n.target,resourceName:e?.label??n.target,entityTypes:e?.entityTypes??[],bidirectional:n.bidirectional??!1})}}let c=new Set;for(let r of e.nodes)if(r.type===`annotation`&&r.id!==n&&i.get(r.id)===t)for(let e of r.entityTypes??[])c.add(e);return{connections:a,citedBy:o,citedByCount:o.length,siblingEntityTypes:Array.from(c)}}function zi(e){return e/2+e/2*Math.random()}function Bi(e){if(!(e instanceof TypeError))return!1;if(e.message===`fetch failed`)return!0;let t=e.cause?.code;return typeof t==`string`&&t.length>0}var Vi=new Set([429,503,504]);function Hi(e){if(Bi(e))return!0;if(typeof e!=`object`||!e)return!1;if(e.name===`TimeoutError`)return!0;let t=e.status;return typeof t==`number`&&Vi.has(t)}async function Ui(e,t,n,r){let i=n.initialDelayMs;for(let a=1;;a++)try{return await e()}catch(e){if(a>=n.attempts||!t(e))throw e;let o=zi(i);r?.({attempt:a,attempts:n.attempts,delayMs:o,error:e}),await new Promise(e=>setTimeout(e,o)),i=Math.min(i*2,n.maxDelayMs)}}var Wi=`/discovery/kbs.json`,Gi=class extends Error{name=`KyError`;get isKyError(){return!0}},Ki=class extends Gi{name=`HTTPError`;response;request;options;data;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.response=e,this.request=t,this.options=n}},qi=class extends Gi{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},Ji=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}},Yi=class extends Gi{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new Ji(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}},Xi=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},Zi=class extends Gi{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},Qi=(()=>{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})(),$i=typeof globalThis.AbortController==`function`,ea=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,ta=typeof globalThis.ReadableStream==`function`,na=typeof globalThis.FormData==`function`,ra=[`get`,`post`,`put`,`patch`,`head`,`delete`,`query`],ia={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},aa=2147483647,oa=Symbol(`stop`),sa=class{options;constructor(e){this.options=e}},ca=e=>new sa(e),la={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ua={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},da=new TextEncoder,fa=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=da.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?da.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?da.encode(e).byteLength:e instanceof URLSearchParams?da.encode(e.toString()).byteLength:0},pa=(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(){let e=r??new Uint8Array;i+=e.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},e)}}))},ma=(e,t)=>{if(!e.body)return e;let n={status:e.status,statusText:e.statusText,headers:e.headers};if(e.status===204)return new Response(null,n);let r=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(pa(e.body,r,t),n)},ha=(e,t,n)=>{if(!e.body)return e;let r=fa(n??e.body);return new Request(e,{duplex:`half`,body:pa(e.body,r,t)})},ga=e=>typeof e==`object`&&!!e,_a=Symbol(`replaceOption`),va=e=>ga(e)&&e[_a]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},ya=(...e)=>{for(let t of e)if((!ga(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Aa({},...e)},ba=(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},xa=e=>{if(!ga(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Sa=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[Da];return n&&(t[Da]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:xa(e)?{...e}:e},Ca=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),wa=(e,t)=>xa(e)&&xa(t)?Ca({...e,...t}):ba(e,t);function Ta(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Aa(e[n]??[],t[n]??[])}var Ea=(e={},t={})=>({init:Ta(e,t,`init`),beforeRequest:Ta(e,t,`beforeRequest`),beforeRetry:Ta(e,t,`beforeRetry`),beforeError:Ta(e,t,`beforeError`),afterResponse:Ta(e,t,`afterResponse`)}),Da=Symbol(`deletedParameters`),Oa=(e,t)=>{let n=new URLSearchParams,r=new Set;for(let i of[e,t])if(i!==void 0){if(i instanceof URLSearchParams){for(let[e,t]of i.entries())n.append(e,t),r.delete(e);let e=i[Da];if(e)for(let t of e)n.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){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])),r.delete(String(e[0]))}else if(ga(i))for(let[e,t]of Object.entries(i))t===void 0?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{let e=new URLSearchParams(i);for(let[t,i]of e.entries())n.append(t,i),r.delete(t)}}return r.size>0&&(n[Da]=r),n},ka=(e,...t)=>{let n={},r={},i={},a,o=[];for(let s of t)if(Array.isArray(s))Array.isArray(n)||(n=[]),n=[...n,...s];else if(ga(s)){for(let[t,r]of Object.entries(s)){let i=va(r),{isReplace:s}=i;r=i.value;let c=e&&t===`signal`;if(c&&(s||r===void 0)&&(o.length=0),c&&r instanceof globalThis.AbortSignal){o.push(r);continue}if(t===`context`){if(r!=null&&(!ga(r)||Array.isArray(r)))throw TypeError("The `context` option must be an object");n={...n,context:r==null?{}:s?{...r}:{...n.context,...r}};continue}if(t===`searchParams`){a=r==null?void 0:s||a===void 0?r:Oa(a,r);continue}e&&t===`retry`&&ga(r)&&!s&&typeof n[t]==`number`&&(n={...n,[t]:{limit:n[t]}}),ga(r)&&!s&&t in n&&(r=ka(!1,n[t],r)),n={...n,[t]:r}}if(ga(s.hooks)){let{value:e,isReplace:t}=va(s.hooks);i=Ea(t?{}:i,e),n.hooks=i}if(ga(s.headers)){let{value:e,isReplace:t}=va(s.headers);r=t?Sa(e):wa(r,e),n.headers=r}}return a!==void 0&&(n.searchParams=a),o.length>0&&(o.length===1?n.signal=o[0]:ea?n.signal=AbortSignal.any(o):n.signal=o.at(-1)),n},Aa=(...e)=>ka(!0,...e),ja=e=>ra.includes(e)?e.toUpperCase():e,Ma=[`get`,`put`,`head`,`delete`,`options`,`trace`,`query`],Na=[408,413,429,500,502,503,504],Pa=[413,429,503],Fa="`retry.limit` must be a finite, non-negative integer",Ia={limit:2,methods:Ma,statusCodes:Na,afterStatusCodes:Pa,maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},La=()=>({...Ia,methods:[...Ia.methods],statusCodes:[...Ia.statusCodes],afterStatusCodes:[...Ia.afterStatusCodes]}),Ra=e=>{if(e===void 0)return Ia.limit;if(typeof e!=`number`||!Number.isInteger(e)||e<0)throw TypeError(Fa);return e},za=(e={})=>{if(typeof e==`number`)return{...La(),limit:Ra(e)};if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError("`retry` must be a number or an object");let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),n=Ra(t.limit);if(t.methods!==void 0&&!Array.isArray(t.methods))throw Error(`retry.methods must be an array`);if(t.statusCodes!==void 0&&!Array.isArray(t.statusCodes))throw Error(`retry.statusCodes must be an array`);if(t.afterStatusCodes!==void 0&&!Array.isArray(t.afterStatusCodes))throw Error(`retry.afterStatusCodes must be an array`);return t.methods!==void 0&&(t.methods=t.methods.map(e=>e.toLowerCase())),t.statusCodes!==void 0&&(t.statusCodes=[...t.statusCodes]),t.afterStatusCodes!==void 0&&(t.afterStatusCodes=[...t.afterStatusCodes]),{...La(),...t,limit:n}};async function Ba(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new Zi(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Va(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 Ha=e=>{let t={};for(let n in e)Object.hasOwn(e,n)&&!(n in ua)&&!(n in la)&&(t[n]=e[n]);return t},Ua=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[Da]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,Wa=Object.prototype.toString,Ga=e=>Wa.call(e)===`[object Error]`,Ka=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function qa(e){if(!(e&&Ga(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`||t.startsWith(`Load failed (`)&&t.endsWith(`)`)?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Ka.has(t)}var Ja=(e,t)=>e instanceof t||e?.name===t.name;function Ya(e){return Ja(e,Ki)}function Xa(e){return Ja(e,qi)}function Za(e){return Ja(e,Zi)}var Qa=Date.parse(`2024-01-01`),$a=/^\d+$/,eo=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],to=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,no=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,ro=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,io=e=>{let t=e.get(`Retry-After`);if(t!==null)return{value:t,allowTimestamp:!1};let n=e.get(`RateLimit-Reset`);if(n!==null)return{value:n,allowTimestamp:!0};let r=e.get(`X-RateLimit-Retry-After`);if(r!==null)return{value:r,allowTimestamp:!1};let i=e.get(`X-RateLimit-Reset`)??e.get(`X-Rate-Limit-Reset`);if(i!==null)return{value:i,allowTimestamp:!0}},ao=({year:e,month:t,day:n,hours:r,minutes:i,seconds:a})=>{let o=eo.indexOf(t),s=Number(n),c=Number(r),l=Number(i),u=Number(a);if(o===-1||c>23||l>59||u>60)return;let d=Math.min(u,59),f=new Date(Date.UTC(e,o,s,c,l,d));f.setUTCFullYear(e);let p=f.getTime();if(f.getUTCFullYear()===e&&f.getUTCMonth()===o&&f.getUTCDate()===s&&f.getUTCHours()===c&&f.getUTCMinutes()===l&&f.getUTCSeconds()===d)return u===60?p+1e3:p},oo=(e,t)=>e[t],so=e=>{let t=to.exec(e);if(t)return ao({year:Number(oo(t,3)),month:oo(t,2),day:oo(t,1),hours:oo(t,4),minutes:oo(t,5),seconds:oo(t,6)});let n=no.exec(e);if(n){let e=new Date,t=Number(oo(n,3)),r=Math.floor(e.getUTCFullYear()/100)*100+t,i=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),a;for(let e of[r-100,r,r+100]){let t=ao({year:e,month:oo(n,2),day:oo(n,1),hours:oo(n,4),minutes:oo(n,5),seconds:oo(n,6)});t!==void 0&&t<=i&&(a=t)}return a}let r=ro.exec(e);if(r){let[e,t,n]=oo(r,4).split(`:`);return ao({year:Number(oo(r,5)),month:oo(r,2),day:oo(r,3).trim(),hours:e,minutes:t,seconds:n})}},co=({value:e,allowTimestamp:t})=>{if($a.test(e)){let n=Number(e)*1e3;return t&&n>=Qa&&(n-=Date.now()),Math.max(0,n)}let n=so(e);if(n===void 0)return;let r=n-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0},lo=10485760,uo="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",fo=Symbol(`timedOutResponseData`),po=Symbol(`timedOutOperation`),mo=e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder},ho="The `schema` argument must follow the Standard Schema specification",go=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return Array.isArray(t.methods)&&(t.methods=[...t.methods]),Array.isArray(t.statusCodes)&&(t.statusCodes=[...t.statusCodes]),Array.isArray(t.afterStatusCodes)&&(t.afterStatusCodes=[...t.afterStatusCodes]),t},_o=Object.prototype.toString,vo=/^[\0-\u0020]+/g,yo=/[\t\n\r]/g,bo=/^[a-z][\d+.a-z-]*:/i,xo=/^https?:(?!\/\/)/i,So=e=>e instanceof globalThis.Request||_o.call(e)===`[object Request]`,Co=e=>e instanceof globalThis.Response||_o.call(e)===`[object Response]`,wo=e=>bo.test(e),To=e=>e.replaceAll(vo,``).replaceAll(yo,``),Eo=e=>Array.isArray(e)?e.map(e=>[...e]):Sa(e);function Do(e){let t={...e,json:Sa(e.json),context:Sa(e.context),headers:Sa(e.headers),searchParams:Eo(e.searchParams)};return e.retry!==void 0&&(t.retry=go(e.retry)),t}var Oo=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(ho);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(ho);let r=await n.validate(e);if(r.issues)throw new Xi(r.issues);return r.value},ko=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?Do(n):n;for(let e of r)e(i);let a=new e(t,i),o=async()=>{if(typeof a.#a.timeout==`number`&&a.#a.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${aa}`);if(typeof a.#a.totalTimeout==`number`&&a.#a.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${aa}`);await Promise.resolve();let e=await a.#A();e!==void 0&&(a.#r=za(a.#a.retry).limit);let t=e??await a.#M(async()=>a.#F()),n=e!==void 0||a.#P();for(;;){if(t===void 0)return t;if(Co(t))try{t=await a.#j(t)}catch(e){if(!(e instanceof Yi))throw e;let r=await a.#N(e,async()=>a.#F());if(r===void 0)return r;t=r,n=a.#P();continue}let e=t;if(!e.ok&&e.type!==`opaque`&&(typeof a.#a.throwHttpErrors==`function`?a.#a.throwHttpErrors(e.status):a.#a.throwHttpErrors)){let r=new Ki(e,a.#B(e),a.#R()),i=r;if(r.data=await a.#_(e),n)throw i;let o=await a.#N(r,async()=>a.#F());if(o===void 0)return o;t=o,n=a.#P();continue}break}if(!Co(t))return t;if(a.#h(t),a.#a.onDownloadProgress){if(typeof a.#a.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!ta)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#E(t),ma(e,a.#a.onDownloadProgress)}return t},s=(async()=>{try{return await o()}catch(e){await a.#g(e)}finally{let e=a.#o;a.#T(e?.body??void 0),a.request!==e&&a.#T(a.request.body??void 0)}})();for(let[e,t]of Object.entries(ia))(e!==`bytes`||typeof globalThis.Response?.prototype?.bytes==`function`)&&(s[e]=async n=>{a.request.headers.set(`accept`,a.request.headers.get(`accept`)||t);let r=await s;if(e!==`json`)return a.#b(async()=>r[e](),r);let o=await a.#b(async()=>r.text(),r),c=a.#B(r),l=await a.#x(async()=>{let e=i.parseJson?await i.parseJson(o,{request:c,response:r}):o===``&&n!==void 0?void 0:JSON.parse(o);return n===void 0?e:Oo(e,n)});return l===po&&await a.#g(new Zi(c)),l});return s}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;#c=new WeakSet;#l;#u;#d=!1;#f=new WeakMap;constructor(t,n={}){if(this.#i=t,Object.hasOwn(n,`prefixUrl`))throw Error(uo);if(this.#a={...n,headers:ba(this.#i.headers,n.headers),hooks:Ea({},n.hooks),method:ja(n.method??this.#i.method??`GET`),prefix:String(n.prefix||``),retry:za(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},this.#r=this.#a.retry.limit,typeof this.#i!=`string`&&!(this.#i instanceof URL||this.#i instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#i==`string`){if(this.#a.prefix){let e=this.#a.prefix.replace(/\/+$/,``),t=this.#i.replace(/^\/+/,``);this.#i=`${e}/${t}`}if(this.#a.baseUrl){let e=To(this.#i);if(xo.test(e))throw TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");wo(e)||(this.#i=new URL(this.#i,new Request(this.#a.baseUrl).url))}}$i&&ea&&(this.#s=this.#a.signal??this.#i.signal,this.#t=new globalThis.AbortController,this.#a.signal=this.#O()),Qi&&(this.#a.duplex=`half`),this.#a.json!==void 0&&(this.#a.body=this.#a.stringifyJson?.(this.#a.json)??JSON.stringify(this.#a.json),this.#a.headers.set(`content-type`,this.#a.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#i instanceof globalThis.Request&&(na&&this.#a.body instanceof globalThis.FormData||this.#a.body instanceof URLSearchParams)&&!r&&this.#a.headers.delete(`content-type`),this.request=new globalThis.Request(this.#i,this.#a),Ua(this.#a.searchParams)){let t=new URL(this.request.url),n=this.#a.searchParams?.[Da];if(n)for(let e of n)t.searchParams.delete(e);if(typeof this.#a.searchParams==`string`){let e=this.#a.searchParams.replace(/^\?/,``);e!==``&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{let n=new URLSearchParams(e.#e(this.#a.searchParams));for(let[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#a.searchParams&&typeof this.#a.searchParams==`object`&&!Array.isArray(this.#a.searchParams)&&!(this.#a.searchParams instanceof URLSearchParams))for(let[e,n]of Object.entries(this.#a.searchParams))n===void 0&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#a)}if(this.#a.onUploadProgress&&typeof this.#a.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");this.#u=typeof this.#a.totalTimeout==`number`?this.#L():void 0}#p(e){let t=e.delay(this.#n+1),n=t;return e.jitter===!0?n=Math.random()*t:typeof e.jitter==`function`&&(n=e.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(e.backoffLimit,n)}async#m(e){let t=za(this.#a.retry);if(this.#n>=Math.min(t.limit,this.#r))throw e;let n=e instanceof Error?e:new Ji(e);if(n instanceof Yi)return n.customDelay??this.#p(t);if(!t.methods.includes(this.request.method.toLowerCase()))throw e;let{shouldRetry:r}=t;if(r!==void 0){let i=await this.#x(async()=>r({error:n,retryCount:this.#n+1}));if(i===po)throw new Zi(this.request);if(i===!1)throw e;if(i===!0)return this.#p(t)}if(Za(e)){if(!t.retryOnTimeout)throw e;return this.#p(t)}if(Ya(e)){if(!t.statusCodes.includes(e.response.status))throw e;let n=io(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){let e=co(n);return e===void 0?this.#p(t):Math.min(t.maxRetryAfter,e)}if(e.response.status===413)throw e;return this.#p(t)}if(!Xa(e))throw e;return this.#p(t)}#h(e){let t=this.#B(e);return this.#a.parseJson&&(e.json=async()=>{let n=await e.text();return this.#a.parseJson(n,{request:t,response:e})}),e}async#g(e){if(!(e instanceof Error)||this.#c.has(e))throw e;let t=e;for(let e of this.#a.hooks.beforeError){let n=await e({request:this.request,options:this.#R(),error:t,retryCount:this.#n});n instanceof Error&&(t=n)}throw t}async#_(e){let t=this.#v(),n=await this.#C(e,t.milliseconds);if(n===fo){if(t.fromTotalTimeout)throw new Zi(this.request);this.#k();return}if(!n)return;if(!this.#S(e.headers.get(`content-type`)??``))return n;let r=this.#v(),i=await this.#w(n,e,r.milliseconds,this.#B(e));if(i===fo){if(r.fromTotalTimeout)throw new Zi(this.request);this.#k();return}return i}#v(){let e=this.#a.timeout===!1?1e4:this.#a.timeout,t=this.#I();if(t===void 0)return{milliseconds:e,fromTotalTimeout:!1};if(t<=0)throw new Zi(this.request);return{milliseconds:Math.min(e,t),fromTotalTimeout:t<=e}}#y(){let e=this.#I();if(e!==void 0){if(e<=0)throw new Zi(this.request);return this.#a.timeout===!1?e:Math.min(this.#a.timeout,e)}return this.#a.timeout===!1?void 0:this.#a.timeout}async#b(e,t){let n;try{n=this.#y()}catch(e){await this.#g(e)}let r=e();if(n===void 0)return r;let i=await Promise.race([r,new Promise(e=>{let t=setTimeout(()=>{e(fo)},n);r.finally(()=>{clearTimeout(t)}).catch(()=>void 0)})]);return i===fo&&(this.#t?.abort(),await this.#g(new Zi(this.#B(t)))),i}async#x(e){let t=this.#I();if(t===void 0)return e();if(t<=0)return this.#t?.abort(),po;let n;try{let r=new Promise(e=>{n=setTimeout(()=>{e(po)},t)}),i=Promise.resolve().then(e).then(e=>({status:`fulfilled`,value:e})).catch(e=>({status:`rejected`,error:e})),a=await Promise.race([i,r]),o=this.#I();if(a===po||o!==void 0&&o<=0)return this.#t?.abort(),a===po?i.then(e=>{e.status===`fulfilled`&&this.#D(e.value)}):a.status===`fulfilled`&&this.#D(a.value),po;if(a.status===`rejected`)throw a.error;return a.value}finally{clearTimeout(n)}}#S(e){let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#C(e,t){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}let i=mo(e.headers.get(`content-type`)??``),a=[],o=0,s=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if(o+=t.byteLength,o>lo){r.cancel().catch(()=>void 0);return}a.push(i.decode(t,{stream:!0}))}}catch{return}return a.push(i.decode()),a.join(``)})(),c=new Promise(e=>{let n=setTimeout(()=>{e(fo)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===fo&&r.cancel().catch(()=>void 0),l}async#w(e,t,n,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#a.parseJson?this.#a.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e(fo)},n)})])}catch{return}finally{clearTimeout(i)}}#T(e){e&&e.cancel().catch(()=>void 0)}#E(e){this.#T(e.body??void 0)}#D(e){Co(e)?this.#E(e):So(e)&&this.#T(e.body??void 0)}#O(){return this.#s?AbortSignal.any([this.#s,this.#t.signal]):this.#t.signal}#k(){let e=this.#I();if(e!==void 0&&e<=0)throw new Zi(this.request)}async#A(){for(let e of this.#a.hooks.beforeRequest){let t=await this.#x(async()=>e({request:this.request,options:this.#R(),retryCount:0}));if(t===po)throw new Zi(this.request);if(So(t))this.#z(t);else if(Co(t))return t}}async#j(e){let t=this.#B(e);for(let n of this.#a.hooks.afterResponse){let r=this.#V(e.clone(),t);this.#h(r);let i;try{if(i=await this.#x(async()=>n({request:this.request,options:this.#R(),response:r,retryCount:this.#n})),i===po)throw new Zi(this.request)}catch(t){throw r!==e&&this.#E(r),this.#E(e),t}if(i instanceof sa)throw r!==e&&this.#E(r),this.#E(e),new Yi(i.options);let a=Co(i)?this.#V(i,t):e;r!==e&&r!==a&&r.body!==a.body&&this.#E(r),e!==a&&e.body!==a.body&&this.#E(e),e=a}return e}async#M(e){try{return await e()}catch(t){return this.#N(t,e)}}async#N(e,t){this.#d=!1;let n=Math.min(await this.#m(e),aa),r={signal:this.#s},i=this.#I();if(i!==void 0){if(i<=0)throw new Zi(this.request);if(n>=i)throw await Va(i,r),new Zi(this.request)}if(await Va(n,r),this.#k(),e instanceof Yi&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#a.signal?{signal:this.#a.signal}:void 0);this.#z(t)}for(let t of this.#a.hooks.beforeRetry){let n;try{n=await this.#x(async()=>t({request:this.request,options:this.#R(),error:e,retryCount:this.#n+1}))}catch(t){throw t instanceof Error&&t!==e&&this.#c.add(t),t}if(n===po)throw new Zi(this.request);if(So(n)){this.#z(n);break}if(Co(n))return this.#d=!0,this.#n++,n;if(n===oa)return}return this.#k(),this.#n++,this.#M(t)}#P(){let e=this.#d;return this.#d=!1,e}async#F(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#a.signal=this.#O(),this.request=new globalThis.Request(this.request,{signal:this.#a.signal}));let e=Ha(this.#a);this.#r=za(this.#a.retry).limit;let t=this.#r>0?this.request.clone():void 0,n=this.#H(this.request,this.#a.body??void 0);this.#o=n,t&&(this.request=t);try{let t=this.#I();if(t!==void 0&&t<=0)throw new Zi(this.request);let r=this.#a.timeout===!1?t:t===void 0?this.#a.timeout:Math.min(this.#a.timeout,t),i=r===void 0?await this.#a.fetch(n,e):await Ba(n,e,this.#t,{timeout:r,fetch:this.#a.fetch});return this.#V(i,n)}catch(e){throw qa(e)?new qi(this.request,{cause:e}):e}}#I(){if(this.#u===void 0)return;let e=this.#L()-this.#u;return Math.max(0,this.#a.totalTimeout-e)}#L(){return globalThis.performance?.now()??Date.now()}#R(){if(!this.#l){let{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:i,timeout:a,totalTimeout:o,throwHttpErrors:s,fetch:c,...l}=this.#a;this.#l=Object.freeze(l)}return this.#l}#z(e){this.#l=void 0,this.request=e}#B(e){return this.#f.get(e)??this.request}#V(e,t){return this.#f.set(e,t),e}#H(e,t){return!this.#a.onUploadProgress||!e.body||!Qi?e:ha(e,this.#a.onUploadProgress,t??this.#a.body??void 0)}},Ao=e=>{let t=(t,n)=>ko.create(t,ya(e,n));for(let n of ra)t[n]=(t,r)=>ko.create(t,ya(e,r,{method:n}));return t.create=e=>Ao(ya(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),Ao(ya(e,t))),t.stop=oa,t.retry=ca,t},jo=Ao(),Mo=`1.9.1`,No=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Po(e){let t=new Set([e]),n=new Set,r=e.match(No);if(!r)return()=>!1;let 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;let r=e.match(No);if(!r)return a(e);let 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 Fo=Po(Mo),Io=Mo.split(`.`)[0],Lo=Symbol.for(`opentelemetry.js.api.${Io}`),Ro=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function zo(e,t,n,r=!1){let i=Ro[Lo]=Ro[Lo]??{version:Mo};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Mo}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Mo}.`),!0}function Bo(e){let t=Ro[Lo]?.version;if(!(!t||!Fo(t)))return Ro[Lo]?.[e]}function Vo(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Mo}.`);let n=Ro[Lo];n&&delete n[e]}var Ho=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Uo(`debug`,this._namespace,e)}error(...e){return Uo(`error`,this._namespace,e)}info(...e){return Uo(`info`,this._namespace,e)}warn(...e){return Uo(`warn`,this._namespace,e)}verbose(...e){return Uo(`verbose`,this._namespace,e)}};function Uo(e,t,n){let r=Bo(`diag`);if(r)return r[e](t,...n)}var Wo;(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`})(Wo||={});function Go(e,t){e<Wo.NONE?e=Wo.NONE:e>Wo.ALL&&(e=Wo.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Wo.ERROR),warn:n(`warn`,Wo.WARN),info:n(`info`,Wo.INFO),debug:n(`debug`,Wo.DEBUG),verbose:n(`verbose`,Wo.VERBOSE)}}var Ko=`diag`,qo=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Bo(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:Wo.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=Bo(`diag`),i=Go(n.logLevel??Wo.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return zo(`diag`,i,t,!0)},t.disable=()=>{Vo(Ko,t)},t.createComponentLogger=e=>new Ho(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},Jo=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},Yo=Symbol(`BaggageEntryMetadata`),Xo=qo.instance();function Zo(e={}){return new Jo(new Map(Object.entries(e)))}function Qo(e){return typeof e!=`string`&&(Xo.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:Yo,toString(){return e}}}function $o(e){return Symbol.for(e)}var es=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},ts=class{constructor(){}createGauge(e,t){return ps}createHistogram(e,t){return ms}createCounter(e,t){return fs}createUpDownCounter(e,t){return hs}createObservableGauge(e,t){return _s}createObservableCounter(e,t){return gs}createObservableUpDownCounter(e,t){return vs}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ns=class{},rs=class extends ns{add(e,t){}},is=class extends ns{add(e,t){}},as=class extends ns{record(e,t){}},os=class extends ns{record(e,t){}},ss=class{addCallback(e){}removeCallback(e){}},cs=class extends ss{},ls=class extends ss{},us=class extends ss{},ds=new ts,fs=new rs,ps=new as,ms=new os,hs=new is,gs=new cs,_s=new ls,vs=new us;function ys(){return ds}var bs={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},xs={set(e,t,n){e!=null&&(e[t]=n)}},Ss=class{active(){return es}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},Cs=`context`,ws=new Ss,Ts=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return zo(Cs,e,qo.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Bo(Cs)||ws}disable(){this._getContextManager().disable(),Vo(Cs,qo.instance())}},Es;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Es||={});var Ds={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Es.NONE},Os=class{constructor(e=Ds){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ks=$o(`OpenTelemetry Context Key SPAN`);function As(e){return e.getValue(ks)||void 0}function js(){return As(Ts.getInstance().active())}function Ms(e,t){return e.setValue(ks,t)}function Ns(e){return e.deleteValue(ks)}function Ps(e,t){return Ms(e,new Os(t))}function Fs(e){return As(e)?.spanContext()}var Is=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ls(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Is[e.charCodeAt(t)]|0)+(Is[e.charCodeAt(t+1)]|0)+(Is[e.charCodeAt(t+2)]|0)+(Is[e.charCodeAt(t+3)]|0);return n===t}function Rs(e){return Ls(e,32)&&e!==`00000000000000000000000000000000`}function zs(e){return Ls(e,16)&&e!==`0000000000000000`}function Bs(e){return Rs(e.traceId)&&zs(e.spanId)}function Vs(e){return new Os(e)}var Hs=Ts.getInstance(),Us=class{startSpan(e,t,n=Hs.active()){if(t?.root)return new Os;let r=n&&Fs(n);return Ws(r)&&Bs(r)?new Os(r):new Os}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??Hs.active(),c=this.startSpan(e,i,s),l=Ms(s,c);return Hs.with(l,o,void 0,c)}};function Ws(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Gs=new Us,Ks=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Gs}},qs=new class{getTracer(e,t,n){return new Us}},Js=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Ks(this,e,t,n)}getDelegate(){return this._delegate??qs}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},Ys;(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`})(Ys||={});var Xs;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Xs||={});var Zs=Ts.getInstance(),Qs=new class{getMeter(e,t,n){return ds}},$s=`metrics`,ec=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return zo($s,e,qo.instance())}getMeterProvider(){return Bo($s)||Qs}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){Vo($s,qo.instance())}}.getInstance(),tc=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},nc=$o(`OpenTelemetry Baggage Key`);function rc(e){return e.getValue(nc)||void 0}function ic(){return rc(Ts.getInstance().active())}function ac(e,t){return e.setValue(nc,t)}function oc(e){return e.deleteValue(nc)}var sc=`propagation`,cc=new tc,lc=class e{constructor(){this.createBaggage=Zo,this.getBaggage=rc,this.getActiveBaggage=ic,this.setBaggage=ac,this.deleteBaggage=oc}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return zo(sc,e,qo.instance())}inject(e,t,n=xs){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=bs){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Vo(sc,qo.instance())}_getGlobalPropagator(){return Bo(sc)||cc}}.getInstance(),uc=`trace`,dc=class e{constructor(){this._proxyTracerProvider=new Js,this.wrapSpanContext=Vs,this.isSpanContextValid=Bs,this.deleteSpan=Ns,this.getSpan=As,this.getActiveSpan=js,this.getSpanContext=Fs,this.setSpan=Ms,this.setSpanContext=Ps}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=zo(uc,this._proxyTracerProvider,qo.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Bo(uc)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Vo(uc,qo.instance()),this._proxyTracerProvider=new Js}}.getInstance();tr(()=>{let e=dc.getActiveSpan();if(!e)return;let t=e.spanContext();if(Bs(t))return t.traceId});var fc=`semiont`,pc=()=>dc.getTracer(fc);async function mc(e,t,n){let r=pc().startSpan(e,{kind:n?.kind??Ys.INTERNAL,...n?.attrs?{attributes:n.attrs}:{}});try{return await Zs.with(dc.setSpan(Zs.active(),r),()=>t(r))}catch(e){throw r.recordException(e),r.setStatus({code:Xs.ERROR,message:e instanceof Error?e.message:String(e)}),e}finally{r.end()}}var hc=`_trace`;function gc(){let e={};lc.inject(Zs.active(),e);let t=e.traceparent;if(t)return e.tracestate?{traceparent:t,tracestate:e.tracestate}:{traceparent:t}}function _c(e){let t=e[hc];if(t!==void 0&&delete e[hc],!(!t||typeof t.traceparent!=`string`))return t}function vc(e,t){if(!e)return t();let n={traceparent:e.traceparent};e.tracestate&&(n.tracestate=e.tracestate);let r=lc.extract(Zs.active(),n);return Zs.with(r,t)}var yc=`semiont`,bc=()=>ec.getMeter(yc),xc;function Sc(){return xc||=bc().createCounter(`semiont.bus.emit`,{description:`Bus emits by channel and scope`}),xc}function Cc(e,t){Sc().add(1,{"bus.channel":e,...t?{"bus.scope":t}:{}})}var wc=class extends Gr{status;constructor(e){super(`SSE connect failed: ${e}`,`SSE_CONNECT_FAILED`,{status:e}),this.name=`SseConnectError`,this.status=e}};function Tc(e){return e===400?`bad-request`:e===401?`unauthorized`:e===403?`forbidden`:e===404?`not-found`:e===409?`conflict`:e>=500?`unavailable`:`error`}var Ec=class extends Gr{status;statusText;constructor(e,t,n,r){super(e,Tc(t),{status:t,statusText:n,body:r}),this.name=`APIError`,this.status=t,this.statusText=n}};new Ec(``,0,``);var Dc=3e3,Oc=6e4,kc=3e4,Ac={attempts:4,initialDelayMs:1e3,maxDelayMs:4e3},jc=1e3,Mc={initial:[`connecting`,`unauthenticated`,`closed`],connecting:[`open`,`reconnecting`,`unauthenticated`,`closed`],open:[`reconnecting`,`closed`],reconnecting:[`connecting`,`degraded`,`unauthenticated`,`closed`],degraded:[`connecting`,`reconnecting`,`unauthenticated`,`closed`],unauthenticated:[`connecting`,`closed`],closed:[]};function Nc(e){let{baseUrl:t,token:n,channels:r,reconnectMs:i=5e3,lazyRemoveMs:a=5e3,tokenRefresher:o}=e,s=typeof n==`function`?n:()=>n,c=new Set(r),l=new Map,u=new Map(Object.entries(e.loadLastEventIds?.()??{})),d=new Set,f=hr(),p=new St,m=new wt(`initial`),h=new St,g=`initial`,_=null,v=e=>{if(g===e)return;if(!Mc[g].includes(e)){console.warn(`[actor] ignoring invalid connection state transition: ${g} \u2192 ${e}`);return}let t=g;g=e,e===`reconnecting`&&t!==`reconnecting`&&(_&&clearTimeout(_),_=setTimeout(()=>{g===`reconnecting`&&v(`degraded`)},Dc)),t===`reconnecting`&&e!==`reconnecting`&&(_&&=(clearTimeout(_),null)),m.next(e)},y=!1,b=new Set,x=null,S=new WeakSet,C=new Set,w=new Set,T=e=>{if(w.add(e),w.size>512){let e=w.values().next().value;e!==void 0&&w.delete(e)}},E=e=>{w.delete(e)},D=p.pipe(Fn()),O=()=>{for(let e of b)try{e.abort()}catch{}b.clear(),x&&=(clearTimeout(x),null);for(let e of C)clearTimeout(e);C.clear()},k=0,A=null,j=!1,M=(e,t=!1)=>{y&&(x&&clearTimeout(x),x=setTimeout(()=>{y&&N(t)},e))},ee=()=>{let e=Math.min(i*2**k,Oc);return k++,e/2+e/2*Math.random()},N=async(n=!1)=>{let r=s();if(!r||r===A){y&&(g!==`unauthenticated`&&v(`unauthenticated`),M(i,n));return}A=null,v(`connecting`);let a=[...b];if(!n){for(let e of a)try{e.abort()}catch{}b.clear()}let m=JSON.stringify({global:[...c],scoped:[...l.entries()].map(([e,t])=>{let n=u.get(e);return{scope:e,channels:[...t],...n===void 0?{}:{lastEventId:n}}}),...d.size>0?{pendingReplies:[...d]}:{},clientId:f}),_=`${t}/bus/subscribe`,x=new AbortController;b.add(x);try{let t={Authorization:`Bearer ${r}`,"Content-Type":`application/json`},i=await fetch(_,{method:`POST`,headers:t,body:m,signal:x.signal});if(!i.ok||!i.body)throw new wc(i.status);if(!y)return;if(n){for(let e of a)S.add(e);let e=setTimeout(()=>{C.delete(e);for(let e of a){try{e.abort()}catch{}b.delete(e)}},jc);C.add(e)}v(`open`),k=0,j=!1;let o=i.body.getReader(),s=new TextDecoder,c=[],l=``,d=``,f;for(;y&&b.has(x);){let{done:t,value:n}=await o.read();if(t)break;let r=s.decode(n,{stream:!0}),i=0;for(;i<=r.length;){let t=r.indexOf(`
6
+ `);return{text:r,items:n}}function Ir(e,t){let n=e.items.filter(e=>e.page===t.page&&zr(e,t)).sort((e,t)=>e.start-t.start);if(n.length===0)return``;let r=Lr(e,n[0]);for(let t=1;t<n.length;t++){let i=e.text.slice(n[t-1].end,n[t].start);r+=(i.trim()===``?i:` `)+Lr(e,n[t])}return r.trim()}var Lr=(e,t)=>e.text.slice(t.start,t.end),Rr=.5;function zr(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n<=0||r<=0?!1:n*r>=Rr*e.width*e.height}function Br(e){if(e)return e[`@id`]||void 0}function Vr(e){if(e?.representations)return(Array.isArray(e.representations)?e.representations:[e.representations])[0]}function Hr(e){return Vr(e)?.mediaType}function Ur(e){return Vr(e)?.language}function Wr(e){return Vr(e)?.storageUri}var Gr=class extends Error{constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`SemiontError`,Error.captureStackTrace(this,this.constructor)}code;details},Kr=class extends Gr{constructor(e,t,n){super(e,t,n),this.name=`BusRequestError`}};async function qr(e,t,n,r=3e4){let i=hr(),a={...n,correlationId:i},{result:o,failure:s}=Jn[t];if(e.isSubscribed){for(let n of[o,s])if(!e.isSubscribed(n))throw new Kr(`Transport is not subscribed to reply channel ${n} \u2014 a reply to ${t} can never arrive. Add this operation's reply channels to the transport's channel set.`,`bus.unsubscribed`,{channel:t,resultChannel:o,failureChannel:s})}let c=gn(Dn(e.stream(o).pipe(On(e=>e.correlationId===i),xn(e=>({ok:!0,response:e.response}))),e.stream(s).pipe(On(e=>e.correlationId===i),xn(e=>({ok:!1,error:new Kr(e.message??`Bus request rejected`,`bus.rejected`,{channel:s,correlationId:i,payload:e})})))).pipe(Mn(1),yn(r),kn(e=>e instanceof vn?pn(()=>new Kr(`Bus request timed out after ${r}ms on ${o}`,`bus.timeout`,{channel:t,resultChannel:o,correlationId:i,timeoutMs:r})):pn(()=>e)),jn({ok:!1,error:new Kr(`Bus closed before a reply on ${o}`,`bus.closed`,{channel:t,resultChannel:o,correlationId:i})}))),l=()=>(c.catch(()=>{}),new Kr(`Bus closed before emit on ${t}`,`bus.closed`,{channel:t,correlationId:i})),u;if(e.state$.subscribe(e=>{u=e}).unsubscribe(),u===`closed`)throw l();let d=u===`open`;if(!d){let t=gn(e.state$.pipe(On(e=>e===`open`||e===`closed`),Mn(1),jn(`closed`))),n=await Promise.race([t,c.then(()=>`settled`,()=>`settled`)]);if(n===`closed`)throw l();d=n===`open`}let f;if(d){f=e.trackReply?.(i);try{await e.emit(t,a)}catch(e){throw f?.(),f=void 0,c.catch(()=>{}),e}}try{let e=await c;if(!e.ok)throw e.error;return e.response}finally{f?.()}}var Jr=1024;function Yr(e,t){let{position:n,quote:r}=t;if(!r||!r.exact)return!n||n.start<0||n.end>e.length||n.start>=n.end?null:{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`};let{exact:i,prefix:a,suffix:o}=r;if(n){let t=n.start+i.length;if(n.start>=0&&t<=e.length&&e.substring(n.start,t)===i)return{start:n.start,end:t,strategy:`fast-path`,confidence:`high`}}let s=Xr(e,i);if(s.length===1){let e=s[0];return{start:e,end:e+i.length,strategy:`unique-occurrence`,confidence:`high`}}return s.length>1?$r(e,s,i,a,o,n?.start):n&&n.start>=0&&n.end<=e.length&&n.start<n.end?{start:n.start,end:n.end,strategy:`position-fallback`,confidence:`low`}:null}function Xr(e,t){let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Zr(e,t,n,r,i){let a=0,o=!0,s=!0;if(r){let n=e.substring(Math.max(0,t-r.length),t);n.endsWith(r)?(a+=10,o=!0):(n.includes(r.trim())&&r.trim().length>0&&(a+=5),o=!1)}if(i){let r=e.substring(t+n.length,Math.min(e.length,t+n.length+i.length));r.startsWith(i)?(a+=10,s=!0):(r.includes(i.trim())&&i.trim().length>0&&(a+=5),s=!1)}return{score:a,full:(r===void 0||o)&&(i===void 0||s)&&(r!==void 0||i!==void 0)}}function Qr(e,t){if(t===void 0)return 0;let n=Math.abs(e-t);return n>=1024?0:5*(1-n/Jr)}function $r(e,t,n,r,i,a){let o=t[0],s=-1,c=!1,l=!1,u=!1;for(let d of t){let t=Zr(e,d,n,r,i),f=Qr(d,a),p=t.score+f;p>s&&(s=p,o=d,c=t.full,l=t.score>0,u=f>0)}let d,f;return c?(d=`context-disambiguated`,f=`high`):l&&!u?(d=`context-disambiguated`,f=`medium`):l&&u||u?(d=`position-tiebreaker`,f=`medium`):(d=`position-tiebreaker`,f=`low`),{start:o,end:o+n.length,strategy:d,confidence:f}}var ei=[{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`}],ti=new Map(ei.map(e=>[e.code.toLowerCase(),e]));function ni(e){if(e)return ti.get(e.toLowerCase())}function ri(e){if(!e)return;let t=ni(e);return t?`${t.nativeName} (${e.toLowerCase()})`:e}function ii(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 ai(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 oi(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 si(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 ci(e,t,n,r,i){let a=si(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 ii({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 oi({x:e*o,y:t*s},n*Math.min(o,s))}case`polygon`:return ai(a.data.points.map(e=>({x:e.x*o,y:e.y*s})))}return e}var li=64,ui=32;function di(e,t,n){let r={};if(t>0){let n=Math.max(0,t-li),i=0;for(;n>0&&i<ui;){let t=e[n-1];if(!t||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(t))break;n--,i++}r.prefix=e.substring(n,t)}if(n<e.length){let t=Math.min(e.length,n+li),i=0;for(;t<e.length&&i<ui;){let n=e[t];if(!n||/[\s.,;:!?'"()\[\]{}<>\/\\]/.test(n))break;t++,i++}r.suffix=e.substring(n,t)}return r}function fi(e){return(e.match(/charset=([^\s;]+)/i)?.[1]||`utf-8`).toLowerCase()}function pi(e,t){let n=fi(t);return new TextDecoder(n).decode(e)}var mi=(e,t)=>({extension:e,label:t,render:`none`,anchoring:`none`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1}),hi=(e,t)=>({...mi(e,t),textSource:`decode`}),gi={"text/markdown":{extension:`.md`,label:`Markdown`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!0},"text/plain":{extension:`.txt`,label:`Plain Text`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!0},"text/html":{extension:`.html`,label:`HTML`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!0,uploadable:!0,generatable:!1},"application/json":{extension:`.json`,label:`JSON`,render:`text`,anchoring:`text-selector`,textSource:`decode`,authorable:!1,uploadable:!0,generatable:!1},"image/png":{extension:`.png`,label:`PNG image`,render:`image`,anchoring:`spatial`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1},"image/jpeg":{extension:`.jpg`,label:`JPEG image`,render:`image`,anchoring:`spatial`,textSource:`none`,authorable:!1,uploadable:!0,generatable:!1},"application/pdf":{extension:`.pdf`,label:`PDF`,render:`pdf`,anchoring:`spatial`,textSource:`pdf-text-layer`,authorable:!1,uploadable:!0,generatable:!0},"text/css":hi(`.css`,`CSS`),"text/csv":hi(`.csv`,`CSV`),"text/xml":hi(`.xml`,`XML`),"application/xml":hi(`.xml`,`XML`),"application/yaml":hi(`.yaml`,`YAML`),"application/x-yaml":hi(`.yaml`,`YAML`),"text/javascript":hi(`.js`,`JavaScript`),"application/javascript":hi(`.js`,`JavaScript`),"text/x-typescript":hi(`.ts`,`TypeScript`),"application/typescript":hi(`.ts`,`TypeScript`),"text/x-python":hi(`.py`,`Python source`),"text/x-java":hi(`.java`,`Java source`),"text/x-c":hi(`.c`,`C source`),"text/x-c++":hi(`.cpp`,`C++ source`),"text/x-csharp":hi(`.cs`,`C# source`),"text/x-go":hi(`.go`,`Go source`),"text/x-rust":hi(`.rs`,`Rust source`),"text/x-ruby":hi(`.rb`,`Ruby source`),"text/x-php":hi(`.php`,`PHP source`),"text/x-swift":hi(`.swift`,`Swift source`),"text/x-kotlin":hi(`.kt`,`Kotlin source`),"text/x-shell":hi(`.sh`,`Shell script`),"application/msword":mi(`.doc`,`Word document (legacy)`),"application/vnd.openxmlformats-officedocument.wordprocessingml.document":mi(`.docx`,`Word document`),"application/vnd.ms-excel":mi(`.xls`,`Excel spreadsheet (legacy)`),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":mi(`.xlsx`,`Excel spreadsheet`),"application/vnd.ms-powerpoint":mi(`.ppt`,`PowerPoint presentation (legacy)`),"application/vnd.openxmlformats-officedocument.presentationml.presentation":mi(`.pptx`,`PowerPoint presentation`),"application/zip":mi(`.zip`,`ZIP archive`),"application/gzip":mi(`.gz`,`Gzip archive`),"application/x-tar":mi(`.tar`,`TAR archive`),"application/x-7z-compressed":mi(`.7z`,`7z archive`),"application/octet-stream":mi(`.bin`,`Binary`),"application/wasm":mi(`.wasm`,`WebAssembly module`),"image/gif":mi(`.gif`,`GIF image`),"image/webp":mi(`.webp`,`WebP image`),"image/svg+xml":mi(`.svg`,`SVG image`),"image/bmp":mi(`.bmp`,`BMP image`),"image/tiff":mi(`.tiff`,`TIFF image`),"image/x-icon":mi(`.ico`,`Icon`),"video/mp4":mi(`.mp4`,`MP4 video`),"video/mpeg":mi(`.mpeg`,`MPEG video`),"video/webm":mi(`.webm`,`WebM video`),"video/ogg":mi(`.ogv`,`Ogg video`),"video/quicktime":mi(`.mov`,`QuickTime video`),"video/x-msvideo":mi(`.avi`,`AVI video`),"audio/mpeg":mi(`.mp3`,`MP3 audio`),"audio/wav":mi(`.wav`,`WAV audio`),"audio/ogg":mi(`.ogg`,`Ogg audio`),"audio/webm":mi(`.webm`,`WebM audio`),"audio/aac":mi(`.aac`,`AAC audio`),"audio/flac":mi(`.flac`,`FLAC audio`),"font/woff":mi(`.woff`,`WOFF font`),"font/woff2":mi(`.woff2`,`WOFF2 font`),"font/ttf":mi(`.ttf`,`TrueType font`),"font/otf":mi(`.otf`,`OpenType font`)},_i=gi;function vi(e){return e.split(`;`)[0].trim().toLowerCase()}function yi(e){return Object.hasOwn(gi,e)}function bi(e){return _i[vi(e)]}function xi(e){let t=vi(e??`text/plain`);return yi(t)&&bi(t)?.authorable?t:`text/plain`}function Si(e){return bi(e)?.extension??`.dat`}var Ci=(()=>{let e=new Map;for(let t of Object.keys(gi)){let n=gi[t].extension;e.has(n)||e.set(n,t)}return e})(),wi={".markdown":`.md`,".htm":`.html`,".jpeg":`.jpg`,".yml":`.yaml`};function Ti(e){let t=e.trim().toLowerCase(),n=t.startsWith(`.`)?t:`.${t}`;return Ci.get(wi[n]??n)}function Ei(e){let t=bi(e);return t?t.textSource:vi(e).startsWith(`text/`)?`decode`:`none`}var Di=Object.keys(gi),Oi=Di.filter(e=>gi[e].authorable);Di.filter(e=>gi[e].textSource!==`none`);var ki=Di.filter(e=>gi[e].generatable);function Ai(e,t){return`${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}${gi[t].extension}`}function ji(e,t){return`file://${Ai(e,t)}`}function Mi(e){let t=(e??``).replace(/^file:\/\//,``),n=t.lastIndexOf(`/`);return n===-1?``:t.slice(0,n)}function Ni(e,t,n){let r=Ai(t,n);return r===gi[n].extension?``:e?`${e}/${r}`:r}function Pi(e){return typeof e==`string`}function Fi(e){return typeof e==`number`&&!isNaN(e)}function Ii(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Li(e){return Array.isArray(e)}function Ri(e,t,n){let r=new Map(e.nodes.map(e=>[e.id,e])),i=new Map;for(let t of e.edges)t.type===`annotation-of`&&i.set(t.source,t.target);let a=[],o=[],s=new Set;for(let n of e.edges){let e=n.type===`cites`&&n.target===t?i.get(n.source):void 0;if(e!==void 0){if(s.has(e))continue;s.add(e);let t=r.get(e);o.push({resourceId:e,resourceName:t?.label??e})}else if(n.source===t){let e=r.get(n.target);a.push({resourceId:n.target,resourceName:e?.label??n.target,entityTypes:e?.entityTypes??[],bidirectional:n.bidirectional??!1})}}let c=new Set;for(let r of e.nodes)if(r.type===`annotation`&&r.id!==n&&i.get(r.id)===t)for(let e of r.entityTypes??[])c.add(e);return{connections:a,citedBy:o,citedByCount:o.length,siblingEntityTypes:Array.from(c)}}function zi(e){return e/2+e/2*Math.random()}function Bi(e){if(!(e instanceof TypeError))return!1;if(e.message===`fetch failed`)return!0;let t=e.cause?.code;return typeof t==`string`&&t.length>0}var Vi=new Set([429,503,504]);function Hi(e){if(Bi(e))return!0;if(typeof e!=`object`||!e)return!1;if(e.name===`TimeoutError`)return!0;let t=e.status;return typeof t==`number`&&Vi.has(t)}async function Ui(e,t,n,r){let i=n.initialDelayMs;for(let a=1;;a++)try{return await e()}catch(e){if(a>=n.attempts||!t(e))throw e;let o=zi(i);r?.({attempt:a,attempts:n.attempts,delayMs:o,error:e}),await new Promise(e=>setTimeout(e,o)),i=Math.min(i*2,n.maxDelayMs)}}var Wi=`/discovery/kbs.json`,Gi=class extends Error{name=`KyError`;get isKyError(){return!0}},Ki=class extends Gi{name=`HTTPError`;response;request;options;data;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.response=e,this.request=t,this.options=n}},qi=class extends Gi{name=`NetworkError`;request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},Ji=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}},Yi=class extends Gi{name=`ForceRetryError`;customDelay;code;customRequest;constructor(e){let t=e?.cause?e.cause instanceof Error?e.cause:new Ji(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}},Xi=class extends Error{name=`SchemaValidationError`;issues;constructor(e){super(`Response schema validation failed`),this.issues=e}},Zi=class extends Gi{name=`TimeoutError`;request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},Qi=(()=>{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})(),$i=typeof globalThis.AbortController==`function`,ea=typeof globalThis.AbortSignal==`function`&&typeof globalThis.AbortSignal.any==`function`,ta=typeof globalThis.ReadableStream==`function`,na=typeof globalThis.FormData==`function`,ra=[`get`,`post`,`put`,`patch`,`head`,`delete`,`query`],ia={json:`application/json`,text:`text/*`,formData:`multipart/form-data`,arrayBuffer:`*/*`,blob:`*/*`,bytes:`*/*`},aa=2147483647,oa=Symbol(`stop`),sa=class{options;constructor(e){this.options=e}},ca=e=>new sa(e),la={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ua={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},da=new TextEncoder,fa=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[n,r]of e)t+=40,t+=da.encode(`Content-Disposition: form-data; name="${n}"`).byteLength,t+=typeof r==`string`?da.encode(r).byteLength:r.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof e==`string`?da.encode(e).byteLength:e instanceof URLSearchParams?da.encode(e.toString()).byteLength:0},pa=(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(){let e=r??new Uint8Array;i+=e.byteLength,n?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},e)}}))},ma=(e,t)=>{if(!e.body)return e;let n={status:e.status,statusText:e.statusText,headers:e.headers};if(e.status===204)return new Response(null,n);let r=Math.max(0,Number(e.headers.get(`content-length`))||0);return new Response(pa(e.body,r,t),n)},ha=(e,t,n)=>{if(!e.body)return e;let r=fa(n??e.body);return new Request(e,{duplex:`half`,body:pa(e.body,r,t)})},ga=e=>typeof e==`object`&&!!e,_a=Symbol(`replaceOption`),va=e=>ga(e)&&e[_a]===!0?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},ya=(...e)=>{for(let t of e)if((!ga(t)||Array.isArray(t))&&t!==void 0)throw TypeError("The `options` argument must be an object");return Aa({},...e)},ba=(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},xa=e=>{if(!ga(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Sa=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),n=e[Da];return n&&(t[Da]=new Set(n)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:xa(e)?{...e}:e},Ca=e=>Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0)),wa=(e,t)=>xa(e)&&xa(t)?Ca({...e,...t}):ba(e,t);function Ta(e,t,n){return Object.hasOwn(t,n)&&t[n]===void 0?[]:Aa(e[n]??[],t[n]??[])}var Ea=(e={},t={})=>({init:Ta(e,t,`init`),beforeRequest:Ta(e,t,`beforeRequest`),beforeRetry:Ta(e,t,`beforeRetry`),beforeError:Ta(e,t,`beforeError`),afterResponse:Ta(e,t,`afterResponse`)}),Da=Symbol(`deletedParameters`),Oa=(e,t)=>{let n=new URLSearchParams,r=new Set;for(let i of[e,t])if(i!==void 0){if(i instanceof URLSearchParams){for(let[e,t]of i.entries())n.append(e,t),r.delete(e);let e=i[Da];if(e)for(let t of e)n.delete(t),r.add(t)}else if(Array.isArray(i))for(let e of i){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])),r.delete(String(e[0]))}else if(ga(i))for(let[e,t]of Object.entries(i))t===void 0?(n.delete(e),r.add(e)):(n.append(e,String(t)),r.delete(e));else{let e=new URLSearchParams(i);for(let[t,i]of e.entries())n.append(t,i),r.delete(t)}}return r.size>0&&(n[Da]=r),n},ka=(e,...t)=>{let n={},r={},i={},a,o=[];for(let s of t)if(Array.isArray(s))Array.isArray(n)||(n=[]),n=[...n,...s];else if(ga(s)){for(let[t,r]of Object.entries(s)){let i=va(r),{isReplace:s}=i;r=i.value;let c=e&&t===`signal`;if(c&&(s||r===void 0)&&(o.length=0),c&&r instanceof globalThis.AbortSignal){o.push(r);continue}if(t===`context`){if(r!=null&&(!ga(r)||Array.isArray(r)))throw TypeError("The `context` option must be an object");n={...n,context:r==null?{}:s?{...r}:{...n.context,...r}};continue}if(t===`searchParams`){a=r==null?void 0:s||a===void 0?r:Oa(a,r);continue}e&&t===`retry`&&ga(r)&&!s&&typeof n[t]==`number`&&(n={...n,[t]:{limit:n[t]}}),ga(r)&&!s&&t in n&&(r=ka(!1,n[t],r)),n={...n,[t]:r}}if(ga(s.hooks)){let{value:e,isReplace:t}=va(s.hooks);i=Ea(t?{}:i,e),n.hooks=i}if(ga(s.headers)){let{value:e,isReplace:t}=va(s.headers);r=t?Sa(e):wa(r,e),n.headers=r}}return a!==void 0&&(n.searchParams=a),o.length>0&&(o.length===1?n.signal=o[0]:ea?n.signal=AbortSignal.any(o):n.signal=o.at(-1)),n},Aa=(...e)=>ka(!0,...e),ja=e=>ra.includes(e)?e.toUpperCase():e,Ma=[`get`,`put`,`head`,`delete`,`options`,`trace`,`query`],Na=[408,413,429,500,502,503,504],Pa=[413,429,503],Fa="`retry.limit` must be a finite, non-negative integer",Ia={limit:2,methods:Ma,statusCodes:Na,afterStatusCodes:Pa,maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},La=()=>({...Ia,methods:[...Ia.methods],statusCodes:[...Ia.statusCodes],afterStatusCodes:[...Ia.afterStatusCodes]}),Ra=e=>{if(e===void 0)return Ia.limit;if(typeof e!=`number`||!Number.isInteger(e)||e<0)throw TypeError(Fa);return e},za=(e={})=>{if(typeof e==`number`)return{...La(),limit:Ra(e)};if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError("`retry` must be a number or an object");let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),n=Ra(t.limit);if(t.methods!==void 0&&!Array.isArray(t.methods))throw Error(`retry.methods must be an array`);if(t.statusCodes!==void 0&&!Array.isArray(t.statusCodes))throw Error(`retry.statusCodes must be an array`);if(t.afterStatusCodes!==void 0&&!Array.isArray(t.afterStatusCodes))throw Error(`retry.afterStatusCodes must be an array`);return t.methods!==void 0&&(t.methods=t.methods.map(e=>e.toLowerCase())),t.statusCodes!==void 0&&(t.statusCodes=[...t.statusCodes]),t.afterStatusCodes!==void 0&&(t.afterStatusCodes=[...t.afterStatusCodes]),{...La(),...t,limit:n}};async function Ba(e,t,n,r){return new Promise((i,a)=>{let o=setTimeout(()=>{n&&n.abort(),a(new Zi(e))},r.timeout);r.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function Va(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 Ha=e=>{let t={};for(let n in e)Object.hasOwn(e,n)&&!(n in ua)&&!(n in la)&&(t[n]=e[n]);return t},Ua=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[Da]?.size:typeof e==`object`?Object.keys(e).length>0:typeof e==`string`?e.trim().length>0:!!e,Wa=Object.prototype.toString,Ga=e=>Wa.call(e)===`[object Error]`,Ka=new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function qa(e){if(!(e&&Ga(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`||t.startsWith(`Load failed (`)&&t.endsWith(`)`)?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Ka.has(t)}var Ja=(e,t)=>e instanceof t||e?.name===t.name;function Ya(e){return Ja(e,Ki)}function Xa(e){return Ja(e,qi)}function Za(e){return Ja(e,Zi)}var Qa=Date.parse(`2024-01-01`),$a=/^\d+$/,eo=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],to=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,no=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,ro=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,io=e=>{let t=e.get(`Retry-After`);if(t!==null)return{value:t,allowTimestamp:!1};let n=e.get(`RateLimit-Reset`);if(n!==null)return{value:n,allowTimestamp:!0};let r=e.get(`X-RateLimit-Retry-After`);if(r!==null)return{value:r,allowTimestamp:!1};let i=e.get(`X-RateLimit-Reset`)??e.get(`X-Rate-Limit-Reset`);if(i!==null)return{value:i,allowTimestamp:!0}},ao=({year:e,month:t,day:n,hours:r,minutes:i,seconds:a})=>{let o=eo.indexOf(t),s=Number(n),c=Number(r),l=Number(i),u=Number(a);if(o===-1||c>23||l>59||u>60)return;let d=Math.min(u,59),f=new Date(Date.UTC(e,o,s,c,l,d));f.setUTCFullYear(e);let p=f.getTime();if(f.getUTCFullYear()===e&&f.getUTCMonth()===o&&f.getUTCDate()===s&&f.getUTCHours()===c&&f.getUTCMinutes()===l&&f.getUTCSeconds()===d)return u===60?p+1e3:p},oo=(e,t)=>e[t],so=e=>{let t=to.exec(e);if(t)return ao({year:Number(oo(t,3)),month:oo(t,2),day:oo(t,1),hours:oo(t,4),minutes:oo(t,5),seconds:oo(t,6)});let n=no.exec(e);if(n){let e=new Date,t=Number(oo(n,3)),r=Math.floor(e.getUTCFullYear()/100)*100+t,i=Date.UTC(e.getUTCFullYear()+50,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),a;for(let e of[r-100,r,r+100]){let t=ao({year:e,month:oo(n,2),day:oo(n,1),hours:oo(n,4),minutes:oo(n,5),seconds:oo(n,6)});t!==void 0&&t<=i&&(a=t)}return a}let r=ro.exec(e);if(r){let[e,t,n]=oo(r,4).split(`:`);return ao({year:Number(oo(r,5)),month:oo(r,2),day:oo(r,3).trim(),hours:e,minutes:t,seconds:n})}},co=({value:e,allowTimestamp:t})=>{if($a.test(e)){let n=Number(e)*1e3;return t&&n>=Qa&&(n-=Date.now()),Math.max(0,n)}let n=so(e);if(n===void 0)return;let r=n-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0},lo=10485760,uo="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",fo=Symbol(`timedOutResponseData`),po=Symbol(`timedOutOperation`),mo=e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),n=t?.[1]??t?.[2];if(n)try{return new TextDecoder(n)}catch{}return new TextDecoder},ho="The `schema` argument must follow the Standard Schema specification",go=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return Array.isArray(t.methods)&&(t.methods=[...t.methods]),Array.isArray(t.statusCodes)&&(t.statusCodes=[...t.statusCodes]),Array.isArray(t.afterStatusCodes)&&(t.afterStatusCodes=[...t.afterStatusCodes]),t},_o=Object.prototype.toString,vo=/^[\0-\u0020]+/g,yo=/[\t\n\r]/g,bo=/^[a-z][\d+.a-z-]*:/i,xo=/^https?:(?!\/\/)/i,So=e=>e instanceof globalThis.Request||_o.call(e)===`[object Request]`,Co=e=>e instanceof globalThis.Response||_o.call(e)===`[object Response]`,wo=e=>bo.test(e),To=e=>e.replaceAll(vo,``).replaceAll(yo,``),Eo=e=>Array.isArray(e)?e.map(e=>[...e]):Sa(e);function Do(e){let t={...e,json:Sa(e.json),context:Sa(e.context),headers:Sa(e.headers),searchParams:Eo(e.searchParams)};return e.retry!==void 0&&(t.retry=go(e.retry)),t}var Oo=async(e,t)=>{if(typeof t!=`object`&&typeof t!=`function`||t===null)throw TypeError(ho);let n=t[`~standard`];if(typeof n!=`object`||!n||typeof n.validate!=`function`)throw TypeError(ho);let r=await n.validate(e);if(r.issues)throw new Xi(r.issues);return r.value},ko=class e{static create(t,n){let r=n.hooks?.init??[],i=r.length>0?Do(n):n;for(let e of r)e(i);let a=new e(t,i),o=async()=>{if(typeof a.#a.timeout==`number`&&a.#a.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${aa}`);if(typeof a.#a.totalTimeout==`number`&&a.#a.totalTimeout>2147483647)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${aa}`);await Promise.resolve();let e=await a.#A();e!==void 0&&(a.#r=za(a.#a.retry).limit);let t=e??await a.#M(async()=>a.#F()),n=e!==void 0||a.#P();for(;;){if(t===void 0)return t;if(Co(t))try{t=await a.#j(t)}catch(e){if(!(e instanceof Yi))throw e;let r=await a.#N(e,async()=>a.#F());if(r===void 0)return r;t=r,n=a.#P();continue}let e=t;if(!e.ok&&e.type!==`opaque`&&(typeof a.#a.throwHttpErrors==`function`?a.#a.throwHttpErrors(e.status):a.#a.throwHttpErrors)){let r=new Ki(e,a.#B(e),a.#R()),i=r;if(r.data=await a.#_(e),n)throw i;let o=await a.#N(r,async()=>a.#F());if(o===void 0)return o;t=o,n=a.#P();continue}break}if(!Co(t))return t;if(a.#h(t),a.#a.onDownloadProgress){if(typeof a.#a.onDownloadProgress!=`function`)throw TypeError("The `onDownloadProgress` option must be a function");if(!ta)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();return a.#E(t),ma(e,a.#a.onDownloadProgress)}return t},s=(async()=>{try{return await o()}catch(e){await a.#g(e)}finally{let e=a.#o;a.#T(e?.body??void 0),a.request!==e&&a.#T(a.request.body??void 0)}})();for(let[e,t]of Object.entries(ia))(e!==`bytes`||typeof globalThis.Response?.prototype?.bytes==`function`)&&(s[e]=async n=>{a.request.headers.set(`accept`,a.request.headers.get(`accept`)||t);let r=await s;if(e!==`json`)return a.#b(async()=>r[e](),r);let o=await a.#b(async()=>r.text(),r),c=a.#B(r),l=await a.#x(async()=>{let e=i.parseJson?await i.parseJson(o,{request:c,response:r}):o===``&&n!==void 0?void 0:JSON.parse(o);return n===void 0?e:Oo(e,n)});return l===po&&await a.#g(new Zi(c)),l});return s}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;#c=new WeakSet;#l;#u;#d=!1;#f=new WeakMap;constructor(t,n={}){if(this.#i=t,Object.hasOwn(n,`prefixUrl`))throw Error(uo);if(this.#a={...n,headers:ba(this.#i.headers,n.headers),hooks:Ea({},n.hooks),method:ja(n.method??this.#i.method??`GET`),prefix:String(n.prefix||``),retry:za(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,totalTimeout:n.totalTimeout??!1,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},this.#r=this.#a.retry.limit,typeof this.#i!=`string`&&!(this.#i instanceof URL||this.#i instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#i==`string`){if(this.#a.prefix){let e=this.#a.prefix.replace(/\/+$/,``),t=this.#i.replace(/^\/+/,``);this.#i=`${e}/${t}`}if(this.#a.baseUrl){let e=To(this.#i);if(xo.test(e))throw TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");wo(e)||(this.#i=new URL(this.#i,new Request(this.#a.baseUrl).url))}}$i&&ea&&(this.#s=this.#a.signal??this.#i.signal,this.#t=new globalThis.AbortController,this.#a.signal=this.#O()),Qi&&(this.#a.duplex=`half`),this.#a.json!==void 0&&(this.#a.body=this.#a.stringifyJson?.(this.#a.json)??JSON.stringify(this.#a.json),this.#a.headers.set(`content-type`,this.#a.headers.get(`content-type`)??`application/json`));let r=n.headers&&new globalThis.Headers(n.headers).has(`content-type`);if(this.#i instanceof globalThis.Request&&(na&&this.#a.body instanceof globalThis.FormData||this.#a.body instanceof URLSearchParams)&&!r&&this.#a.headers.delete(`content-type`),this.request=new globalThis.Request(this.#i,this.#a),Ua(this.#a.searchParams)){let t=new URL(this.request.url),n=this.#a.searchParams?.[Da];if(n)for(let e of n)t.searchParams.delete(e);if(typeof this.#a.searchParams==`string`){let e=this.#a.searchParams.replace(/^\?/,``);e!==``&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{let n=new URLSearchParams(e.#e(this.#a.searchParams));for(let[e,r]of n.entries())t.searchParams.append(e,r)}if(this.#a.searchParams&&typeof this.#a.searchParams==`object`&&!Array.isArray(this.#a.searchParams)&&!(this.#a.searchParams instanceof URLSearchParams))for(let[e,n]of Object.entries(this.#a.searchParams))n===void 0&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#a)}if(this.#a.onUploadProgress&&typeof this.#a.onUploadProgress!=`function`)throw TypeError("The `onUploadProgress` option must be a function");this.#u=typeof this.#a.totalTimeout==`number`?this.#L():void 0}#p(e){let t=e.delay(this.#n+1),n=t;return e.jitter===!0?n=Math.random()*t:typeof e.jitter==`function`&&(n=e.jitter(t),(!Number.isFinite(n)||n<0)&&(n=t)),Math.min(e.backoffLimit,n)}async#m(e){let t=za(this.#a.retry);if(this.#n>=Math.min(t.limit,this.#r))throw e;let n=e instanceof Error?e:new Ji(e);if(n instanceof Yi)return n.customDelay??this.#p(t);if(!t.methods.includes(this.request.method.toLowerCase()))throw e;let{shouldRetry:r}=t;if(r!==void 0){let i=await this.#x(async()=>r({error:n,retryCount:this.#n+1}));if(i===po)throw new Zi(this.request);if(i===!1)throw e;if(i===!0)return this.#p(t)}if(Za(e)){if(!t.retryOnTimeout)throw e;return this.#p(t)}if(Ya(e)){if(!t.statusCodes.includes(e.response.status))throw e;let n=io(e.response.headers);if(n&&t.afterStatusCodes.includes(e.response.status)){let e=co(n);return e===void 0?this.#p(t):Math.min(t.maxRetryAfter,e)}if(e.response.status===413)throw e;return this.#p(t)}if(!Xa(e))throw e;return this.#p(t)}#h(e){let t=this.#B(e);return this.#a.parseJson&&(e.json=async()=>{let n=await e.text();return this.#a.parseJson(n,{request:t,response:e})}),e}async#g(e){if(!(e instanceof Error)||this.#c.has(e))throw e;let t=e;for(let e of this.#a.hooks.beforeError){let n=await e({request:this.request,options:this.#R(),error:t,retryCount:this.#n});n instanceof Error&&(t=n)}throw t}async#_(e){let t=this.#v(),n=await this.#C(e,t.milliseconds);if(n===fo){if(t.fromTotalTimeout)throw new Zi(this.request);this.#k();return}if(!n)return;if(!this.#S(e.headers.get(`content-type`)??``))return n;let r=this.#v(),i=await this.#w(n,e,r.milliseconds,this.#B(e));if(i===fo){if(r.fromTotalTimeout)throw new Zi(this.request);this.#k();return}return i}#v(){let e=this.#a.timeout===!1?1e4:this.#a.timeout,t=this.#I();if(t===void 0)return{milliseconds:e,fromTotalTimeout:!1};if(t<=0)throw new Zi(this.request);return{milliseconds:Math.min(e,t),fromTotalTimeout:t<=e}}#y(){let e=this.#I();if(e!==void 0){if(e<=0)throw new Zi(this.request);return this.#a.timeout===!1?e:Math.min(this.#a.timeout,e)}return this.#a.timeout===!1?void 0:this.#a.timeout}async#b(e,t){let n;try{n=this.#y()}catch(e){await this.#g(e)}let r=e();if(n===void 0)return r;let i=await Promise.race([r,new Promise(e=>{let t=setTimeout(()=>{e(fo)},n);r.finally(()=>{clearTimeout(t)}).catch(()=>void 0)})]);return i===fo&&(this.#t?.abort(),await this.#g(new Zi(this.#B(t)))),i}async#x(e){let t=this.#I();if(t===void 0)return e();if(t<=0)return this.#t?.abort(),po;let n;try{let r=new Promise(e=>{n=setTimeout(()=>{e(po)},t)}),i=Promise.resolve().then(e).then(e=>({status:`fulfilled`,value:e})).catch(e=>({status:`rejected`,error:e})),a=await Promise.race([i,r]),o=this.#I();if(a===po||o!==void 0&&o<=0)return this.#t?.abort(),a===po?i.then(e=>{e.status===`fulfilled`&&this.#D(e.value)}):a.status===`fulfilled`&&this.#D(a.value),po;if(a.status===`rejected`)throw a.error;return a.value}finally{clearTimeout(n)}}#S(e){let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#C(e,t){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let r;try{r=n.getReader()}catch{return}let i=mo(e.headers.get(`content-type`)??``),a=[],o=0,s=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if(o+=t.byteLength,o>lo){r.cancel().catch(()=>void 0);return}a.push(i.decode(t,{stream:!0}))}}catch{return}return a.push(i.decode()),a.join(``)})(),c=new Promise(e=>{let n=setTimeout(()=>{e(fo)},t);s.finally(()=>{clearTimeout(n)})}),l=await Promise.race([s,c]);return l===fo&&r.cancel().catch(()=>void 0),l}async#w(e,t,n,r){let i;try{return await Promise.race([Promise.resolve().then(()=>this.#a.parseJson?this.#a.parseJson(e,{request:r,response:t}):JSON.parse(e)),new Promise(e=>{i=setTimeout(()=>{e(fo)},n)})])}catch{return}finally{clearTimeout(i)}}#T(e){e&&e.cancel().catch(()=>void 0)}#E(e){this.#T(e.body??void 0)}#D(e){Co(e)?this.#E(e):So(e)&&this.#T(e.body??void 0)}#O(){return this.#s?AbortSignal.any([this.#s,this.#t.signal]):this.#t.signal}#k(){let e=this.#I();if(e!==void 0&&e<=0)throw new Zi(this.request)}async#A(){for(let e of this.#a.hooks.beforeRequest){let t=await this.#x(async()=>e({request:this.request,options:this.#R(),retryCount:0}));if(t===po)throw new Zi(this.request);if(So(t))this.#z(t);else if(Co(t))return t}}async#j(e){let t=this.#B(e);for(let n of this.#a.hooks.afterResponse){let r=this.#V(e.clone(),t);this.#h(r);let i;try{if(i=await this.#x(async()=>n({request:this.request,options:this.#R(),response:r,retryCount:this.#n})),i===po)throw new Zi(this.request)}catch(t){throw r!==e&&this.#E(r),this.#E(e),t}if(i instanceof sa)throw r!==e&&this.#E(r),this.#E(e),new Yi(i.options);let a=Co(i)?this.#V(i,t):e;r!==e&&r!==a&&r.body!==a.body&&this.#E(r),e!==a&&e.body!==a.body&&this.#E(e),e=a}return e}async#M(e){try{return await e()}catch(t){return this.#N(t,e)}}async#N(e,t){this.#d=!1;let n=Math.min(await this.#m(e),aa),r={signal:this.#s},i=this.#I();if(i!==void 0){if(i<=0)throw new Zi(this.request);if(n>=i)throw await Va(i,r),new Zi(this.request)}if(await Va(n,r),this.#k(),e instanceof Yi&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#a.signal?{signal:this.#a.signal}:void 0);this.#z(t)}for(let t of this.#a.hooks.beforeRetry){let n;try{n=await this.#x(async()=>t({request:this.request,options:this.#R(),error:e,retryCount:this.#n+1}))}catch(t){throw t instanceof Error&&t!==e&&this.#c.add(t),t}if(n===po)throw new Zi(this.request);if(So(n)){this.#z(n);break}if(Co(n))return this.#d=!0,this.#n++,n;if(n===oa)return}return this.#k(),this.#n++,this.#M(t)}#P(){let e=this.#d;return this.#d=!1,e}async#F(){this.#t?.signal.aborted&&(this.#t=new globalThis.AbortController,this.#a.signal=this.#O(),this.request=new globalThis.Request(this.request,{signal:this.#a.signal}));let e=Ha(this.#a);this.#r=za(this.#a.retry).limit;let t=this.#r>0?this.request.clone():void 0,n=this.#H(this.request,this.#a.body??void 0);this.#o=n,t&&(this.request=t);try{let t=this.#I();if(t!==void 0&&t<=0)throw new Zi(this.request);let r=this.#a.timeout===!1?t:t===void 0?this.#a.timeout:Math.min(this.#a.timeout,t),i=r===void 0?await this.#a.fetch(n,e):await Ba(n,e,this.#t,{timeout:r,fetch:this.#a.fetch});return this.#V(i,n)}catch(e){throw qa(e)?new qi(this.request,{cause:e}):e}}#I(){if(this.#u===void 0)return;let e=this.#L()-this.#u;return Math.max(0,this.#a.totalTimeout-e)}#L(){return globalThis.performance?.now()??Date.now()}#R(){if(!this.#l){let{hooks:e,json:t,parseJson:n,stringifyJson:r,searchParams:i,timeout:a,totalTimeout:o,throwHttpErrors:s,fetch:c,...l}=this.#a;this.#l=Object.freeze(l)}return this.#l}#z(e){this.#l=void 0,this.request=e}#B(e){return this.#f.get(e)??this.request}#V(e,t){return this.#f.set(e,t),e}#H(e,t){return!this.#a.onUploadProgress||!e.body||!Qi?e:ha(e,this.#a.onUploadProgress,t??this.#a.body??void 0)}},Ao=e=>{let t=(t,n)=>ko.create(t,ya(e,n));for(let n of ra)t[n]=(t,r)=>ko.create(t,ya(e,r,{method:n}));return t.create=e=>Ao(ya(e)),t.extend=t=>(typeof t==`function`&&(t=t(e??{})),Ao(ya(e,t))),t.stop=oa,t.retry=ca,t},jo=Ao(),Mo=`1.9.1`,No=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Po(e){let t=new Set([e]),n=new Set,r=e.match(No);if(!r)return()=>!1;let 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;let r=e.match(No);if(!r)return a(e);let 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 Fo=Po(Mo),Io=Mo.split(`.`)[0],Lo=Symbol.for(`opentelemetry.js.api.${Io}`),Ro=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function zo(e,t,n,r=!1){let i=Ro[Lo]=Ro[Lo]??{version:Mo};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Mo}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Mo}.`),!0}function Bo(e){let t=Ro[Lo]?.version;if(!(!t||!Fo(t)))return Ro[Lo]?.[e]}function Vo(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Mo}.`);let n=Ro[Lo];n&&delete n[e]}var Ho=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Uo(`debug`,this._namespace,e)}error(...e){return Uo(`error`,this._namespace,e)}info(...e){return Uo(`info`,this._namespace,e)}warn(...e){return Uo(`warn`,this._namespace,e)}verbose(...e){return Uo(`verbose`,this._namespace,e)}};function Uo(e,t,n){let r=Bo(`diag`);if(r)return r[e](t,...n)}var Wo;(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`})(Wo||={});function Go(e,t){e<Wo.NONE?e=Wo.NONE:e>Wo.ALL&&(e=Wo.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Wo.ERROR),warn:n(`warn`,Wo.WARN),info:n(`info`,Wo.INFO),debug:n(`debug`,Wo.DEBUG),verbose:n(`verbose`,Wo.VERBOSE)}}var Ko=`diag`,qo=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Bo(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:Wo.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=Bo(`diag`),i=Go(n.logLevel??Wo.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return zo(`diag`,i,t,!0)},t.disable=()=>{Vo(Ko,t)},t.createComponentLogger=e=>new Ho(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},Jo=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},Yo=Symbol(`BaggageEntryMetadata`),Xo=qo.instance();function Zo(e={}){return new Jo(new Map(Object.entries(e)))}function Qo(e){return typeof e!=`string`&&(Xo.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:Yo,toString(){return e}}}function $o(e){return Symbol.for(e)}var es=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},ts=class{constructor(){}createGauge(e,t){return ps}createHistogram(e,t){return ms}createCounter(e,t){return fs}createUpDownCounter(e,t){return hs}createObservableGauge(e,t){return _s}createObservableCounter(e,t){return gs}createObservableUpDownCounter(e,t){return vs}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ns=class{},rs=class extends ns{add(e,t){}},is=class extends ns{add(e,t){}},as=class extends ns{record(e,t){}},os=class extends ns{record(e,t){}},ss=class{addCallback(e){}removeCallback(e){}},cs=class extends ss{},ls=class extends ss{},us=class extends ss{},ds=new ts,fs=new rs,ps=new as,ms=new os,hs=new is,gs=new cs,_s=new ls,vs=new us;function ys(){return ds}var bs={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},xs={set(e,t,n){e!=null&&(e[t]=n)}},Ss=class{active(){return es}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},Cs=`context`,ws=new Ss,Ts=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return zo(Cs,e,qo.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Bo(Cs)||ws}disable(){this._getContextManager().disable(),Vo(Cs,qo.instance())}},Es;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Es||={});var Ds={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Es.NONE},Os=class{constructor(e=Ds){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ks=$o(`OpenTelemetry Context Key SPAN`);function As(e){return e.getValue(ks)||void 0}function js(){return As(Ts.getInstance().active())}function Ms(e,t){return e.setValue(ks,t)}function Ns(e){return e.deleteValue(ks)}function Ps(e,t){return Ms(e,new Os(t))}function Fs(e){return As(e)?.spanContext()}var Is=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ls(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Is[e.charCodeAt(t)]|0)+(Is[e.charCodeAt(t+1)]|0)+(Is[e.charCodeAt(t+2)]|0)+(Is[e.charCodeAt(t+3)]|0);return n===t}function Rs(e){return Ls(e,32)&&e!==`00000000000000000000000000000000`}function zs(e){return Ls(e,16)&&e!==`0000000000000000`}function Bs(e){return Rs(e.traceId)&&zs(e.spanId)}function Vs(e){return new Os(e)}var Hs=Ts.getInstance(),Us=class{startSpan(e,t,n=Hs.active()){if(t?.root)return new Os;let r=n&&Fs(n);return Ws(r)&&Bs(r)?new Os(r):new Os}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??Hs.active(),c=this.startSpan(e,i,s),l=Ms(s,c);return Hs.with(l,o,void 0,c)}};function Ws(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Gs=new Us,Ks=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Gs}},qs=new class{getTracer(e,t,n){return new Us}},Js=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Ks(this,e,t,n)}getDelegate(){return this._delegate??qs}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},Ys;(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`})(Ys||={});var Xs;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Xs||={});var Zs=Ts.getInstance(),Qs=new class{getMeter(e,t,n){return ds}},$s=`metrics`,ec=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return zo($s,e,qo.instance())}getMeterProvider(){return Bo($s)||Qs}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){Vo($s,qo.instance())}}.getInstance(),tc=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},nc=$o(`OpenTelemetry Baggage Key`);function rc(e){return e.getValue(nc)||void 0}function ic(){return rc(Ts.getInstance().active())}function ac(e,t){return e.setValue(nc,t)}function oc(e){return e.deleteValue(nc)}var sc=`propagation`,cc=new tc,lc=class e{constructor(){this.createBaggage=Zo,this.getBaggage=rc,this.getActiveBaggage=ic,this.setBaggage=ac,this.deleteBaggage=oc}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return zo(sc,e,qo.instance())}inject(e,t,n=xs){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=bs){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Vo(sc,qo.instance())}_getGlobalPropagator(){return Bo(sc)||cc}}.getInstance(),uc=`trace`,dc=class e{constructor(){this._proxyTracerProvider=new Js,this.wrapSpanContext=Vs,this.isSpanContextValid=Bs,this.deleteSpan=Ns,this.getSpan=As,this.getActiveSpan=js,this.getSpanContext=Fs,this.setSpan=Ms,this.setSpanContext=Ps}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=zo(uc,this._proxyTracerProvider,qo.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Bo(uc)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Vo(uc,qo.instance()),this._proxyTracerProvider=new Js}}.getInstance();tr(()=>{let e=dc.getActiveSpan();if(!e)return;let t=e.spanContext();if(Bs(t))return t.traceId});var fc=`semiont`,pc=()=>dc.getTracer(fc);async function mc(e,t,n){let r=pc().startSpan(e,{kind:n?.kind??Ys.INTERNAL,...n?.attrs?{attributes:n.attrs}:{}});try{return await Zs.with(dc.setSpan(Zs.active(),r),()=>t(r))}catch(e){throw r.recordException(e),r.setStatus({code:Xs.ERROR,message:e instanceof Error?e.message:String(e)}),e}finally{r.end()}}var hc=`_trace`;function gc(){let e={};lc.inject(Zs.active(),e);let t=e.traceparent;if(t)return e.tracestate?{traceparent:t,tracestate:e.tracestate}:{traceparent:t}}function _c(e){let t=e[hc];if(t!==void 0&&delete e[hc],!(!t||typeof t.traceparent!=`string`))return t}function vc(e,t){if(!e)return t();let n={traceparent:e.traceparent};e.tracestate&&(n.tracestate=e.tracestate);let r=lc.extract(Zs.active(),n);return Zs.with(r,t)}var yc=`semiont`,bc=()=>ec.getMeter(yc),xc;function Sc(){return xc||=bc().createCounter(`semiont.bus.emit`,{description:`Bus emits by channel and scope`}),xc}function Cc(e,t){Sc().add(1,{"bus.channel":e,...t?{"bus.scope":t}:{}})}Math.floor(Date.now()/1e3);var wc=class extends Gr{status;constructor(e){super(`SSE connect failed: ${e}`,`SSE_CONNECT_FAILED`,{status:e}),this.name=`SseConnectError`,this.status=e}};function Tc(e){return e===400?`bad-request`:e===401?`unauthorized`:e===403?`forbidden`:e===404?`not-found`:e===409?`conflict`:e>=500?`unavailable`:`error`}var Ec=class extends Gr{status;statusText;constructor(e,t,n,r){super(e,Tc(t),{status:t,statusText:n,body:r}),this.name=`APIError`,this.status=t,this.statusText=n}};new Ec(``,0,``);var Dc=3e3,Oc=6e4,kc=3e4,Ac={attempts:4,initialDelayMs:1e3,maxDelayMs:4e3},jc=1e3,Mc={initial:[`connecting`,`unauthenticated`,`closed`],connecting:[`open`,`reconnecting`,`unauthenticated`,`closed`],open:[`reconnecting`,`closed`],reconnecting:[`connecting`,`degraded`,`unauthenticated`,`closed`],degraded:[`connecting`,`reconnecting`,`unauthenticated`,`closed`],unauthenticated:[`connecting`,`closed`],closed:[]};function Nc(e){let{baseUrl:t,token:n,channels:r,reconnectMs:i=5e3,lazyRemoveMs:a=5e3,tokenRefresher:o}=e,s=typeof n==`function`?n:()=>n,c=new Set(r),l=new Map,u=new Map(Object.entries(e.loadLastEventIds?.()??{})),d=new Set,f=hr(),p=new St,m=new wt(`initial`),h=new St,g=`initial`,_=null,v=e=>{if(g===e)return;if(!Mc[g].includes(e)){console.warn(`[actor] ignoring invalid connection state transition: ${g} \u2192 ${e}`);return}let t=g;g=e,e===`reconnecting`&&t!==`reconnecting`&&(_&&clearTimeout(_),_=setTimeout(()=>{g===`reconnecting`&&v(`degraded`)},Dc)),t===`reconnecting`&&e!==`reconnecting`&&(_&&=(clearTimeout(_),null)),m.next(e)},y=!1,b=new Set,x=null,S=new WeakSet,C=new Set,w=new Set,T=e=>{if(w.add(e),w.size>512){let e=w.values().next().value;e!==void 0&&w.delete(e)}},E=e=>{w.delete(e)},D=p.pipe(Fn()),O=()=>{for(let e of b)try{e.abort()}catch{}b.clear(),x&&=(clearTimeout(x),null);for(let e of C)clearTimeout(e);C.clear()},k=0,A=null,j=!1,M=(e,t=!1)=>{y&&(x&&clearTimeout(x),x=setTimeout(()=>{y&&N(t)},e))},ee=()=>{let e=Math.min(i*2**k,Oc);return k++,e/2+e/2*Math.random()},N=async(n=!1)=>{let r=s();if(!r||r===A){y&&(g!==`unauthenticated`&&v(`unauthenticated`),M(i,n));return}A=null,v(`connecting`);let a=[...b];if(!n){for(let e of a)try{e.abort()}catch{}b.clear()}let m=JSON.stringify({global:[...c],scoped:[...l.entries()].map(([e,t])=>{let n=u.get(e);return{scope:e,channels:[...t],...n===void 0?{}:{lastEventId:n}}}),...d.size>0?{pendingReplies:[...d]}:{},clientId:f}),_=`${t}/bus/subscribe`,x=new AbortController;b.add(x);try{let t={Authorization:`Bearer ${r}`,"Content-Type":`application/json`},i=await fetch(_,{method:`POST`,headers:t,body:m,signal:x.signal});if(!i.ok||!i.body)throw new wc(i.status);if(!y)return;if(n){for(let e of a)S.add(e);let e=setTimeout(()=>{C.delete(e);for(let e of a){try{e.abort()}catch{}b.delete(e)}},jc);C.add(e)}v(`open`),k=0,j=!1;let o=i.body.getReader(),s=new TextDecoder,c=[],l=``,d=``,f;for(;y&&b.has(x);){let{done:t,value:n}=await o.read();if(t)break;let r=s.decode(n,{stream:!0}),i=0;for(;i<=r.length;){let t=r.indexOf(`
7
7
  `,i);if(t===-1){i<r.length&&c.push(i===0?r:r.slice(i));break}let n=r.slice(i,t);if(i=t+1,c.length>0&&(c.push(n),n=c.join(``),c=[]),n.startsWith(`event: `))l=n.slice(7);else if(n.startsWith(`data: `))d=n.slice(6);else if(n.startsWith(`id: `))f=n.slice(4);else if(n===``){let t=f!==void 0&&w.has(f);if(l===`bus-event`&&d&&!t){let t=JSON.parse(d);nr(`RECV`,t.channel,t.payload,t.scope),$n()&&S.has(x)&&console.debug(`[bus LINGER] ${t.channel} delivered on superseded connection`);let n=_c(t.payload);f!==void 0&&T(f);try{await vc(n,()=>mc(`bus.recv:${t.channel}`,()=>{p.next(t)},{kind:Ys.CONSUMER,attrs:{"bus.channel":t.channel,...t.scope?{"bus.scope":t.scope}:{}}}))}catch(e){throw f!==void 0&&E(f),e}f!==void 0&&f.startsWith(`p-`)&&t.scope&&(u.set(t.scope,f),e.saveLastEventId?.(t.scope,f))}l=``,d=``,f=void 0}}}}catch(e){if(e.name===`AbortError`)return;if(e instanceof wc&&(h.next(e),e.status===401&&y&&!S.has(x))){if(A=r,k=0,g!==`unauthenticated`&&v(`unauthenticated`),o&&!j){j=!0;let e=null;try{e=await o()}catch{}if(y&&e&&e!==A){M(0,n);return}}M(i,n);return}}finally{b.delete(x)}y&&!S.has(x)&&(v(`reconnecting`),M(ee()))},te=()=>{y&&((g===`open`||g===`connecting`||g===`degraded`)&&v(`reconnecting`),x&&=(clearTimeout(x),null),N(!0))},P=null,F=null,ne=()=>{F&&=(clearTimeout(F),null),P&&clearTimeout(P),P=setTimeout(()=>{P=null,te()},100)},re=()=>{P||F||(F=setTimeout(()=>{F=null,te()},a))};return{on$(e){return D.pipe(On(t=>t.channel===e),xn(e=>e.payload))},emit:async(e,n,r)=>{let i={channel:e,payload:n,clientId:f};r&&(i.scope=r);let a={"Content-Type":`application/json`,Authorization:`Bearer ${s()}`},o=gc();o&&(a.traceparent=o.traceparent,o.tracestate&&(a.tracestate=o.tracestate));let c=await Ui(async()=>{let e=await fetch(`${t}/bus/emit`,{method:`POST`,headers:a,body:JSON.stringify(i),signal:AbortSignal.timeout(kc)});if(!e.ok){let t=``;try{t=(await e.text()).slice(0,500)}catch{}throw new Ec(`/bus/emit ${e.status}${t?`: ${t}`:``}`,e.status,e.statusText,t||void 0)}return e},Hi,Ac);try{let e=await c.json();return typeof e.subscribers==`number`?e.subscribers:-1}catch{return-1}},state$:m.asObservable(),errors$:h.asObservable(),isSubscribed:e=>c.has(e),addChannels:(e,t)=>{let n=!1;if(t!==void 0){let r=l.get(t);r||(r=new Set,l.set(t,r));for(let t of e)r.has(t)||(r.add(t),n=!0)}else for(let t of e)c.has(t)||(c.add(t),n=!0);n&&ne()},removeChannels:(e,t)=>{let n=!1;if(t!==void 0){let r=l.get(t);if(r){for(let t of e)r.delete(t)&&(n=!0);r.size===0&&l.delete(t)}}else for(let t of e)c.delete(t)&&(n=!0);n&&re()},trackReply:e=>{d.add(e);let t=!1;return()=>{t||(t=!0,d.delete(e))}},start:()=>{y||(y=!0,N())},stop:()=>{y=!1,g!==`closed`&&v(`closed`),P&&=(clearTimeout(P),null),F&&=(clearTimeout(F),null),_&&=(clearTimeout(_),null),O()},dispose:()=>{y=!1,g!==`closed`&&v(`closed`),P&&=(clearTimeout(P),null),F&&=(clearTimeout(F),null),_&&=(clearTimeout(_),null),O(),p.complete(),m.complete(),h.complete()}}}var Pc=[...ur.filter(e=>!Xn.includes(e)),...dr],Fc=class{baseUrl;http;token$;logger;errorsSubject=new St;errors$=this.errorsSubject.asObservable();_actor=null;_actorStarted=!1;disposed=!1;scopeRefCounts=new Map;bridges=[];config;constructor(e){let{baseUrl:t,timeout:n=3e4,retry:r=2,logger:i,tokenRefresher:a}=e;this.config=e,this.baseUrl=t.endsWith(`/`)?t.slice(0,-1):t,this.token$=e.token$??new wt(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=jo.create({timeout:n,retry:o,hooks:{beforeRequest:[({request: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 Ki)||t.response.status!==401))try{let t=await a();if(!t)return jo.stop;e.headers.set(`Authorization`,`Bearer ${t}`);return}catch{return jo.stop}}]:[],afterResponse:[({request:e,response:t})=>(this.logger&&this.logger.debug(`HTTP Response`,{type:`http_response`,url:e.url,method:e.method,status:t.status,statusText:t.statusText}),t)],beforeError:[async({request:e,error:t})=>{let n=t instanceof Ki?t.response:void 0;if(n){let t=await n.json().catch(()=>({}));this.logger&&this.logger.error(`HTTP Request Failed`,{type:`http_error`,url:e.url,method:e.method,status:n.status,statusText:n.statusText,error:t.message||`HTTP ${n.status}: ${n.statusText}`});let r=new Ec(t.message||`HTTP ${n.status}: ${n.statusText}`,n.status,n.statusText,t);throw this.errorsSubject.next(r),r}return t}]}}),this.token$.subscribe(e=>{e&&!this._actorStarted&&!this.disposed&&(this._actorStarted=!0,this.actor.start())})}get actor(){if(!this._actor){let e=this.config.channels??Xn;this._actor=Nc({baseUrl:this.baseUrl,token:()=>this.token$.getValue()??``,channels:[...e],...this.config.loadLastEventIds?{loadLastEventIds:this.config.loadLastEventIds}:{},...this.config.saveLastEventId?{saveLastEventId:this.config.saveLastEventId}:{},...this.config.tokenRefresher?{tokenRefresher:this.config.tokenRefresher}:{}}),this._actor.errors$.subscribe(e=>this.errorsSubject.next(e));for(let t of[...e,...Pc])this._actor.on$(t).subscribe(e=>{for(let n of this.bridges)n.get(t).next(e)})}return this._actor}async emit(e,t,n){return nr(`EMIT`,e,t,n),Cc(e,n),mc(`bus.emit:${e}`,async()=>n===void 0?this.actor.emit(e,t):this.actor.emit(e,t,n),{kind:Ys.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){let t=e,n=this.scopeRefCounts.get(t)??0;this.scopeRefCounts.set(t,n+1),n===0&&this.actor.addChannels([...Pc],t);let r=!1;return()=>{if(r)return;r=!0;let e=(this.scopeRefCounts.get(t)??0)-1;if(e>0){this.scopeRefCounts.set(t,e);return}this.scopeRefCounts.delete(t),this.actor.removeChannels([...Pc],t)}}get state$(){return this.actor.state$}trackReply(e){return this.actor.trackReply(e)}isSubscribed(e){return this.actor.isSubscribed(e)}dispose(){this.disposed||(this.disposed=!0,this.scopeRefCounts.clear(),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 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 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}},Ic=class{constructor(e){this.transport=e}transport;async putBinary(e,t){let n=e.file instanceof File?e.file.size:e.file.length;return nr(`PUT`,`content`,{name:e.name,format:e.format,storageUri:e.storageUri,sizeBytes:n}),mc(`content.put`,async()=>{let n=Lc(e),r=this.requestHeaders(t?.auth);return typeof XMLHttpRequest<`u`&&(t?.onProgress||t?.signal)?Rc({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:Ys.CLIENT,attrs:{"content.format":e.format,"content.size_bytes":n}})}async getBinary(e,t){return nr(`GET`,`content`,{resourceId:e}),mc(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers:this.requestHeaders(t?.auth)}),r=n.headers.get(`content-type`)||`application/octet-stream`;return{data:await n.arrayBuffer(),contentType:r}},{kind:Ys.CLIENT,attrs:{"resource.id":e}})}async getBinaryStream(e,t){return nr(`GET`,`content`,{resourceId:e,stream:!0}),mc(`content.get`,async()=>{let n=await this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}`,{headers: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:Ys.CLIENT,attrs:{"resource.id":e,"content.stream":!0}})}async getResourceGraph(e,t){return nr(`GET`,`content`,{resourceId:e,graph:!0}),mc(`content.get_graph`,()=>this.transport.rawHttp.get(`${this.transport.baseUrl}/resources/${e}/jsonld`,{headers:this.requestHeaders(t?.auth)}).json(),{kind:Ys.CLIENT,attrs:{"resource.id":e,"content.graph":!0}})}dispose(){}requestHeaders(e){let t=e??this.transport.getToken(),n=t?{Authorization:`Bearer ${t}`}:{},r=gc();return r&&(n.traceparent=r.traceparent,r.tracestate&&(n.tracestate=r.tracestate)),n}};function Lc(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.cloneToken&&t.append(`cloneToken`,e.cloneToken),e.archiveOriginal!==void 0&&t.append(`archiveOriginal`,String(e.archiveOriginal)),e.isDraft!==void 0&&t.append(`isDraft`,String(e.isDraft)),t}function Rc(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 Ec(`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 Ec(`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 Ec(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 Ec(`Network error during upload`,0,`network-error`);o(e),s(e)},c.ontimeout=()=>{let e=new Ec(`Upload timed out`,0,`timeout`);o(e),s(e)},c.onabort=()=>{let e=new Ec(`Upload aborted`,0,`aborted`);o(e),s(e)},a&&a.addEventListener(`abort`,()=>c.abort(),{once:!0}),c.send(n)})}var zc=class e extends pt{then(e,t){return hn(this).then(e,t)}run(e){return new Promise((t,n)=>{let r,i=!1;this.subscribe({next:t=>{i=!0,r=t,e(t)},error:n,complete:()=>{i?t(r):n(new mn)}})})}static from(t){return new e(e=>t.subscribe(e))}},Bc=class e extends pt{fetchFresh;fresh(){return this.fetchFresh?this.fetchFresh():gn(this.pipe(On(e=>e.status!==`pending`))).then(e=>{if(e.status===`failed`)throw e.error;return e.value})}static from(t,n){let r=Vc.get(t);return r||(r=new e(e=>t.subscribe(e)),r.fetchFresh=n,Vc.set(t,r)),r}},Vc=new WeakMap,Hc=class extends pt{then(e,t){return hn(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)}run(e){return new Promise((t,n)=>{let r;this.subscribe({next:t=>{r=t,e(t)},error:n,complete:()=>{r?.phase===`finished`?t({resourceId:r.resourceId}):n(Error(`UploadObservable completed on a non-finished event: ${r?.phase??`<none>`}`))}})})}},Uc=e=>e.status===`ready`,Wc=e=>e.status===`ready`?e.value:void 0;function Gc(e,t){let n=t?.persister,r=n?.load()??new Map,i=new wt(r),a=new Set(r.keys()),o=new Map,s=new Map,c=!1,l=new Map,u=new St,d=e=>e instanceof Error?e:Error(String(e)),f=t?.saveDebounceMs??50,p=null,m=null,h=e=>{try{n?.save(e)}catch(e){console.warn(`[cache PERSIST] save failed; persistence skipped (best-effort):`,e instanceof Error?e.message:e)}},g=!1;n&&(i.pipe(Ln(1)).subscribe(e=>{c||g||(p!==null&&clearTimeout(p),p=setTimeout(()=>{p=null,h(e)},f))}),m=n.subscribe?.(e=>{if(!c){g=!0;try{i.next(new Map(e))}finally{g=!1}}})??null);let _=t=>{a.delete(t);let n=o.get(t);if(n)return n;let r;return r=(async()=>{try{let n=await e(t);l.delete(t);let r=new Map(i.value);return r.set(t,n),i.next(r),n}finally{o.get(t)===r&&o.delete(t)}})(),o.set(t,r),r},v=e=>{c||_(e).catch(t=>{c||(console.warn(`[cache RETRY] SWR fetch failed for key ${String(e)}; re-issuing once (B14):`,t instanceof Error?t.message:t),_(e).catch(t=>{if(!c&&(console.warn(`[cache IDLE] retry also failed for key ${String(e)}; going idle until the next observe()/invalidate() (B14):`,t instanceof Error?t.message:t),!i.value.has(e))){let n=d(t);l.set(e,n),u.next({key:e,error:n})}}))})};return{observe(e){let t=s.get(e);if(!t){let n=Dn(i.pipe(xn(t=>t.has(e)?{status:`ready`,value:t.get(e)}:{status:`pending`}),Nn((e,t)=>e.status===t.status&&(e.status!==`ready`||Object.is(e.value,t.value)))),u.pipe(On(t=>t.key===e),xn(e=>({status:`failed`,error:e.error}))));t=new pt(t=>(c||(l.has(e)?(l.delete(e),v(e)):(a.has(e)||!i.value.has(e)&&!o.has(e))&&v(e)),n.subscribe(t))),s.set(e,t)}return t},fetch(e){return c?Promise.reject(Error(`Cache disposed`)):_(e)},get(e){return i.value.get(e)},keys(){return[...i.value.keys()]},invalidate(e){c||(o.delete(e),l.delete(e),v(e))},remove(e){if(c)return;a.delete(e);let t=new Map(i.value);t.delete(e),i.next(t),o.delete(e),l.delete(e)},set(e,t){if(c)return;l.delete(e),a.delete(e);let n=new Map(i.value);n.set(e,t),i.next(n)},invalidateAll(){if(!c)for(let e of i.value.keys())o.delete(e),v(e)},persistencePending(){return o.size>0||p!==null},dispose(){c||(c=!0,p!==null&&(clearTimeout(p),p=null,h(i.value)),m?.(),a.clear(),i.complete(),u.complete(),l.clear(),s.clear(),o.clear())}}}function Kc(e,t){let n=new Map,r=null,i=()=>{let n=e.get(t);if(!n)return{};try{let e=JSON.parse(n);return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(([,e])=>typeof e==`string`))}catch{return{}}};return{storage:{get:t=>e.get(t),set:(a,o)=>{if(e.set(a,o),n.size>0&&(r===null||r())){let r={...i(),...Object.fromEntries(n)};e.set(t,JSON.stringify(r)),n.clear()}},delete:t=>e.delete(t),...e.subscribe?{subscribe:e.subscribe.bind(e)}:{}},saveLastEventId:(e,t)=>{n.set(e,t)},loadLastEventIds:()=>{let e=i();return Object.keys(e).length>0?e:null},setFlushGate:e=>{r=e}}}var qc=2097152;function Jc(e,t){if(!e)return null;try{let n=JSON.parse(e);return typeof n!=`object`||!n||n.version!==t||!Array.isArray(n.entries)?null:n}catch{return null}}function Yc(e){let{storage:t,storageKey:n,version:r}=e,i=e.maxBytes??qc,a=e.keyToJson??(e=>e),o=e.jsonToKey??(e=>e),s=new Map,c=e=>{s=new Map(e.entries.map(([e,t,n])=>[JSON.stringify(e),{valueJson:JSON.stringify(t),writtenAt:n}]))},l=e=>new Map(e.entries.map(([e,t])=>[o(e),t]));return{load(){let e=Jc(t.get(n),r);return e?(c(e),l(e)):null},save(e){let o=Date.now(),c=[],l=new Map;for(let[t,n]of e){let e=a(t),r=JSON.stringify(e),i=JSON.stringify(n),u=s.get(r),d=u!==void 0&&u.valueJson===i?u.writtenAt:o;l.set(r,{valueJson:i,writtenAt:d}),c.push([e,n,d])}let u=new TextEncoder,d=e=>u.encode(JSON.stringify({version:r,writtenAt:o,entries:e})).length;if(d(c)>i)for(c=[...c].sort((e,t)=>e[2]-t[2]);c.length>0&&d(c)>i;){let[e]=c.splice(0,1);e&&l.delete(JSON.stringify(e[0]))}s=l,t.set(n,JSON.stringify({version:r,writtenAt:o,entries:c}))},subscribe(e){return t.subscribe?.((t,i)=>{if(t!==n)return;let a=Jc(i,r);a&&(c(a),e(l(a)))})??(()=>{})}}}var Xc=1,Zc=`_`,Qc=`_`,$c=`_`,el=class{constructor(e,t,n,r){this.transport=e,this.bus=t,this.content=n,this.busTimeoutMs=r?.busTimeoutMs;let i=r?.cachePersistence,a=e=>i?{persister:Yc({storage:i.storage,storageKey:`semiont.cache.${i.keyPrefix}.${e}`,version:Xc})}:void 0,o=e=>(i&&this.persistedCaches.push(e),e);this.resourceCache=o(Gc(async e=>(await qr(this.transport,`browse:resource-requested`,{resourceId:e},this.busTimeoutMs)).resource,a(`resource`))),this.resourceListCache=Gc(async e=>{let t=this.resourceListFilters.get(e)??{},n=t.search?Kn(t.search):void 0,r=await qr(this.transport,`browse:resources-requested`,{search:n,archived:t.archived,entityType:t.entityType,limit:t.limit??100,offset:0},this.busTimeoutMs);return{...r,resources:r.resources}}),this.annotationListCache=o(Gc(async e=>qr(this.transport,`browse:annotations-requested`,{resourceId:e},this.busTimeoutMs),a(`annotations`))),this.annotationDetailCache=o(Gc(async e=>{let t=this.annotationResources.get(e);if(!t)throw Error(`Cannot fetch annotation ${e}: no resourceId known`);return(await qr(this.transport,`browse:annotation-requested`,{resourceId:t,annotationId:e},this.busTimeoutMs)).annotation},a(`annotation-detail`))),this.entityTypesCache=o(Gc(async()=>(await qr(this.transport,`browse:entity-types-requested`,{},this.busTimeoutMs)).entityTypes,a(`entity-types`))),this.tagSchemasCache=o(Gc(async()=>(await qr(this.transport,`browse:tag-schemas-requested`,{},this.busTimeoutMs)).tagSchemas,a(`tag-schemas`))),this.agentsCache=Gc(async()=>(await qr(this.transport,`browse:agents-requested`,{},this.busTimeoutMs)).agents),this.referencedByCache=Gc(async e=>(await qr(this.transport,`browse:referenced-by-requested`,{resourceId:e},this.busTimeoutMs)).referencedBy),this.resourceEventsCache=Gc(async e=>(await qr(this.transport,`browse:events-requested`,{resourceId:e},this.busTimeoutMs)).events),this.subscribeToEvents()}transport;bus;content;resourceCache;resourceListCache;annotationListCache;annotationDetailCache;annotationResources=new Map;entityTypesCache;tagSchemasCache;agentsCache;referencedByCache;resourceEventsCache;resourceListFilters=new Map;annotationListObs=new Map;scopedSources=new WeakMap;busTimeoutMs;busSubs=[];persistedCaches=[];withScope(e,t){let n=this.scopedSources.get(t);return n||(n=new pt(n=>{let r=this.transport.subscribeToResource(e),i=t.subscribe(n);return()=>{i.unsubscribe(),r()}}),this.scopedSources.set(t,n)),n}resource(e){return Bc.from(this.withScope(e,this.resourceCache.observe(e)),()=>this.resourceCache.fetch(e))}resources(e){let t=JSON.stringify(e??{});return this.resourceListFilters.set(t,e??{}),Bc.from(this.resourceListCache.observe(t),()=>this.resourceListCache.fetch(t))}annotations(e){let t=this.annotationListObs.get(e);return t||(t=this.annotationListCache.observe(e).pipe(xn(e=>e.status===`ready`?{status:`ready`,value:e.value.annotations}:e)),this.annotationListObs.set(e,t)),Bc.from(this.withScope(e,t),()=>this.annotationListCache.fetch(e).then(e=>e.annotations))}annotation(e,t){return this.annotationResources.set(t,e),Bc.from(this.withScope(e,this.annotationDetailCache.observe(t)),()=>this.annotationDetailCache.fetch(t))}entityTypes(){return Bc.from(this.entityTypesCache.observe(Zc),()=>this.entityTypesCache.fetch(Zc))}tagSchemas(){return Bc.from(this.tagSchemasCache.observe(Qc),()=>this.tagSchemasCache.fetch(Qc))}agents(){return Bc.from(this.agentsCache.observe($c),()=>this.agentsCache.fetch($c))}referencedBy(e){return Bc.from(this.withScope(e,this.referencedByCache.observe(e)),()=>this.referencedByCache.fetch(e))}events(e){return Bc.from(this.withScope(e,this.resourceEventsCache.observe(e)),()=>this.resourceEventsCache.fetch(e))}async resourceContent(e){let t=await this.content.getBinary(e);return pi(t.data,t.contentType)}async resourceAnchoredText(e){return qr(this.transport,`browse:anchored-text-requested`,{resourceId:e},this.busTimeoutMs)}async resourceGraph(e){return this.content.getResourceGraph(e)}async resourceRepresentation(e){return this.content.getBinary(e)}async resourceRepresentationStream(e){return this.content.getBinaryStream(e)}async resourceEvents(e){return(await qr(this.transport,`browse:events-requested`,{resourceId:e},this.busTimeoutMs)).events}async annotationHistory(e,t){return qr(this.transport,`browse:annotation-history-requested`,{resourceId:e,annotationId:t},this.busTimeoutMs)}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 qr(this.transport,`browse:directory-requested`,{path:e??`.`,sort:t??`name`},this.busTimeoutMs)}click(e,t){this.bus.get(`browse:click`).next({annotationId:e,...t?{anchorRect:t}:{}})}openResource(e){this.bus.get(`browse:resource-open`).next({resourceId:e})}resourceViewed(e){this.transport.emit(`browse:resource-viewed`,{resourceId:e}).catch(()=>{})}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(Zc)}invalidateTagSchemas(){this.tagSchemasCache.invalidate(Qc)}invalidateAgents(){this.agentsCache.invalidate($c)}persistenceSettled(){return this.persistedCaches.every(e=>!e.persistencePending())}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=lr(t.id);this.annotationResources.set(r,e),this.annotationDetailCache.set(r,t)}on(e,t){this.busSubs.push(this.bus.get(e).subscribe(t))}dispose(){for(let e of this.busSubs)e.unsubscribe();this.busSubs.length=0,this.resourceCache.dispose(),this.resourceListCache.dispose(),this.annotationListCache.dispose(),this.annotationDetailCache.dispose(),this.entityTypesCache.dispose(),this.tagSchemasCache.dispose(),this.agentsCache.dispose(),this.referencedByCache.dispose(),this.resourceEventsCache.dispose(),this.annotationResources.clear(),this.resourceListFilters.clear(),this.annotationListObs.clear()}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())};invalidateMutatedResource=e=>{let t=cr(e);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.invalidateAgents()}),this.on(`mark:delete-ok`,e=>{this.removeAnnotationDetail(lr(e.response.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(lr(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:created`,e=>this.invalidateMutatedResource(e.resourceId)),this.on(`yield:updated`,e=>this.invalidateMutatedResource(e.resourceId)),this.on(`yield:cloned`,e=>this.invalidateMutatedResource(e.resourceId)),this.on(`yield:moved`,e=>this.invalidateMutatedResource(e.resourceId)),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())}},tl=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;async annotation(e){let t=cr(e.target.source);return{annotationId:lr((await qr(this.transport,`mark:create-request`,{resourceId:t,request:e})).annotationId)}}async delete(e,t){await qr(this.transport,`mark:delete`,{annotationId:t,resourceId:e})}async archive(e){await qr(this.transport,`mark:archive`,{resourceId:e})}async unarchive(e){await qr(this.transport,`mark:unarchive`,{resourceId:e})}async updateEntityTypes(e,t,n){await qr(this.transport,`mark:update-entity-types`,{resourceId:e,currentEntityTypes:t,updatedEntityTypes:n})}assist(e,t,n){return new zc(r=>{let i=!1,a=null,o=null,s=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null)},c=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||qr(this.transport,`job:status-requested`,{jobId:t}).then(n=>{i||(n.status===`complete`?(s(),r.next({kind:`complete`,data:{jobId:t,jobType:n.type??`annotation`,resourceId:e,result:n.result}}),r.complete()):n.status===`failed`&&(s(),r.error(Error(n.error??`Job failed`))))}).catch(()=>{})},5e3))},1e4)},l=null,u=this.bus.get(`job:report-progress`).pipe(On(e=>e.jobId===l)),d=this.bus.get(`job:complete`).pipe(On(e=>e.jobId===l)),f=this.bus.get(`job:fail`).pipe(On(e=>e.jobId===l)),p=f.pipe(On(e=>e.willRetry!==!0)),m=u.pipe(Bn(Dn(d,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),l&&c(l)}),h=d.subscribe(e=>{s(),r.next({kind:`complete`,data:e}),r.complete()}),g=f.subscribe(e=>{if(e.willRetry===!0){r.next({kind:`failed`,data:e}),a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null);return}s(),r.error(Error(e.error))});return this.dispatchAssist(e,t,n).then(({jobId:e})=>{e&&!i&&(l=e,c(e))}).catch(e=>{i||(s(),r.error(e))}),()=>{s(),m.unsubscribe(),h.unsubscribe(),g.unsubscribe()}})}request(e,t,n){this.bus.get(`mark:requested`).next({source:e,selector:t,motivation:n})}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)}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),qr(this.transport,`job:create`,{jobType:r,resourceId:e,params:i})}},nl=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;async body(e,t,n){await qr(this.transport,`bind:update-body`,{annotationId:t,resourceId:e,operations:n})}initiate(e){this.bus.get(`bind:initiate`).next(e)}reportBodyError(e){this.bus.get(`bind:body-error`).next(e)}},rl=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;annotation(e,t,n){return new zc(r=>{let i=hr(),a=this.bus.get(`gather:complete`).pipe(On(e=>e.correlationId===i)),o=this.bus.get(`gather:failed`).pipe(On(e=>e.correlationId===i)),s=Dn(this.bus.get(`gather:annotation-progress`).pipe(On(e=>e.annotationId===t),xn(e=>e)),a.pipe(xn(e=>e))).pipe(Bn(Dn(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){return qr(this.transport,`gather:resource-requested`,{resourceId:e,options:{depth:t?.depth??2,maxResources:t?.maxResources??10,includeContent:t?.includeContent??!0,includeSummary:t?.includeSummary??!1,...t?.excludeEntityTypes?.length?{excludeEntityTypes:t.excludeEntityTypes}:{}}})}},il=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;requestSearch(e){this.bus.get(`match:search-requested`).next(e)}search(e,t,n,r){return new zc(i=>{let a=hr(),o=this.bus.get(`match:search-results`).pipe(On(e=>e.correlationId===a)),s=this.bus.get(`match:search-failed`).pipe(On(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()}})}},al=12e4;function ol(e){return Math.max(al,(e??500)*75)}var sl=class extends Gr{constructor(e,t){super(`generation stalled: no event within ${e}ms \u2014 cancel requested`,`generation-stall`,{deadlineMs:e,jobId:t}),this.deadlineMs=e,this.jobId=t,this.name=`GenerationStallError`}deadlineMs;jobId},cl=class{constructor(e,t,n){this.transport=e,this.bus=t,this.content=n}transport;bus;content;resource(e){let t=typeof Buffer<`u`&&e.file instanceof Buffer?e.file.length:e.file.size;return new Hc(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:cr(e.resourceId)}),n.complete())}).catch(e=>{r||n.error(e)}),()=>{r=!0,i.abort()}})}fromContext(e,t){let n=e?.focus,r=n?.kind===`resource`&&typeof n.resource?.[`@id`]==`string`?n.resource[`@id`]:n?.kind===`annotation`&&typeof n.sourceResource?.[`@id`]==`string`?n.sourceResource[`@id`]:void 0;if(r===void 0)throw Error(`yield.fromContext: context has no usable focus — pass a GatheredContext produced by gather.resource(...) or gather.annotation(...).`);let{stallDeadlineMs:i,...a}=t,o=i??ol(t.maxTokens);return this.runGeneration(cr(r),{...a,context:e},o)}runGeneration(e,t,n){return new zc(r=>{let i=!1,a=null,o=null,s=null,c=()=>{i=!0,a&&=(clearTimeout(a),null),o&&=(clearInterval(o),null),s&&=(clearTimeout(s),null)},l=t=>{a&&clearTimeout(a),o&&=(clearInterval(o),null),a=setTimeout(()=>{i||(o=setInterval(()=>{i||qr(this.transport,`job:status-requested`,{jobId:t}).then(n=>{i||(n.status===`complete`?(c(),r.next({kind:`complete`,data:{jobId:t,jobType:n.type??`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(On(e=>e.jobId===u)),f=this.bus.get(`job:complete`).pipe(On(e=>e.jobId===u)),p=this.bus.get(`job:fail`).pipe(On(e=>e.jobId===u)),m=()=>{s&&clearTimeout(s),s=setTimeout(()=>{if(i)return;let e=u;c(),qr(this.transport,`job:cancel-requested`,{jobType:`generation`}).catch(()=>{}),r.error(new sl(n,e))},n)},h=d.pipe(Bn(Dn(f,p))).subscribe(e=>{e.progress&&r.next({kind:`progress`,data:e.progress}),u&&l(u),m()}),g=f.subscribe(e=>{c(),r.next({kind:`complete`,data:e}),r.complete()}),_=p.subscribe(e=>{c(),r.error(Error(e.error))});return m(),qr(this.transport,`job:create`,{jobType:`generation`,params:t}).then(({jobId:e})=>{e&&!i&&(u=e,l(e))}).catch(e=>{i||(c(),r.error(e))}),()=>{c(),h.unsubscribe(),g.unsubscribe(),_.unsubscribe()}})}async cloneToken(e){return qr(this.transport,`yield:clone-token-requested`,{resourceId:e})}async fromToken(e){return(await qr(this.transport,`yield:clone-resource-requested`,{token:e})).sourceResource}async createFromToken(e){let t=xi(Vr(await this.fromToken(e.token))?.mediaType),n=typeof Buffer<`u`?Buffer.from(e.content):new File([e.content],e.name,{type:t});return this.content.putBinary({name:e.name,file:n,format:t,storageUri:ji(e.name,t),cloneToken:e.token,...e.archiveOriginal===void 0?{}:{archiveOriginal:e.archiveOriginal}})}clone(){this.bus.get(`yield:clone`).next(void 0)}},ll=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;attention(e,t){return this.transport.emit(`beckon:focus`,{annotationId:t,resourceId:e})}openResource(e){return this.transport.emit(`browse:resource-open`,{resourceId:e})}click(e){return this.transport.emit(`browse:click`,{annotationId:e})}sparkleAll(e){return this.transport.emit(`beckon:sparkle`,{annotationId:e})}hover(e){this.bus.get(`beckon:hover`).next({annotationId:e})}sparkle(e){this.bus.get(`beckon:sparkle`).next({annotationId:e})}},ul=class{constructor(e){this.transport=e}transport;async addEntityType(e){await qr(this.transport,`frame:add-entity-type`,{tag:e})}async addEntityTypes(e){for(let t of e)await qr(this.transport,`frame:add-entity-type`,{tag:t})}async addTagSchema(e){await qr(this.transport,`frame:add-tag-schema`,{schema:e})}},dl=class{constructor(e,t){this.transport=e,this.bus=t}transport;bus;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 qr(this.transport,`job:status-requested`,{jobId:e})}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){let{cancelled:t}=await qr(this.transport,`job:cancel-requested`,{jobType:e});return t}async cancel(e){let{cancelled:t}=await qr(this.transport,`job:cancel-requested`,{jobId:e});return t}cancelRequest(e){this.bus.get(`job:cancel-requested`).next({jobType:e})}},fl=class{constructor(e){this.gateway=e}gateway;async password(e,t){return this.gateway.authenticatePassword(Vn(e),t)}async google(e){return this.gateway.authenticateGoogle(Hn(e))}async refresh(e){return this.gateway.refreshAccessToken(Wn(e))}async logout(){await this.gateway.logout()}async me(){return this.gateway.getCurrentUser()}async acceptTerms(){await this.gateway.acceptTerms()}async mediaToken(e){return this.gateway.getMediaToken(e)}},pl=class{constructor(e){this.gateway=e}gateway;async users(){return(await this.gateway.listUsers()).users}async userStats(){return this.gateway.getUserStats()}async updateUser(e,t){return(await this.gateway.updateUser(e,t)).user}async oauthConfig(){return this.gateway.getOAuthConfig()}async healthCheck(){return this.gateway.healthCheck()}async status(){return this.gateway.getStatus()}},ml=class e{transport;content;bus;baseUrl;frame;browse;mark;bind;gather;match;yield;beckon;job;auth;admin;constructor(e,t,n,r){this.transport=e,this.content=t,this.baseUrl=e.baseUrl,this.bus=new or,this.transport.bridgeInto(this.bus),this.frame=new ul(this.transport),this.browse=new el(this.transport,this.bus,this.content,{...r?.cachePersistence?{cachePersistence:r.cachePersistence}:{},...r?.busTimeoutMs===void 0?{}:{busTimeoutMs:r.busTimeoutMs}}),this.mark=new tl(this.transport,this.bus),this.bind=new nl(this.transport,this.bus),this.gather=new rl(this.transport,this.bus),this.match=new il(this.transport,this.bus),this.yield=new cl(this.transport,this.bus,this.content),this.beckon=new ll(this.transport,this.bus),this.job=new dl(this.transport,this.bus),this.auth=n?new fl(n):void 0,this.admin=n?new pl(n):void 0}get state$(){return this.transport.state$}dispose(){this.browse.dispose(),this.transport.dispose(),this.content.dispose(),this.bus.destroy()}static fromHttp(t){let n=new Fc({baseUrl:typeof t.baseUrl==`string`?qn(t.baseUrl):t.baseUrl,token$:new wt(t.token==null?null:typeof t.token==`string`?Un(t.token):t.token)}),r=new Ic(n);return new e(n,r,n)}},hl=`semiont.session.`,gl=`semiont.knowledgeBases`,_l=`semiont.activeKnowledgeBaseId`,vl=`semiont.openResourcesByKb`,yl=`semiont.lastViewedResourceByKb`,bl=3e5;function xl(e){return`${hl}${e}`}function Sl(e,t){let n=e.get(xl(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 Cl(e,t,n){e.set(xl(t),JSON.stringify(n))}function wl(e,t){e.delete(xl(t))}function Tl(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 El(e){let t=Tl(e);return!t||t.getTime()<Date.now()}function Dl(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||typeof t.label!=`string`||typeof t.email!=`string`||typeof t.did!=`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`}function Ol(e){try{let t=e.get(gl);return t?JSON.parse(t).filter(Dl):[]}catch{return[]}}function kl(e,t){e.set(gl,JSON.stringify(t))}function Al(e){return e===`localhost`||e===`127.0.0.1`?`http`:`https`}var jl=/^(([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 Ml(e){return jl.test(e)}function Nl(e){if(!Ml(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 Pl(){return hr()}var Fl=class extends Gr{kbId;constructor(e,t,n=null){super(t,e,{kbId:n}),this.name=`SemiontSessionError`,this.kbId=n}},Il=0,Ll=class e{id;kb;client;token$;user$;streamState$;errors$;ready;storage;doRefresh;doValidate;onAuthFailed;onError;refreshTimer=null;unsubscribeStorage=null;disposed=!1;constructor(e){this.id=`session-${++Il}`,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 wt(null),this.errors$=this.client.transport.errors$;let t=Sl(this.storage,this.kb.id);t&&!El(t.access)&&this.token$.getValue()===null&&this.token$.next(Un(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=El(e.access)?(await this.tryRefresh()).token:e.access;if(!t){El(e.access)&&wl(this.storage,this.kb.id);return}if(t!==e.access&&(this.token$.next(Un(t)),this.scheduleProactiveRefresh(t)),!this.doValidate)return;let n=async e=>{if(!this.disposed)try{let t=await this.doValidate(Un(e));if(this.disposed)return;this.user$.next(t)}catch(e){if(this.disposed)return;if(e instanceof Ec&&e.status===401){let e=(await this.tryRefresh()).token;if(this.disposed)return;if(e){this.token$.next(Un(e)),this.scheduleProactiveRefresh(e),await n(e);return}wl(this.storage,this.kb.id),this.token$.next(null),this.onAuthFailed(`Your session has expired. Please sign in again.`)}else this.onError(new Fl(`session.auth-failed`,e instanceof Error?e.message:String(e),this.kb.id))}};await n(t)}async tryRefresh(){if(!this.doRefresh)return{token:null};try{return{token:await this.doRefresh()}}catch(e){return{token:null,failure:e instanceof Error?e.message:String(e)}}}async refresh(){if(this.disposed||!this.doRefresh)return null;let{token:e,failure:t}=await this.tryRefresh();if(this.disposed)return null;if(e){let t=Un(e);return this.token$.next(t),this.scheduleProactiveRefresh(e),t}return this.token$.next(null),wl(this.storage,this.kb.id),this.onAuthFailed(`Your session has expired. Please sign in again.`),this.onError(new Fl(`session.refresh-exhausted`,t?`Token refresh failed: ${t}`:`Token refresh failed`,this.kb.id)),null}scheduleProactiveRefresh(e){this.clearRefreshTimer();let t=Tl(e);if(!t)return;let n=t.getTime()-bl,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===xl(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(Un(e.access)),this.scheduleProactiveRefresh(e.access))}catch{}}}get expiresAt(){let e=this.token$.getValue();return e?Tl(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`?qn(t.baseUrl):t.baseUrl,r=new wt(t.token==null?null:typeof t.token==`string`?Un(t.token):t.token),i=new Fc({baseUrl:n,token$:r}),a=new ml(i,new Ic(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`?qn(t.baseUrl):t.baseUrl,r=new wt(null),i=new Fc({baseUrl:n,token$:r}),a=new ml(i,new Ic(i),i),o;try{o=await a.auth.password(t.email,t.password)}catch(e){throw a.dispose(),e}Cl(t.storage,t.kb.id,{access:o.token,refresh:o.refreshToken}),r.next(Un(o.token));let s={kb:t.kb,storage:t.storage,client:a,token$:r,refresh:async()=>{let e=Sl(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}},Rl=class{sessionExpiredAt$;sessionExpiredMessage$;permissionDeniedAt$;permissionDeniedMessage$;constructor(){this.sessionExpiredAt$=new wt(null),this.sessionExpiredMessage$=new wt(null),this.permissionDeniedAt$=new wt(null),this.permissionDeniedMessage$=new wt(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()}};function zl(e){return[...e].sort((e,t)=>e.order!==void 0&&t.order!==void 0?e.order-t.order:e.openedAt-t.openedAt)}function Bl(e){try{let t=e.get(vl);if(t)return JSON.parse(t)}catch{}return{}}function Vl(e){try{let t=e.get(yl);if(t)return JSON.parse(t)}catch{}return{}}var Hl=class{kbs$;activeKbId$;activeSession$;activeSignals$;sessionActivating$;openResources$;lastViewedResource$;error$;identityToken$;storage;sessionFactory;eventBus=new or;unsubscribeStorage=null;disposed=!1;activating=null;openByKb={};lastViewedByKb={};constructor(e){this.storage=e.storage,this.sessionFactory=e.sessionFactory;let t=Ol(this.storage),n=this.storage.get(_l),r=n&&t.some(e=>e.id===n)?n:t[0]?.id??null;this.kbs$=new wt(t),this.activeKbId$=new wt(r),this.activeSession$=new wt(null),this.activeSignals$=new wt(null),this.sessionActivating$=new wt(!1),this.openByKb=Bl(this.storage),this.openResources$=new wt([]),this.lastViewedByKb=Vl(this.storage),this.lastViewedResource$=new wt(null),this.error$=new St,this.identityToken$=new wt(null),this.kbs$.subscribe(e=>kl(this.storage,e)),this.activeKbId$.subscribe(e=>{e?this.storage.set(_l,e):this.storage.delete(_l)}),this.activeSession$.subscribe(()=>{this.refreshOpenResources(),this.refreshLastViewedResource()}),this.unsubscribeStorage=this.storage.subscribe?.((e,t)=>{if(t)try{e===`semiont.openResourcesByKb`?(this.openByKb=JSON.parse(t),this.refreshOpenResources()):e===`semiont.lastViewedResourceByKb`&&(this.lastViewedByKb=JSON.parse(t),this.refreshLastViewedResource())}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:Pl(),...e};return Cl(this.storage,r.id,{access:t,refresh:n}),this.kbs$.next([...this.kbs$.getValue(),r]),this.setActiveKb(r.id),r}removeKb(e){if(wl(this.storage,e),this.openByKb[e]){let t={...this.openByKb};delete t[e],this.openByKb=t,this.persistOpenResources()}if(this.lastViewedByKb[e]){let t={...this.lastViewedByKb};delete t[e],this.lastViewedByKb=t,this.storage.set(yl,JSON.stringify(this.lastViewedByKb))}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=Sl(this.storage,e);return t?El(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 Rl,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 Fl?t:new Fl(`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 Fl(`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(Cl(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&&(wl(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()}}refreshOpenResources(){let e=this.activeKbId$.getValue(),t=this.activeSession$.getValue(),n=e&&t?zl(this.openByKb[e]??[]):[];this.openResources$.next(n)}persistOpenResources(){this.storage.set(vl,JSON.stringify(this.openByKb))}mutateOpenResources(e){let t=this.activeKbId$.getValue();!t||!this.activeSession$.getValue()||(this.openByKb={...this.openByKb,[t]:e(this.openByKb[t]??[])},this.persistOpenResources(),this.refreshOpenResources())}addOpenResource(e,t,n,r){this.mutateOpenResources(i=>{let 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];return o[a]=e,o}return[...i,{id:e,name:t,openedAt:Date.now(),order:i.reduce((e,t)=>Math.max(e,t.order??-1),-1)+1,...n===void 0?{}:{mediaType:n},...r===void 0?{}:{storageUri:r}}]})}removeOpenResource(e){this.mutateOpenResources(t=>t.filter(t=>t.id!==e))}updateOpenResourceName(e,t){this.mutateOpenResources(n=>n.map(n=>n.id===e?{...n,name:t}:n))}reorderOpenResources(e,t){this.mutateOpenResources(n=>{let r=zl(n);if(e<0||e>=r.length||t<0||t>=r.length)return n;let[i]=r.splice(e,1);return i&&r.splice(t,0,i),r.map((e,t)=>({...e,order:t}))})}refreshLastViewedResource(){let e=this.activeKbId$.getValue(),t=this.activeSession$.getValue();this.lastViewedResource$.next(e&&t?this.lastViewedByKb[e]??null:null)}setLastViewedResource(e){let t=this.activeKbId$.getValue();!t||!this.activeSession$.getValue()||this.lastViewedByKb[t]!==e&&(this.lastViewedByKb={...this.lastViewedByKb,[t]:e},this.storage.set(yl,JSON.stringify(this.lastViewedByKb)),this.refreshLastViewedResource())}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.lastViewedResource$.complete(),this.error$.complete(),this.identityToken$.complete(),this.eventBus.destroy()}};function Ul(){let e=new Map;return t=>{let{kb:n,storage:r,signals:i,onError:a}=t;if(n.endpoint.kind!==`http`)throw new Fl(`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=Sl(r,n.id);if(!e)return null;let t=new Fc({baseUrl:qn(Nl(o))}),i=new ml(t,new Ic(t),t);try{let t=(await i.auth.refresh(e.refresh)).access_token;return t?(Cl(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 wt(e),n=new Fc({baseUrl:qn(Nl(o)),token$:t}),r=new ml(n,new Ic(n),n);try{return await r.auth.me()}finally{r.dispose(),t.complete()}},l=new wt(null),u,d=Kc(r,`semiont.lastEventId.${n.id}`),f=new Fc({baseUrl:qn(Nl(o)),token$:l,tokenRefresher:()=>u.refresh().then(e=>e??null),loadLastEventIds:d.loadLastEventIds,saveLastEventId:d.saveLastEventId}),p=new ml(f,new Ic(f),f,{cachePersistence:{storage:d.storage,keyPrefix:n.id}});return d.setFlushGate(()=>p.browse.persistenceSettled()),u=new Ll({kb:n,storage:r,client:p,token$:l,refresh:s,validate:c,onAuthFailed:e=>i.notifySessionExpired(e),onError:a}),u}}var Wl=null;function Gl(e){return Wl||=new Hl({storage:e.storage,sessionFactory:e.sessionFactory}),Wl}function Kl(){let e=new Be;return{add:t=>e.add(typeof t==`function`?t:()=>t.dispose()),dispose:()=>e.unsubscribe()}}function ql(e,t={}){let n=t.debounceMs??250,r=t.initialQuery??``,i=new St;return{query$:i.pipe(Rn(r)),state$:i.pipe(Rn(r),An(n),Nn(),zn(t=>{let n=t.trim();return n?e(n).pipe(xn(e=>({results:e??[],isSearching:e===void 0})),Rn({results:[],isSearching:!0})):fn({results:[],isSearching:!1})})),setQuery:e=>i.next(e),dispose:()=>i.complete()}}function Jl(e){let t=[],n=new wt(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 Yl(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 Xl(e,t){let n=[],r=new wt(null),i=new wt(!1),a=new wt(null),o=new wt(null),s=new wt(null),c=new wt(!1),l=new wt(null),u=!1;return n.push(e.bus.get(`gather:requested`).subscribe(s=>{i.next(!0),a.next(null),r.next(null),o.next(lr(s.annotationId));let c=e.gather.annotation(t,lr(s.annotationId),{contextWindow:s.options?.contextWindow??2e3}).pipe(yn(6e4)).subscribe({next:e=>{`response`in e&&e.response&&(r.next(e.response??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(),resourceContext$:s.asObservable(),resourceLoading$:c.asObservable(),resourceError$:l.asObservable(),gatherResource:(t,n)=>{c.next(!0),l.next(null),s.next(null),e.gather.resource(t,n).then(e=>{u||(s.next(e),c.next(!1))}).catch(e=>{u||(l.next(e instanceof Error?e:Error(String(e))),c.next(!1))})},dispose(){u=!0,n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete(),o.complete(),s.complete(),c.complete(),l.complete()}}}function Zl(e,t){let n=[];return n.push(e.bus.get(`match:search-requested`).subscribe(t=>{let r=e.match.search(cr(t.resourceId),lr(t.referenceId),t.context,{limit:t.limit,useSemanticScoring:t.useSemanticScoring}).pipe(yn(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 Ql(e,t){let n=[],r=new wt(!1),i=new wt(null),a=new wt(null),o=e=>{let t=e.subscribe({next:e=>{e.kind===`progress`&&(i.next(e.data),r.next(!0)),e.kind===`complete`&&e.data.result?.kind===`generation`&&a.next({resourceId:cr(e.data.result.resourceId),resourceName:e.data.result.resourceName,truncated:e.data.result.truncated})},complete:()=>{r.next(!1)},error:()=>{i.next(null),r.next(!1)}});n.push(t)};return{isGenerating$:r.asObservable(),progress$:i.asObservable(),outcome$:a.asObservable(),generate:(n,r)=>{a.next(null),o(e.yield.fromContext(n,{...r,language:r.language||t}))},dismissProgress(){i.next(null),a.next(null)},dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete()}}}var $l=18e4;function eu(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 tu(e,t){let n=[],r=new wt(null),i=new wt(null),a=new wt(null),o=e=>{r.next(e)};return n.push(e.bus.get(`mark:requested`).subscribe(e=>{e.source===t&&o({selector:e.selector,motivation:e.motivation})})),n.push(e.bus.get(`mark:select-comment`).subscribe(e=>o({selector:eu(e),motivation:`commenting`}))),n.push(e.bus.get(`mark:select-tag`).subscribe(e=>o({selector:eu(e),motivation:`tagging`}))),n.push(e.bus.get(`mark:select-assessment`).subscribe(e=>o({selector:eu(e),motivation:`assessing`}))),n.push(e.bus.get(`mark:select-reference`).subscribe(e=>o({selector:eu(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=>{if(n.source===t)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({response:{annotationId:r.annotationId}})}catch(n){e.bus.get(`mark:create-error`).next({resourceId:t,message:n instanceof Error?n.message:String(n)})}})),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({response:{annotationId:n.annotationId}})}catch(n){e.bus.get(`mark:delete-error`).next({resourceId:t,message:n instanceof Error?n.message:String(n)})}})),n.push(e.bus.get(`mark:assist-request`).subscribe(r=>{i.next(r.motivation),a.next(null);let o=null,s=()=>{o&&=(clearTimeout(o),null)},c=()=>{s(),o=setTimeout(()=>{o=null;let n=a.getValue();a.next({...n??{},percentage:n?.percentage??0}),e.bus.get(`mark:assist-timeout`).next({resourceId:t,motivation:r.motivation})},$l)};c();let l=e.mark.assist(t,r.motivation,r.options).subscribe({next:e=>{c(),e.kind===`progress`&&a.next(e.data)},complete:()=>{s(),i.next(null)},error:()=>{s(),i.next(null),a.next(null)}});n.push(l)})),n.push(e.bus.get(`mark:progress-dismiss`).subscribe(()=>{a.next(null)})),{pendingAnnotation$:r.asObservable(),assistingMotivation$:i.asObservable(),progress$:a.asObservable(),dispose(){n.forEach(e=>e.unsubscribe()),r.complete(),i.complete(),a.complete()}}}var nu=(e,t)=>t===void 0?{kind:`absent`,reason:e}:{kind:`absent`,reason:e,diagnostic:t},ru=e=>e instanceof Error?e.message:String(e);function iu(e){let t;try{t=JSON.parse(e)}catch(e){return nu(`not-json`,ru(e))}if(!Ii(t))return nu(`invalid`,`document is not an object`);if(!Fi(t.version))return nu(`invalid`,`missing numeric "version"`);if(t.version!==1)return nu(`unsupported-version`,`discovery document version ${t.version} is newer than this client speaks (1) \u2014 refusing to partially parse`);if(!Li(t.kbs))return nu(`invalid`,`missing "kbs" array`);let n=[];for(let e of t.kbs){if(!Ii(e))return nu(`invalid`,`kb entry is not an object`);let{host:t,port:r,placement:i,managedBy:a,repo:o,did:s,siteName:c}=e;if(!Pi(t)||!Pi(a)||!Fi(r)||!Number.isInteger(r)||r<=0||r>65535)return nu(`invalid`,`kb entry missing required host/port/managedBy (port must be an integer 1-65535)`);if(i!==`local`&&i!==`codespace`)return nu(`invalid`,`kb entry has unknown placement ${JSON.stringify(i)}`);if(o!==void 0&&!Pi(o))return nu(`invalid`,`kb "repo" must be a string`);if(c!==void 0&&!Pi(c))return nu(`invalid`,`kb "siteName" must be a string`);if(!Pi(s))return nu(`invalid`,`kb entry has no "did" — identity is required; this document was likely written by a launcher predating that rule`);n.push({host:t,port:r,placement:i,managedBy:a,did:s,...o===void 0?{}:{repo:o},...c===void 0?{}:{siteName:c}})}return{kind:`managed`,kbs:n}}function au(e=Wi){let t=null;return{async read(){let n;try{n=await fetch(e,t===null?void 0:{headers:{"If-None-Match":t}})}catch(e){return nu(`unreadable`,ru(e))}if(n.status===304)return{kind:`unchanged`};if(!n.ok)return nu(`not-found`,`HTTP ${n.status}`);let r=n.headers.get(`Content-Type`)??``;if(!r.toLowerCase().includes(`json`))return nu(`not-found`,`non-JSON content-type "${r}" \u2014 SPA fallback (frontend image without the discovery mount?)`);let i=iu(await n.text());return i.kind===`managed`&&(t=n.headers.get(`ETag`)),i}}}var ou=e=>`${e.host}:${e.port}`,su=(e,t)=>e.host===t.host&&e.port===t.port&&e.placement===t.placement&&e.managedBy===t.managedBy&&e.repo===t.repo&&e.did===t.did&&e.siteName===t.siteName;function cu(e,t){let n=t?.intervalMs??5e3;return new pt(t=>{let r=!1,i=!1,a=null,o=async()=>{if(!(r||i)){i=!0;try{let n=await e.read();if(r||n.kind===`unchanged`)return;let i=a!==null&&a.kind===`managed`?a.kbs:[],o=n.kind===`managed`?n.kbs:[],s=new Map(i.map(e=>[ou(e),e])),c=new Map(o.map(e=>[ou(e),e]));if(c.size!==o.length){let e=new Set,t=[...new Set(o.map(ou).filter(t=>e.size===e.add(t).size))];console.warn(`[discovery DUPLICATE] ${o.length-c.size} entr${o.length-c.size===1?`y`:`ies`} share a merge key (${t.join(`, `)}); at most one claim can be true. Diff membership collapses them \u2014 render every claimant from state.kbs rather than trusting added/removed for these.`)}let l=o.filter(e=>!s.has(ou(e))),u=i.filter(e=>!c.has(ou(e))),d=o.filter(e=>{let t=s.get(ou(e));return t!==void 0&&!su(t,e)});(a===null||a.kind!==n.kind||a.kind===`absent`&&n.kind===`absent`&&a.reason!==n.reason||l.length>0||d.length>0||u.length>0)&&(a=n,t.next({state:n,added:l,updated:d,removed:u}))}finally{i=!1}}};o();let s=setInterval(()=>{o()},n);return()=>{r=!0,clearInterval(s)}})}var lu=f(),uu=z({"../../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}}),du=z({"../../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}}),fu=z({"../../node_modules/rxjs/dist/cjs/internal/util/UnsubscriptionError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UnsubscriptionError=void 0,e.UnsubscriptionError=du().createErrorClass(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
8
8
  `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
9
- `):``,this.name=`UnsubscriptionError`,this.errors=t}})}}),pu=z({"../../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}}),mu=z({"../../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=uu(),a=fu(),o=pu(),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()}}}),hu=z({"../../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}}}),gu=z({"../../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}}}),_u=z({"../../node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportUnhandledError=void 0;var t=hu(),n=gu();function r(e){n.timeoutProvider.setTimeout(function(){var n=t.config.onUnhandledError;if(n)n(e);else throw e})}e.reportUnhandledError=r}}),vu=z({"../../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}}),yu=z({"../../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}}),bu=z({"../../node_modules/rxjs/dist/cjs/internal/util/errorContext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.captureError=e.errorContext=void 0;var t=hu(),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}}),xu=z({"../../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=uu(),r=mu(),i=hu(),a=_u(),o=vu(),s=yu(),c=gu(),l=bu(),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}}}),Su=z({"../../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`})()}}),Cu=z({"../../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}}),wu=z({"../../node_modules/rxjs/dist/cjs/internal/util/pipe.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pipeFromArray=e.pipe=void 0;var t=Cu();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}}),Tu=z({"../../node_modules/rxjs/dist/cjs/internal/Observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var t=xu(),n=mu(),r=Su(),i=wu(),a=hu(),o=uu(),s=bu();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)}}}),B=z({"../../node_modules/rxjs/dist/cjs/internal/util/lift.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.operate=e.hasLift=void 0;var t=uu();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}}),V=z({"../../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=xu();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}}),Eu=z({"../../node_modules/rxjs/dist/cjs/internal/operators/refCount.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.refCount=void 0;var t=B(),n=V();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}}),Du=z({"../../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=Tu(),r=mu(),i=Eu(),a=V(),o=B();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)}}),Ou=z({"../../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}}}),ku=z({"../../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=mu();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}}}),Au=z({"../../node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrames=void 0;var t=Tu(),n=Ou(),r=ku();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()}}),ju=z({"../../node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectUnsubscribedError=void 0,e.ObjectUnsubscribedError=du().createErrorClass(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}})}}),Mu=z({"../../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=Tu(),i=mu(),a=ju(),o=pu(),s=bu(),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}}),Nu=z({"../../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})(Mu().Subject)}}),Pu=z({"../../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}}}),Fu=z({"../../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=Mu(),r=Pu();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)}}),Iu=z({"../../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})(Mu().Subject)}}),Lu=z({"../../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})(mu().Subscription)}}),Ru=z({"../../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}}}),zu=z({"../../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=Lu(),r=Ru(),i=pu();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)}}),Bu=z({"../../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)}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}}}}),Vu=z({"../../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=Bu(),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}}}),Hu=z({"../../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=zu(),r=Vu();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)}}),Uu=z({"../../node_modules/rxjs/dist/cjs/internal/Scheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scheduler=void 0;var t=Pu();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})()}}),Wu=z({"../../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=Uu();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)}}),Gu=z({"../../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})(Wu().AsyncScheduler)}}),Ku=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/asap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.asap=e.asapScheduler=void 0;var t=Hu();e.asapScheduler=new(Gu()).AsapScheduler(t.AsapAction),e.asap=e.asapScheduler}}),qu=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.async=e.asyncScheduler=void 0;var t=zu();e.asyncScheduler=new(Wu()).AsyncScheduler(t.AsyncAction),e.async=e.asyncScheduler}}),Ju=z({"../../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})(zu().AsyncAction)}}),Yu=z({"../../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})(Wu().AsyncScheduler)}}),Xu=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/queue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.queue=e.queueScheduler=void 0;var t=Ju();e.queueScheduler=new(Yu()).QueueScheduler(t.QueueAction),e.queue=e.queueScheduler}}),Zu=z({"../../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=zu(),r=ku();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)}}),Qu=z({"../../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})(Wu().AsyncScheduler)}}),$u=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrame=e.animationFrameScheduler=void 0;var t=Zu();e.animationFrameScheduler=new(Qu()).AnimationFrameScheduler(t.AnimationFrameAction),e.animationFrame=e.animationFrameScheduler}}),ed=z({"../../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=zu(),r=mu();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})(Wu().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)}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}}),td=z({"../../node_modules/rxjs/dist/cjs/internal/observable/empty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=e.EMPTY=void 0;var t=Tu();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()})})}}}),nd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isScheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isScheduler=void 0;var t=uu();function n(e){return e&&t.isFunction(e.schedule)}e.isScheduler=n}}),rd=z({"../../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=uu(),n=nd();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}}),id=z({"../../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`})}}),ad=z({"../../node_modules/rxjs/dist/cjs/internal/util/isPromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isPromise=void 0;var t=uu();function n(e){return t.isFunction(e?.then)}e.isPromise=n}}),od=z({"../../node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isInteropObservable=void 0;var t=Su(),n=uu();function r(e){return n.isFunction(e[t.observable])}e.isInteropObservable=r}}),sd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=void 0;var t=uu();function n(e){return Symbol.asyncIterator&&t.isFunction(e?.[Symbol.asyncIterator])}e.isAsyncIterable=n}}),cd=z({"../../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}}),ld=z({"../../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()}}),ud=z({"../../node_modules/rxjs/dist/cjs/internal/util/isIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterable=void 0;var t=ld(),n=uu();function r(e){return n.isFunction(e?.[t.iterator])}e.isIterable=r}}),dd=z({"../../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=uu();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}}),fd=z({"../../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=id(),o=ad(),s=Tu(),c=od(),l=sd(),u=cd(),d=ud(),f=dd(),p=uu(),m=_u(),h=Su();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]}})})}}}),pd=z({"../../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}}),md=z({"../../node_modules/rxjs/dist/cjs/internal/operators/observeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.observeOn=void 0;var t=pd(),n=B(),r=V();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}}),hd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.subscribeOn=void 0;var t=B();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}}),gd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleObservable=void 0;var t=fd(),n=md(),r=hd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.scheduleObservable=i}}),_d=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.schedulePromise=void 0;var t=fd(),n=md(),r=hd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.schedulePromise=i}}),vd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleArray=void 0;var t=Tu();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}}),yd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleIterable=void 0;var t=Tu(),n=ld(),r=uu(),i=pd();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}}),bd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleAsyncIterable=void 0;var t=Tu(),n=pd();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}}),xd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleReadableStreamLike=void 0;var t=bd(),n=dd();function r(e,r){return t.scheduleAsyncIterable(n.readableStreamLikeToAsyncGenerator(e),r)}e.scheduleReadableStreamLike=r}}),Sd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduled=void 0;var t=gd(),n=_d(),r=vd(),i=yd(),a=bd(),o=od(),s=ad(),c=id(),l=ud(),u=sd(),d=cd(),f=dd(),p=xd();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}}),Cd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/from.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.from=void 0;var t=Sd(),n=fd();function r(e,r){return r?t.scheduled(e,r):n.innerFrom(e)}e.from=r}}),wd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/of.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.of=void 0;var t=rd(),n=Cd();function r(){var e=[...arguments],r=t.popScheduler(e);return n.from(e,r)}e.of=r}}),Td=z({"../../node_modules/rxjs/dist/cjs/internal/observable/throwError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=void 0;var t=Tu(),n=uu();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}}),Ed=z({"../../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=td(),n=wd(),r=Td(),i=uu();(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}}),Dd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObservable=void 0;var t=Tu(),n=uu();function r(e){return!!e&&(e instanceof t.Observable||n.isFunction(e.lift)&&n.isFunction(e.subscribe))}e.isObservable=r}}),Od=z({"../../node_modules/rxjs/dist/cjs/internal/util/EmptyError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyError=void 0,e.EmptyError=du().createErrorClass(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}})}}),kd=z({"../../node_modules/rxjs/dist/cjs/internal/lastValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.lastValueFrom=void 0;var t=Od();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}}),Ad=z({"../../node_modules/rxjs/dist/cjs/internal/firstValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.firstValueFrom=void 0;var t=Od(),n=xu();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}}),jd=z({"../../node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ArgumentOutOfRangeError=void 0,e.ArgumentOutOfRangeError=du().createErrorClass(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}})}}),Md=z({"../../node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NotFoundError=void 0,e.NotFoundError=du().createErrorClass(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}})}}),Nd=z({"../../node_modules/rxjs/dist/cjs/internal/util/SequenceError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SequenceError=void 0,e.SequenceError=du().createErrorClass(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}})}}),Pd=z({"../../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}}),Fd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeout.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeout=e.TimeoutError=void 0;var t=qu(),n=Pd(),r=B(),i=fd(),a=du(),o=V(),s=pd();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)}}}),Id=z({"../../node_modules/rxjs/dist/cjs/internal/operators/map.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=void 0;var t=B(),n=V();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}}),Ld=z({"../../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=Id(),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}}),Rd=z({"../../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=nd(),i=Tu(),a=hd(),o=Ld(),s=md(),c=Iu();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}}),zd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindCallback=void 0;var t=Rd();function n(e,n,r){return t.bindCallbackInternals(!1,e,n,r)}e.bindCallback=n}}),Bd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindNodeCallback=void 0;var t=Rd();function n(e,n,r){return t.bindCallbackInternals(!0,e,n,r)}e.bindNodeCallback=n}}),Vd=z({"../../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}}}),Hd=z({"../../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}}),Ud=z({"../../node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestInit=e.combineLatest=void 0;var t=Tu(),n=Vd(),r=Cd(),i=Cu(),a=Ld(),o=rd(),s=Hd(),c=V(),l=pd();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()}}}),Wd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeInternals=void 0;var t=fd(),n=pd(),r=V();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}}),Gd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMap=void 0;var t=Id(),n=fd(),r=B(),i=Wd(),a=uu();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}}),Kd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAll=void 0;var t=Gd(),n=Cu();function r(e){return e===void 0&&(e=1/0),t.mergeMap(n.identity,e)}e.mergeAll=r}}),qd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatAll=void 0;var t=Kd();function n(){return t.mergeAll(1)}e.concatAll=n}}),Jd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/concat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concat=void 0;var t=qd(),n=rd(),r=Cd();function i(){var e=[...arguments];return t.concatAll()(r.from(e,n.popScheduler(e)))}e.concat=i}}),Yd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/defer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defer=void 0;var t=Tu(),n=fd();function r(e){return new t.Observable(function(t){n.innerFrom(e()).subscribe(t)})}e.defer=r}}),Xd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/connectable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connectable=void 0;var t=Mu(),n=Tu(),r=Yd(),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||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}}),Zd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.forkJoin=void 0;var t=Tu(),n=Vd(),r=fd(),i=rd(),a=V(),o=Ld(),s=Hd();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}}),Qd=z({"../../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=fd(),r=Tu(),i=Gd(),a=id(),o=uu(),s=Ld(),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)}}}),$d=z({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromEventPattern=void 0;var t=Tu(),n=uu(),r=Ld();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}}),ef=z({"../../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=Cu(),r=nd(),i=Yd(),a=yd();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}}),tf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/iif.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.iif=void 0;var t=Yd();function n(e,n,r){return t.defer(function(){return e()?n:r})}e.iif=n}}),nf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/timer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timer=void 0;var t=Tu(),n=qu(),r=nd(),i=Pd();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}}),rf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/interval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.interval=void 0;var t=qu(),n=nf();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}}),af=z({"../../node_modules/rxjs/dist/cjs/internal/observable/merge.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var t=Kd(),n=fd(),r=td(),i=rd(),a=Cd();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}}),of=z({"../../node_modules/rxjs/dist/cjs/internal/observable/never.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.never=e.NEVER=void 0;var t=Tu(),n=vu();e.NEVER=new t.Observable(n.noop);function r(){return e.NEVER}e.never=r}}),sf=z({"../../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}}),cf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.onErrorResumeNext=void 0;var t=Tu(),n=sf(),r=V(),i=vu(),a=fd();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}}),lf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/pairs.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairs=void 0;var t=Cd();function n(e,n){return t.from(Object.entries(e),n)}e.pairs=n}}),uf=z({"../../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}}),df=z({"../../node_modules/rxjs/dist/cjs/internal/operators/filter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=void 0;var t=B(),n=V();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}}),ff=z({"../../node_modules/rxjs/dist/cjs/internal/observable/partition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.partition=void 0;var t=uf(),n=df(),r=fd();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}}),pf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/race.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.raceInit=e.race=void 0;var t=Tu(),n=fd(),r=sf(),i=V();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}}),mf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/range.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=void 0;var t=Tu(),n=td();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}}),hf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/using.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.using=void 0;var t=Tu(),n=fd(),r=td();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}}),gf=z({"../../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=Tu(),i=fd(),a=sf(),o=td(),s=V(),c=rd();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}}),_f=z({"../../node_modules/rxjs/dist/cjs/internal/types.js"(e){Object.defineProperty(e,"__esModule",{value:!0})}}),vf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/audit.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.audit=void 0;var t=B(),n=fd(),r=V();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}}),yf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/auditTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.auditTime=void 0;var t=qu(),n=vf(),r=nf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.audit(function(){return r.timer(e,i)})}e.auditTime=i}}),bf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/buffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buffer=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),xf=z({"../../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=B(),r=V(),i=pu();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}}),Sf=z({"../../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=mu(),r=B(),i=V(),a=pu(),o=qu(),s=rd(),c=pd();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}}),Cf=z({"../../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=mu(),r=B(),i=fd(),a=V(),o=vu(),s=pu();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}}),wf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bufferWhen=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),Tf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/catchError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.catchError=void 0;var t=fd(),n=V(),r=B();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}}),Ef=z({"../../node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scanInternals=void 0;var t=V();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}}),Df=z({"../../node_modules/rxjs/dist/cjs/internal/operators/reduce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=void 0;var t=Ef(),n=B();function r(e,r){return n.operate(t.scanInternals(e,r,arguments.length>=2,!1,!0))}e.reduce=r}}),Of=z({"../../node_modules/rxjs/dist/cjs/internal/operators/toArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toArray=void 0;var t=Df(),n=B(),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}}),kf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.joinAllInternals=void 0;var t=Cu(),n=Ld(),r=wu(),i=Gd(),a=Of();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}}),Af=z({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestAll=void 0;var t=Ud(),n=kf();function r(e){return n.joinAllInternals(t.combineLatest,e)}e.combineLatestAll=r}}),jf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/combineAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineAll=void 0,e.combineAll=Af().combineLatestAll}}),Mf=z({"../../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=Ud(),i=B(),a=sf(),o=Ld(),s=wu(),c=rd();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}}),Nf=z({"../../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=Mf();function i(){var e=[...arguments];return r.combineLatest.apply(void 0,n([],t(e)))}e.combineLatestWith=i}}),Pf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMap=void 0;var t=Gd(),n=uu();function r(e,r){return n.isFunction(r)?t.mergeMap(e,r,1):t.mergeMap(e,1)}e.concatMap=r}}),Ff=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMapTo=void 0;var t=Pf(),n=uu();function r(e,r){return n.isFunction(r)?t.concatMap(function(){return e},r):t.concatMap(function(){return e})}e.concatMapTo=r}}),If=z({"../../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=B(),i=qd(),a=rd(),o=Cd();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}}),Lf=z({"../../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=If();function i(){var e=[...arguments];return r.concat.apply(void 0,n([],t(e)))}e.concatWith=i}}),Rf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromSubscribable=void 0;var t=Tu();function n(e){return new t.Observable(function(t){return e.subscribe(t)})}e.fromSubscribable=n}}),zf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/connect.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connect=void 0;var t=Mu(),n=fd(),r=B(),i=Rf(),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}}),Bf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/count.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.count=void 0;var t=Df();function n(e){return t.reduce(function(t,n,r){return!e||e(n,r)?t+1:t},0)}e.count=n}}),Vf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/debounce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),Hf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounceTime=void 0;var t=qu(),n=B(),r=V();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}}),Uf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultIfEmpty=void 0;var t=B(),n=V();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}}),Wf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/take.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=void 0;var t=td(),n=B(),r=V();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}}),Gf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ignoreElements=void 0;var t=B(),n=V(),r=vu();function i(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,r.noop))})}e.ignoreElements=i}}),Kf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapTo=void 0;var t=Id();function n(e){return t.map(function(){return e})}e.mapTo=n}}),qf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delayWhen=void 0;var t=Jd(),n=Wf(),r=Gf(),i=Kf(),a=Gd(),o=fd();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}}),Jf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/delay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0;var t=qu(),n=qf(),r=nf();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}}),Yf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.dematerialize=void 0;var t=Ed(),n=B(),r=V();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){return t.observeNotification(e,n)}))})}e.dematerialize=i}}),Xf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinct.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinct=void 0;var t=B(),n=V(),r=vu(),i=fd();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}}),Zf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilChanged=void 0;var t=Cu(),n=B(),r=V();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}}}),Qf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilKeyChanged=void 0;var t=Zf();function n(e,n){return t.distinctUntilChanged(function(t,r){return n?n(t[e],r[e]):t[e]===r[e]})}e.distinctUntilKeyChanged=n}}),$f=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfEmpty=void 0;var t=Od(),n=B(),r=V();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}}}),ep=z({"../../node_modules/rxjs/dist/cjs/internal/operators/elementAt.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.elementAt=void 0;var t=jd(),n=df(),r=$f(),i=Uf(),a=Wf();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}}),tp=z({"../../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=Jd(),i=wd();function a(){var e=[...arguments];return function(a){return r.concat(a,i.of.apply(void 0,n([],t(e))))}}e.endWith=a}}),np=z({"../../node_modules/rxjs/dist/cjs/internal/operators/every.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.every=void 0;var t=B(),n=V();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}}),rp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustMap=void 0;var t=Id(),n=fd(),r=B(),i=V();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}}),ip=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustAll=void 0;var t=rp(),n=Cu();function r(){return t.exhaustMap(n.identity)}e.exhaustAll=r}}),ap=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaust=void 0,e.exhaust=ip().exhaustAll}}),op=z({"../../node_modules/rxjs/dist/cjs/internal/operators/expand.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.expand=void 0;var t=B(),n=Wd();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}}),sp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/finalize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.finalize=void 0;var t=B();function n(e){return t.operate(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}e.finalize=n}}),cp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/find.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFind=e.find=void 0;var t=B(),n=V();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}}),lp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/findIndex.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findIndex=void 0;var t=B(),n=cp();function r(e,r){return t.operate(n.createFind(e,r,`index`))}e.findIndex=r}}),up=z({"../../node_modules/rxjs/dist/cjs/internal/operators/first.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.first=void 0;var t=Od(),n=df(),r=Wf(),i=Uf(),a=$f(),o=Cu();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}}),dp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.groupBy=void 0;var t=Tu(),n=fd(),r=Mu(),i=B(),a=V();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}}),fp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=void 0;var t=B(),n=V();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}}),pp=z({"../../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=td(),r=B(),i=V();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}}),mp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/last.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.last=void 0;var t=Od(),n=df(),r=pp(),i=$f(),a=Uf(),o=Cu();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}}),hp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/materialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.materialize=void 0;var t=Ed(),n=B(),r=V();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}}),gp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/max.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.max=void 0;var t=Df(),n=uu();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}}),_p=z({"../../node_modules/rxjs/dist/cjs/internal/operators/flatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.flatMap=void 0,e.flatMap=Gd().mergeMap}}),vp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMapTo=void 0;var t=Gd(),n=uu();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}}),yp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeScan=void 0;var t=B(),n=Wd();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}}),bp=z({"../../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=B(),i=Kd(),a=rd(),o=Cd();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}}),xp=z({"../../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=bp();function i(){var e=[...arguments];return r.merge.apply(void 0,n([],t(e)))}e.mergeWith=i}}),Sp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/min.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.min=void 0;var t=Df(),n=uu();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}}),Cp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/multicast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.multicast=void 0;var t=Du(),n=uu(),r=zf();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}}),wp=z({"../../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=sf(),i=cf();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}}),Tp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/pairwise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairwise=void 0;var t=B(),n=V();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}}),Ep=z({"../../node_modules/rxjs/dist/cjs/internal/operators/pluck.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pluck=void 0;var t=Id();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}}),Dp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publish.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publish=void 0;var t=Mu(),n=Cp(),r=zf();function i(e){return e?function(t){return r.connect(e)(t)}:function(e){return n.multicast(new t.Subject)(e)}}e.publish=i}}),Op=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishBehavior=void 0;var t=Nu(),n=Du();function r(e){return function(r){var i=new t.BehaviorSubject(e);return new n.ConnectableObservable(r,function(){return i})}}e.publishBehavior=r}}),kp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishLast=void 0;var t=Iu(),n=Du();function r(){return function(e){var r=new t.AsyncSubject;return new n.ConnectableObservable(e,function(){return r})}}e.publishLast=r}}),Ap=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishReplay=void 0;var t=Fu(),n=Cp(),r=uu();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}}),jp=z({"../../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=pf(),i=B(),a=Cu();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}}),Mp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/repeat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=void 0;var t=td(),n=B(),r=V(),i=fd(),a=nf();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}}),Np=z({"../../node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeatWhen=void 0;var t=fd(),n=Mu(),r=B(),i=V();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}}),Pp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/retry.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retry=void 0;var t=B(),n=V(),r=Cu(),i=nf(),a=fd();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&&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}}),Fp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retryWhen=void 0;var t=fd(),n=Mu(),r=B(),i=V();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}}),Ip=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sample.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sample=void 0;var t=fd(),n=B(),r=vu(),i=V();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}}),Lp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sampleTime=void 0;var t=qu(),n=Ip(),r=rf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.sample(r.interval(e,i))}e.sampleTime=i}}),Rp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/scan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scan=void 0;var t=B(),n=Ef();function r(e,r){return t.operate(n.scanInternals(e,r,arguments.length>=2,!0))}e.scan=r}}),zp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sequenceEqual=void 0;var t=B(),n=V(),r=fd();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}}}}),Bp=z({"../../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=fd(),i=Mu(),a=xu(),o=B();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||s,u=e.resetOnComplete,d=u===void 0||u,f=e.resetOnRefCountZero,p=f===void 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)}}}}),Vp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shareReplay=void 0;var t=Fu(),n=Bp();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&&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}}),Hp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/single.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.single=void 0;var t=Od(),n=Nd(),r=Md(),i=B(),a=V();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}}),Up=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skip.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skip=void 0;var t=df();function n(e){return t.filter(function(t,n){return e<=n})}e.skip=n}}),Wp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipLast=void 0;var t=Cu(),n=B(),r=V();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}}),Gp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipUntil=void 0;var t=B(),n=V(),r=fd(),i=vu();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}}),Kp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipWhile=void 0;var t=B(),n=V();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}}),qp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/startWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.startWith=void 0;var t=Jd(),n=rd(),r=B();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}}),Jp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMap=void 0;var t=fd(),n=B(),r=V();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}}),Yp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchAll=void 0;var t=Jp(),n=Cu();function r(){return t.switchMap(n.identity)}e.switchAll=r}}),Xp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMapTo=void 0;var t=Jp(),n=uu();function r(e,r){return n.isFunction(r)?t.switchMap(function(){return e},r):t.switchMap(function(){return e})}e.switchMapTo=r}}),Zp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchScan=void 0;var t=Jp(),n=B();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}}),Qp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeUntil=void 0;var t=B(),n=V(),r=fd(),i=vu();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}}),$p=z({"../../node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeWhile=void 0;var t=B(),n=V();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}}),em=z({"../../node_modules/rxjs/dist/cjs/internal/operators/tap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tap=void 0;var t=uu(),n=B(),r=V(),i=Cu();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}}),tm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throttle.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=void 0;var t=B(),n=V(),r=fd();function i(e,i){return t.operate(function(t,a){var o=i??{},s=o.leading,c=s===void 0||s,l=o.trailing,u=l!==void 0&&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}}),nm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttleTime=void 0;var t=qu(),n=tm(),r=nf();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}}),rm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimeInterval=e.timeInterval=void 0;var t=qu(),n=B(),r=V();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}}),im=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeoutWith=void 0;var t=qu(),n=Pd(),r=Fd();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}}),am=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timestamp.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timestamp=void 0;var t=Pu(),n=Id();function r(e){return e===void 0&&(e=t.dateTimestampProvider),n.map(function(t){return{value:t,timestamp:e.now()}})}e.timestamp=r}}),om=z({"../../node_modules/rxjs/dist/cjs/internal/operators/window.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.window=void 0;var t=Mu(),n=B(),r=V(),i=vu(),a=fd();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}}),sm=z({"../../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=Mu(),r=B(),i=V();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}}),cm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/windowTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowTime=void 0;var t=Mu(),n=qu(),r=mu(),i=B(),a=V(),o=pu(),s=rd(),c=pd();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}}),lm=z({"../../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=Mu(),r=mu(),i=B(),a=fd(),o=V(),s=vu(),c=pu();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}}),um=z({"../../node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowWhen=void 0;var t=Mu(),n=B(),r=V(),i=fd();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}}),dm=z({"../../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=B(),i=V(),a=fd(),o=Cu(),s=vu(),c=rd();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}}),fm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/zipAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.zipAll=void 0;var t=gf(),n=kf();function r(e){return n.joinAllInternals(t.zip,e)}e.zipAll=r}}),pm=z({"../../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=gf(),i=B();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}}),mm=z({"../../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=pm();function i(){var e=[...arguments];return r.zip.apply(void 0,n([],t(e)))}e.zipWith=i}}),hm=z({"../../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=Tu();Object.defineProperty(e,"Observable",{enumerable:!0,get:function(){return r.Observable}});var i=Du();Object.defineProperty(e,"ConnectableObservable",{enumerable:!0,get:function(){return i.ConnectableObservable}});var a=Su();Object.defineProperty(e,"observable",{enumerable:!0,get:function(){return a.observable}});var o=Au();Object.defineProperty(e,"animationFrames",{enumerable:!0,get:function(){return o.animationFrames}});var s=Mu();Object.defineProperty(e,"Subject",{enumerable:!0,get:function(){return s.Subject}});var c=Nu();Object.defineProperty(e,"BehaviorSubject",{enumerable:!0,get:function(){return c.BehaviorSubject}});var l=Fu();Object.defineProperty(e,"ReplaySubject",{enumerable:!0,get:function(){return l.ReplaySubject}});var u=Iu();Object.defineProperty(e,"AsyncSubject",{enumerable:!0,get:function(){return u.AsyncSubject}});var d=Ku();Object.defineProperty(e,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(e,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var f=qu();Object.defineProperty(e,"async",{enumerable:!0,get:function(){return f.async}}),Object.defineProperty(e,"asyncScheduler",{enumerable:!0,get:function(){return f.asyncScheduler}});var p=Xu();Object.defineProperty(e,"queue",{enumerable:!0,get:function(){return p.queue}}),Object.defineProperty(e,"queueScheduler",{enumerable:!0,get:function(){return p.queueScheduler}});var m=$u();Object.defineProperty(e,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(e,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var h=ed();Object.defineProperty(e,"VirtualTimeScheduler",{enumerable:!0,get:function(){return h.VirtualTimeScheduler}}),Object.defineProperty(e,"VirtualAction",{enumerable:!0,get:function(){return h.VirtualAction}});var g=Uu();Object.defineProperty(e,"Scheduler",{enumerable:!0,get:function(){return g.Scheduler}});var _=mu();Object.defineProperty(e,"Subscription",{enumerable:!0,get:function(){return _.Subscription}});var v=xu();Object.defineProperty(e,"Subscriber",{enumerable:!0,get:function(){return v.Subscriber}});var y=Ed();Object.defineProperty(e,"Notification",{enumerable:!0,get:function(){return y.Notification}}),Object.defineProperty(e,"NotificationKind",{enumerable:!0,get:function(){return y.NotificationKind}});var b=wu();Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return b.pipe}});var x=vu();Object.defineProperty(e,"noop",{enumerable:!0,get:function(){return x.noop}});var S=Cu();Object.defineProperty(e,"identity",{enumerable:!0,get:function(){return S.identity}});var C=Dd();Object.defineProperty(e,"isObservable",{enumerable:!0,get:function(){return C.isObservable}});var w=kd();Object.defineProperty(e,"lastValueFrom",{enumerable:!0,get:function(){return w.lastValueFrom}});var T=Ad();Object.defineProperty(e,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var E=jd();Object.defineProperty(e,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return E.ArgumentOutOfRangeError}});var D=Od();Object.defineProperty(e,"EmptyError",{enumerable:!0,get:function(){return D.EmptyError}});var O=Md();Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return O.NotFoundError}});var k=ju();Object.defineProperty(e,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return k.ObjectUnsubscribedError}});var A=Nd();Object.defineProperty(e,"SequenceError",{enumerable:!0,get:function(){return A.SequenceError}});var j=Fd();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return j.TimeoutError}});var M=fu();Object.defineProperty(e,"UnsubscriptionError",{enumerable:!0,get:function(){return M.UnsubscriptionError}});var ee=zd();Object.defineProperty(e,"bindCallback",{enumerable:!0,get:function(){return ee.bindCallback}});var N=Bd();Object.defineProperty(e,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var te=Ud();Object.defineProperty(e,"combineLatest",{enumerable:!0,get:function(){return te.combineLatest}});var P=Jd();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return P.concat}});var F=Xd();Object.defineProperty(e,"connectable",{enumerable:!0,get:function(){return F.connectable}});var ne=Yd();Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return ne.defer}});var re=td();Object.defineProperty(e,"empty",{enumerable:!0,get:function(){return re.empty}});var ie=Zd();Object.defineProperty(e,"forkJoin",{enumerable:!0,get:function(){return ie.forkJoin}});var ae=Cd();Object.defineProperty(e,"from",{enumerable:!0,get:function(){return ae.from}});var oe=Qd();Object.defineProperty(e,"fromEvent",{enumerable:!0,get:function(){return oe.fromEvent}});var se=$d();Object.defineProperty(e,"fromEventPattern",{enumerable:!0,get:function(){return se.fromEventPattern}});var I=ef();Object.defineProperty(e,"generate",{enumerable:!0,get:function(){return I.generate}});var L=tf();Object.defineProperty(e,"iif",{enumerable:!0,get:function(){return L.iif}});var ce=rf();Object.defineProperty(e,"interval",{enumerable:!0,get:function(){return ce.interval}});var le=af();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return le.merge}});var R=of();Object.defineProperty(e,"never",{enumerable:!0,get:function(){return R.never}});var ue=wd();Object.defineProperty(e,"of",{enumerable:!0,get:function(){return ue.of}});var de=cf();Object.defineProperty(e,"onErrorResumeNext",{enumerable:!0,get:function(){return de.onErrorResumeNext}});var fe=lf();Object.defineProperty(e,"pairs",{enumerable:!0,get:function(){return fe.pairs}});var pe=ff();Object.defineProperty(e,"partition",{enumerable:!0,get:function(){return pe.partition}});var me=pf();Object.defineProperty(e,"race",{enumerable:!0,get:function(){return me.race}});var he=mf();Object.defineProperty(e,"range",{enumerable:!0,get:function(){return he.range}});var ge=Td();Object.defineProperty(e,"throwError",{enumerable:!0,get:function(){return ge.throwError}});var _e=nf();Object.defineProperty(e,"timer",{enumerable:!0,get:function(){return _e.timer}});var ve=hf();Object.defineProperty(e,"using",{enumerable:!0,get:function(){return ve.using}});var ye=gf();Object.defineProperty(e,"zip",{enumerable:!0,get:function(){return ye.zip}});var be=Sd();Object.defineProperty(e,"scheduled",{enumerable:!0,get:function(){return be.scheduled}});var xe=td();Object.defineProperty(e,"EMPTY",{enumerable:!0,get:function(){return xe.EMPTY}});var Se=of();Object.defineProperty(e,"NEVER",{enumerable:!0,get:function(){return Se.NEVER}}),n(_f(),e);var Ce=hu();Object.defineProperty(e,"config",{enumerable:!0,get:function(){return Ce.config}});var z=vf();Object.defineProperty(e,"audit",{enumerable:!0,get:function(){return z.audit}});var we=yf();Object.defineProperty(e,"auditTime",{enumerable:!0,get:function(){return we.auditTime}});var Te=bf();Object.defineProperty(e,"buffer",{enumerable:!0,get:function(){return Te.buffer}});var Ee=xf();Object.defineProperty(e,"bufferCount",{enumerable:!0,get:function(){return Ee.bufferCount}});var De=Sf();Object.defineProperty(e,"bufferTime",{enumerable:!0,get:function(){return De.bufferTime}});var Oe=Cf();Object.defineProperty(e,"bufferToggle",{enumerable:!0,get:function(){return Oe.bufferToggle}});var ke=wf();Object.defineProperty(e,"bufferWhen",{enumerable:!0,get:function(){return ke.bufferWhen}});var Ae=Tf();Object.defineProperty(e,"catchError",{enumerable:!0,get:function(){return Ae.catchError}});var je=jf();Object.defineProperty(e,"combineAll",{enumerable:!0,get:function(){return je.combineAll}});var Me=Af();Object.defineProperty(e,"combineLatestAll",{enumerable:!0,get:function(){return Me.combineLatestAll}});var Ne=Nf();Object.defineProperty(e,"combineLatestWith",{enumerable:!0,get:function(){return Ne.combineLatestWith}});var Pe=qd();Object.defineProperty(e,"concatAll",{enumerable:!0,get:function(){return Pe.concatAll}});var Fe=Pf();Object.defineProperty(e,"concatMap",{enumerable:!0,get:function(){return Fe.concatMap}});var Ie=Ff();Object.defineProperty(e,"concatMapTo",{enumerable:!0,get:function(){return Ie.concatMapTo}});var Le=Lf();Object.defineProperty(e,"concatWith",{enumerable:!0,get:function(){return Le.concatWith}});var Re=zf();Object.defineProperty(e,"connect",{enumerable:!0,get:function(){return Re.connect}});var ze=Bf();Object.defineProperty(e,"count",{enumerable:!0,get:function(){return ze.count}});var Be=Vf();Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return Be.debounce}});var Ve=Hf();Object.defineProperty(e,"debounceTime",{enumerable:!0,get:function(){return Ve.debounceTime}});var He=Uf();Object.defineProperty(e,"defaultIfEmpty",{enumerable:!0,get:function(){return He.defaultIfEmpty}});var Ue=Jf();Object.defineProperty(e,"delay",{enumerable:!0,get:function(){return Ue.delay}});var We=qf();Object.defineProperty(e,"delayWhen",{enumerable:!0,get:function(){return We.delayWhen}});var Ge=Yf();Object.defineProperty(e,"dematerialize",{enumerable:!0,get:function(){return Ge.dematerialize}});var Ke=Xf();Object.defineProperty(e,"distinct",{enumerable:!0,get:function(){return Ke.distinct}});var qe=Zf();Object.defineProperty(e,"distinctUntilChanged",{enumerable:!0,get:function(){return qe.distinctUntilChanged}});var Je=Qf();Object.defineProperty(e,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Je.distinctUntilKeyChanged}});var Ye=ep();Object.defineProperty(e,"elementAt",{enumerable:!0,get:function(){return Ye.elementAt}});var Xe=tp();Object.defineProperty(e,"endWith",{enumerable:!0,get:function(){return Xe.endWith}});var Ze=np();Object.defineProperty(e,"every",{enumerable:!0,get:function(){return Ze.every}});var Qe=ap();Object.defineProperty(e,"exhaust",{enumerable:!0,get:function(){return Qe.exhaust}});var $e=ip();Object.defineProperty(e,"exhaustAll",{enumerable:!0,get:function(){return $e.exhaustAll}});var et=rp();Object.defineProperty(e,"exhaustMap",{enumerable:!0,get:function(){return et.exhaustMap}});var tt=op();Object.defineProperty(e,"expand",{enumerable:!0,get:function(){return tt.expand}});var nt=df();Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return nt.filter}});var rt=sp();Object.defineProperty(e,"finalize",{enumerable:!0,get:function(){return rt.finalize}});var it=cp();Object.defineProperty(e,"find",{enumerable:!0,get:function(){return it.find}});var at=lp();Object.defineProperty(e,"findIndex",{enumerable:!0,get:function(){return at.findIndex}});var ot=up();Object.defineProperty(e,"first",{enumerable:!0,get:function(){return ot.first}});var st=dp();Object.defineProperty(e,"groupBy",{enumerable:!0,get:function(){return st.groupBy}});var ct=Gf();Object.defineProperty(e,"ignoreElements",{enumerable:!0,get:function(){return ct.ignoreElements}});var lt=fp();Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return lt.isEmpty}});var ut=mp();Object.defineProperty(e,"last",{enumerable:!0,get:function(){return ut.last}});var dt=Id();Object.defineProperty(e,"map",{enumerable:!0,get:function(){return dt.map}});var ft=Kf();Object.defineProperty(e,"mapTo",{enumerable:!0,get:function(){return ft.mapTo}});var pt=hp();Object.defineProperty(e,"materialize",{enumerable:!0,get:function(){return pt.materialize}});var mt=gp();Object.defineProperty(e,"max",{enumerable:!0,get:function(){return mt.max}});var ht=Kd();Object.defineProperty(e,"mergeAll",{enumerable:!0,get:function(){return ht.mergeAll}});var gt=_p();Object.defineProperty(e,"flatMap",{enumerable:!0,get:function(){return gt.flatMap}});var _t=Gd();Object.defineProperty(e,"mergeMap",{enumerable:!0,get:function(){return _t.mergeMap}});var vt=vp();Object.defineProperty(e,"mergeMapTo",{enumerable:!0,get:function(){return vt.mergeMapTo}});var yt=yp();Object.defineProperty(e,"mergeScan",{enumerable:!0,get:function(){return yt.mergeScan}});var bt=xp();Object.defineProperty(e,"mergeWith",{enumerable:!0,get:function(){return bt.mergeWith}});var xt=Sp();Object.defineProperty(e,"min",{enumerable:!0,get:function(){return xt.min}});var St=Cp();Object.defineProperty(e,"multicast",{enumerable:!0,get:function(){return St.multicast}});var Ct=md();Object.defineProperty(e,"observeOn",{enumerable:!0,get:function(){return Ct.observeOn}});var wt=wp();Object.defineProperty(e,"onErrorResumeNextWith",{enumerable:!0,get:function(){return wt.onErrorResumeNextWith}});var Tt=Tp();Object.defineProperty(e,"pairwise",{enumerable:!0,get:function(){return Tt.pairwise}});var Et=Ep();Object.defineProperty(e,"pluck",{enumerable:!0,get:function(){return Et.pluck}});var Dt=Dp();Object.defineProperty(e,"publish",{enumerable:!0,get:function(){return Dt.publish}});var Ot=Op();Object.defineProperty(e,"publishBehavior",{enumerable:!0,get:function(){return Ot.publishBehavior}});var kt=kp();Object.defineProperty(e,"publishLast",{enumerable:!0,get:function(){return kt.publishLast}});var At=Ap();Object.defineProperty(e,"publishReplay",{enumerable:!0,get:function(){return At.publishReplay}});var jt=jp();Object.defineProperty(e,"raceWith",{enumerable:!0,get:function(){return jt.raceWith}});var Mt=Df();Object.defineProperty(e,"reduce",{enumerable:!0,get:function(){return Mt.reduce}});var Nt=Mp();Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return Nt.repeat}});var Pt=Np();Object.defineProperty(e,"repeatWhen",{enumerable:!0,get:function(){return Pt.repeatWhen}});var Ft=Pp();Object.defineProperty(e,"retry",{enumerable:!0,get:function(){return Ft.retry}});var It=Fp();Object.defineProperty(e,"retryWhen",{enumerable:!0,get:function(){return It.retryWhen}});var Lt=Eu();Object.defineProperty(e,"refCount",{enumerable:!0,get:function(){return Lt.refCount}});var Rt=Ip();Object.defineProperty(e,"sample",{enumerable:!0,get:function(){return Rt.sample}});var zt=Lp();Object.defineProperty(e,"sampleTime",{enumerable:!0,get:function(){return zt.sampleTime}});var Bt=Rp();Object.defineProperty(e,"scan",{enumerable:!0,get:function(){return Bt.scan}});var Vt=zp();Object.defineProperty(e,"sequenceEqual",{enumerable:!0,get:function(){return Vt.sequenceEqual}});var Ht=Bp();Object.defineProperty(e,"share",{enumerable:!0,get:function(){return Ht.share}});var Ut=Vp();Object.defineProperty(e,"shareReplay",{enumerable:!0,get:function(){return Ut.shareReplay}});var Wt=Hp();Object.defineProperty(e,"single",{enumerable:!0,get:function(){return Wt.single}});var Gt=Up();Object.defineProperty(e,"skip",{enumerable:!0,get:function(){return Gt.skip}});var Kt=Wp();Object.defineProperty(e,"skipLast",{enumerable:!0,get:function(){return Kt.skipLast}});var qt=Gp();Object.defineProperty(e,"skipUntil",{enumerable:!0,get:function(){return qt.skipUntil}});var Jt=Kp();Object.defineProperty(e,"skipWhile",{enumerable:!0,get:function(){return Jt.skipWhile}});var Yt=qp();Object.defineProperty(e,"startWith",{enumerable:!0,get:function(){return Yt.startWith}});var Xt=hd();Object.defineProperty(e,"subscribeOn",{enumerable:!0,get:function(){return Xt.subscribeOn}});var Zt=Yp();Object.defineProperty(e,"switchAll",{enumerable:!0,get:function(){return Zt.switchAll}});var Qt=Jp();Object.defineProperty(e,"switchMap",{enumerable:!0,get:function(){return Qt.switchMap}});var $t=Xp();Object.defineProperty(e,"switchMapTo",{enumerable:!0,get:function(){return $t.switchMapTo}});var en=Zp();Object.defineProperty(e,"switchScan",{enumerable:!0,get:function(){return en.switchScan}});var tn=Wf();Object.defineProperty(e,"take",{enumerable:!0,get:function(){return tn.take}});var nn=pp();Object.defineProperty(e,"takeLast",{enumerable:!0,get:function(){return nn.takeLast}});var rn=Qp();Object.defineProperty(e,"takeUntil",{enumerable:!0,get:function(){return rn.takeUntil}});var an=$p();Object.defineProperty(e,"takeWhile",{enumerable:!0,get:function(){return an.takeWhile}});var on=em();Object.defineProperty(e,"tap",{enumerable:!0,get:function(){return on.tap}});var sn=tm();Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return sn.throttle}});var cn=nm();Object.defineProperty(e,"throttleTime",{enumerable:!0,get:function(){return cn.throttleTime}});var ln=$f();Object.defineProperty(e,"throwIfEmpty",{enumerable:!0,get:function(){return ln.throwIfEmpty}});var un=rm();Object.defineProperty(e,"timeInterval",{enumerable:!0,get:function(){return un.timeInterval}});var dn=Fd();Object.defineProperty(e,"timeout",{enumerable:!0,get:function(){return dn.timeout}});var fn=im();Object.defineProperty(e,"timeoutWith",{enumerable:!0,get:function(){return fn.timeoutWith}});var pn=am();Object.defineProperty(e,"timestamp",{enumerable:!0,get:function(){return pn.timestamp}});var mn=Of();Object.defineProperty(e,"toArray",{enumerable:!0,get:function(){return mn.toArray}});var hn=om();Object.defineProperty(e,"window",{enumerable:!0,get:function(){return hn.window}});var gn=sm();Object.defineProperty(e,"windowCount",{enumerable:!0,get:function(){return gn.windowCount}});var _n=cm();Object.defineProperty(e,"windowTime",{enumerable:!0,get:function(){return _n.windowTime}});var vn=lm();Object.defineProperty(e,"windowToggle",{enumerable:!0,get:function(){return vn.windowToggle}});var yn=um();Object.defineProperty(e,"windowWhen",{enumerable:!0,get:function(){return yn.windowWhen}});var bn=dm();Object.defineProperty(e,"withLatestFrom",{enumerable:!0,get:function(){return bn.withLatestFrom}});var xn=fm();Object.defineProperty(e,"zipAll",{enumerable:!0,get:function(){return xn.zipAll}});var Sn=mm();Object.defineProperty(e,"zipWith",{enumerable:!0,get:function(){return Sn.zipWith}})}}),gm=(0,y.createContext)(null);function _m({children:e}){let[t,n]=(0,y.useState)(()=>typeof window<`u`&&localStorage.getItem(`showLineNumbers`)===`true`),r=(0,y.useCallback)(()=>{n(e=>{let t=!e;return typeof window<`u`&&localStorage.setItem(`showLineNumbers`,t.toString()),t})},[]);return(0,R.jsx)(gm.Provider,{value:{showLineNumbers:t,toggleLineNumbers:r},children:e})}function vm(){let e=(0,y.useContext)(gm);if(!e)throw Error(`useLineNumbers must be used within a LineNumbersProvider`);return e}var ym=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)}}},bm=(0,y.createContext)(null);function xm({browser:e,storage:t,sessionFactory:n,children:r}){let i=(0,y.useMemo)(()=>e??Gl({storage:t??new ym,sessionFactory:n??Ul()}),[e,t,n]);return(0,R.jsx)(bm.Provider,{value:i,children:r})}function Sm(){let e=(0,y.useContext)(bm);if(!e)throw Error(`useSemiont must be used within a <SemiontProvider>`);return e}var Cm={success:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}),error:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}),warning:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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 wm({toast:e,onClose:t}){return(0,y.useEffect)(()=>{let n=setTimeout(()=>{t(e.id)},e.duration||3e3);return()=>clearTimeout(n)},[e,t]),(0,R.jsxs)(`div`,{className:`semiont-toast`,"data-variant":e.type,role:`alert`,children:[(0,R.jsx)(`div`,{className:`semiont-toast-icon-wrapper`,children:Cm[e.type]}),(0,R.jsx)(`p`,{className:`semiont-toast-message`,children:e.message}),(0,R.jsx)(`button`,{onClick:()=>t(e.id),className:`semiont-toast-close`,"aria-label":`Close`,children:(0,R.jsx)(`svg`,{className:`semiont-toast-close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function Tm({toasts:e,onClose:t}){let[n,r]=(0,y.useState)(!1);return(0,y.useEffect)(()=>(r(!0),()=>r(!1)),[]),n?(0,lu.createPortal)((0,R.jsx)(`div`,{className:`semiont-toast-container`,children:e.map(e=>(0,R.jsx)(wm,{toast:e,onClose:t},e.id))}),document.body):null}var Em=y.createContext(void 0);function Dm({children:e}){let[t,n]=(0,y.useState)([]),r=y.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=y.useCallback((e,t)=>r(e,`success`,t),[r]),a=y.useCallback((e,t)=>r(e,`error`,t),[r]),o=y.useCallback((e,t)=>r(e,`warning`,t),[r]),s=y.useCallback((e,t)=>r(e,`info`,t),[r]),c=y.useCallback(e=>{n(t=>t.filter(t=>t.id!==e))},[]),l=y.useMemo(()=>({showToast:r,showSuccess:i,showError:a,showWarning:o,showInfo:s}),[r,i,a,o,s]);return(0,R.jsxs)(Em.Provider,{value:l,children:[e,(0,R.jsx)(Tm,{toasts:t,onClose:c})]})}function Om(){let e=y.useContext(Em);if(e===void 0)throw Error(`useToast must be used within a ToastProvider`);return e}var km={close:`Close`,codeLoading:`Loading…`,codeAnalyzing:`Marking…`,codeAnalyzingTags:`Marking tags…`,codeDetectingEntities:`Marking…`,codeCreatingAnnotations:`Creating {{count}} annotations…`,codeCreatingTagAnnotations:`Creating {{count}} tags…`,codeCompleteCreated:`Created {{count}} {{kind}}`,codeGeneratingResource:`Generating…`,codeCreatingResource:`Creating the resource…`,codeCompleteGenerated:`Created the resource`,codeCompleteGeneratedTruncated:`Created the resource — cut off at the length limit`,kindHighlight:`highlights`,kindComment:`comments`,kindAssessment:`assessments`,kindReference:`references`,kindTag:`tags`,subject:`{{kind}}: {{label}}`,subjectWithPosition:`{{kind}}: {{label}} ({{done}} of {{total}})`,paramEntityTypes:`Entity Types`,paramInstructions:`Instructions`,paramTone:`Tone`,paramDensity:`Density`,subjectKindEntityType:`Entity type`,subjectKindCategory:`Category`,cancel:`Cancel`,inProgress:`Annotating...`},Am={loadFailed:`Failed to load PDF`,loading:`Loading PDF...`,next:`Next`,pageLoadFailed:`Failed to load page`,pageOf:`Page {{page}} of {{total}}`,pagination:`Page navigation`,previous:`Previous`,viewerLoading:`Loading PDF viewer...`},jm={annotations:`Annotations`,history:`History`,resourceInfo:`Resource Info`,collaboration:`Collaboration`,userAccount:`User Account`,settings:`Settings`,knowledgeBase:`Knowledge Base`},Mm={title:`Resource Info`,locale:`Locale`,notSpecified:`Not specified`,entityTypeTags:`Entity Type Tags`,representation:`Representation`,mediaType:`Media Type`,byteSize:`Size`,storageUri:`Storage`,clone:`Clone`,cloneDescription:`Generate a shareable clone link for this resource`,generate:`Generate`,generateDescription:`Generate a new resource from this one's context`,archive:`Archive`,archiveDescription:`Move this resource to archived status`,unarchive:`Unarchive`,unarchiveDescription:`Restore this resource to active status`,provenance:`Provenance`,createdAt:`Created`,modifiedAt:`Modified`,attributedTo:`Attributed to`,derivedFrom:`Derived from`},Nm={title:`Collaboration`,connectionStatus:`Connection Status`,live:`Live`,disconnected:`Disconnected`,events:`{{count}} events`,lastSync:`Last sync:`,noActivity:`No activity yet`,justNow:`Just now`,secondsAgo:`{{count}} seconds ago`,minuteAgo:`1 minute ago`,minutesAgo:`{{count}} minutes ago`,hourAgo:`1 hour ago`,hoursAgo:`{{count}} hours ago`,realtimeActive:`Real-time updates are active`,reconnecting:`Reconnecting to server...`,sharing:`Sharing`,collaborationComingSoon:`Collaboration features coming soon`,collaborators:`Collaborators`,ceilings:`{{contextTokens}} in / {{maxOutputTokens}} out`,sharedWindow:`{{contextTokens}} window`},Pm={history:`History`,loading:`Loading...`,user:`User`,viewOriginal:`View original`,viewAnnotation:`View annotation: {{content}}`,resourceCreated:`Created Resource`,resourceCloned:`Cloned`,resourceArchived:`Archived`,resourceUnarchived:`Unarchived`,highlightAdded:`Highlight Added`,highlightRemoved:`Highlight Removed`,referenceCreated:`Reference Created`,referenceResolved:`Reference Resolved`,referenceDeleted:`Reference Deleted`,entitytagAdded:`Tag Added`,entitytagRemoved:`Tag Removed`,assessmentAdded:`Assessment Added`,assessmentRemoved:`Assessment Removed`,annotationAdded:`Annotation Added`,annotationRemoved:`Annotation Removed`,annotationBodyUpdated:`Annotation Updated`,jobEvent:`Job Event`,embeddingComputed:`Embedding Computed`,justNow:`just now`,minutesAgo:`{{count}}m ago`,hoursAgo:`{{count}}h ago`,daysAgo:`{{count}}d ago`,failed:`Could not load history.`,retry:`Try again`},Fm={title:`Comments`,noComments:`No comments yet. Select text and click Comment to add one.`,commentPlaceholder:`Type your comment here...`,save:`Save`,cancel:`Cancel`,edit:`Edit`,annotateComments:`Annotate Comments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on technical terminology...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneScholarly:`Scholarly`,toneExplanatory:`Explanatory`,toneConversational:`Conversational`,toneTechnical:`Technical`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Im={title:`Highlights`,noHighlights:`No highlights yet. Use AI annotation to find important passages.`,annotateHighlights:`Annotate Highlights`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on key technical concepts...`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Lm={title:`Assessments`,noAssessments:`No assessments yet. Use AI annotation to evaluate passages.`,assessmentPlaceholder:`Type your assessment here...`,save:`Save`,cancel:`Cancel`,annotateAssessments:`Annotate Assessments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Evaluate claims for accuracy and evidence...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneAnalytical:`Analytical`,toneCritical:`Critical`,toneBalanced:`Balanced`,toneConstructive:`Constructive`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Rm={title:`Tags`,noTags:`No tags yet. Use AI annotation to identify structural roles.`,noSchemas:"No tag schemas registered for this knowledge base. A KB administrator must register at least one structural-analysis schema (e.g. via the `register-tag-schemas` skill) before tagging can be used.",annotateTags:`Annotate Tags`,selectSchema:`Select Framework`,selectCategories:`Select Categories`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,selectAll:`Select All`,deselectAll:`Deselect All`,categoriesSelected:`{count, plural, =0 {No categories selected} =1 {1 category selected} other {# categories selected}}`,createTagForSelection:`Create Tag for Selection`,selectCategory:`Select Category`,chooseCategory:`Choose a category...`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`},zm={title:`Annotations`,statistics:`Statistics`,highlight:`Highlights`,reference:`References`,assessment:`Assessments`,comment:`Comments`,tag:`Tags`,annotationsFailed:`Could not load annotations.`,retry:`Try again`},Bm={title:`Statistics`,highlights:`Highlights`,comments:`Comments`,assessments:`Assessments`,tags:`Tags`,references:`References`,stub:`Stub`,resolved:`Resolved`,entityTypes:`Entity Types`},Vm={title:`References`,noReferences:`No references yet. Select text to create references to other resources.`,outgoingReferences:`Outgoing References`,incomingReferences:`Incoming References`,noIncomingReferences:`No incoming references`,stub:`Stub reference (not linked)`,resolved:`Resolved reference (linked)`,derived:`Derived`,open:`Open`,unlink:`Unlink`,resolve:`Resolve Reference`,cancel:`Cancel`,createReference:`Create Reference`,entityTypesOptional:`Entity Types (Optional)`,fragmentSelected:`Fragment selected`,annotateReferences:`Annotate References`,selectEntityTypes:`Entity types:`,select:`Select`,deselect:`Deselect`,noEntityTypes:`No entity types available`,typesSelected:`{count, plural, =1 {1 type selected} other {# types selected}}`,annotate:`Annotate`,annotating:`Annotating...`,includeDescriptiveReferences:`Include descriptive references`,descriptiveReferencesTooltip:`Also find phrases like 'the CEO', 'the tech giant', 'the physicist' (in addition to names)`,found:`{{count}} found`,complete:`Annotation complete!`,failed:`Annotation failed`,current:`Current: {{entityType}}`,loading:`loading...`,loadingEllipsis:`Loading...`,untitledResource:`Untitled Resource`,noText:`No text`,incomingReferencesFailed:`Could not load incoming references.`,retry:`Try again`,entityTypesFailed:`Could not load entity types.`},Hm={title:`Keyboard Shortcuts`,closeDialog:`Close dialog`,or:`or`,navigationTitle:`Navigation`,navOpenSearch:`Open global search`,navOpenSearchAlt:`Open global search (alternative)`,navCreateResource:`Create new resource`,navCloseOverlays:`Close all overlays (double press)`,navShowHelp:`Show keyboard shortcuts help`,sidebarTitle:`Knowledge Sidebar`,sidebarCollapse:`Collapse sidebar`,sidebarExpand:`Expand sidebar`,sidebarPickup:`Pick up resource tab (when focused)`,sidebarMove:`Move resource tab (when dragging)`,sidebarDrop:`Drop resource tab (when dragging)`,sidebarCancel:`Cancel drag operation`,annotationsTitle:`Resource Annotations`,annotHighlight:`Create highlight from annotation (direct)`,annotReference:`Open reference popup for annotation`,annotDelete:`Delete focused annotation`,annotNavigate:`Navigate through annotations`,annotNavigateBack:`Navigate annotations backward`,listsTitle:`Lists & Grids`,listsFilterNav:`Navigate entity type filters`,listsGridNav:`Navigate resource grid`,listsJumpFirst:`Jump to first item`,listsJumpLast:`Jump to last item`,searchModalTitle:`In Search Modal`,searchNav:`Navigate search results`,searchSelect:`Select result`,searchClose:`Close search`,modalTitle:`Modal Controls`,modalClose:`Close active modal`,modalNavForward:`Navigate forward through buttons`,modalNavBackward:`Navigate backward through buttons`,modalActivate:`Activate focused button`,accessibilityTitle:`Accessibility`,a11ySkipLinks:`Navigate to skip links (when at page start)`,a11yFollowLink:`Follow skip link`,macNote:`Using Mac keyboard shortcuts. ⌘ is the Command key.`,windowsNote:`Using Windows/Linux keyboard shortcuts. Ctrl is the Control key.`,footerHint:`Press {{key}} anytime to show this help`,close:`Close`},Um={modeGroup:`Mode`,browse:`Browse`,annotate:`Annotate`,selectionGroup:`Motivation`,clickGroup:`Click`,shapeGroup:`Shape`,none:`None`,linking:`Reference`,highlighting:`Highlight`,assessing:`Assess`,commenting:`Comment`,tagging:`Tag`,detail:`Detail`,follow:`Follow`,deleting:`Delete`,jsonld:`JSON-LD`,rectangle:`Rectangle`,circle:`Circle`,polygon:`Polygon`},Wm={title:`Navigation`,collapseSidebar:`Collapse sidebar`,expandSidebar:`Expand sidebar`,dragToReorder:`Drag to reorder`,dragToReorderDoc:`Drag to reorder {{name}}`,closeResource:`Close resource`,dragInstructions:`To reorder resources: Use Tab to navigate to a resource. Press Alt+Up arrow to move up or Alt+Down arrow to move down. For drag and drop: Press space bar to pick up the item. Use arrow keys to move it. Press space bar again to drop.`},Gm={deleteConfirmationTitle:`Delete Annotation`,deleteConfirmationMessage:`Are you sure you want to delete this annotation? This action cannot be undone.`,deleteConfirmationCancel:`Cancel`,deleteConfirmationDelete:`Delete`},Km={title:`Settings`,lineNumbers:`Line Numbers`,lineNumbersVisible:`Visible`,lineNumbersHidden:`Hidden`,theme:`Theme`,themeLight:`Light`,themeDark:`Dark`,themeSystem:`System`,themeSystemActive:`System ({{mode}})`,themeModeActive:`Using {{mode}} mode`,language:`Language`,languageHint:`Change language in the main navigation`,languageChanging:`Changing language...`,hoverDelay:`Hover Delay`,hoverDelayFast:`Fast`,hoverDelaySlow:`Slow`,hoverDelayDescription:`{{delay}}ms delay before hover effects appear`},qm={},Jm={gatherIntro:`Choose what to include in the gathered context.`,includeContent:`Include resource content`,includeSummary:`Include summary`,gatherDepth:`Depth`,gatherMaxResources:`Max resources`,gatherButton:`Gather`,editGather:`Change gather settings`,recallLabel:`Included in recall — deselect to exclude`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,sourceContextLabel:`Resource`,connectionsLabel:`Connections`,citedByLabel:`Cited by`,resourceTitle:`New resource title`,resourceTitlePlaceholder:`Title for the generated resource...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Optional guidance for the generation...`,language:`Language`,languageHelp:`Language for the generated resource`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,generate:`Generate`,maxLengthCeiling:`Limited to {{maxOutputTokens}} tokens by {{model}}.`,outputFormat:`Format`,formatExtensionMismatch:`Save location must end in {{extension}} to match the selected format.`,graphPaneTitle:`Neighborhood`,graphEmpty:`No links yet.`,resourceLinkLabel:`Resource link`,corpusPaneTitle:`Similar passages`,corpusEmpty:`No similar passages found.`,excludedReceipt:`{{types}} excluded from this recall`,machineRead:`OCR`,score:`Score`,saveLocation:`Save location`,discardDraftPrompt:`Discard this draft?`,discardDraft:`Discard`,keepEditing:`Keep editing`,title:`Generate from this Resource`},Ym={sourceContextLabel:`Annotation context in resource`,connectionsLabel:`Peer Annotations`,citedByLabel:`Resource Cited By`,userHintLabel:`Hint`,userHintPlaceholder:`Describe what this annotation refers to...`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,generate:`Generate`,compose:`Compose`,resolutionStrategyLabel:`Resolution Strategy`,back:`Back`,link:`Link`,score:`Score`,noResults:`No results found`,resourceTitle:`Resource Title`,resourceTitlePlaceholder:`Enter resource title...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Enter additional instructions...`,language:`Language`,languageHelp:`Language for generated content`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,maxResults:`Max Results`,semanticScoring:`Semantic Scoring`,semanticScoringHelp:`Use AI to score results by semantic relevance`,searching:`Searching...`,searchFailed:`Search failed`,search:`Search`,maxLengthCeiling:`Limited to {{maxOutputTokens}} tokens by {{model}}.`,outputFormat:`Format`,formatExtensionMismatch:`Save location must end in {{extension}} to match the selected format.`,graphPaneTitle:`Neighborhood`,graphEmpty:`No links yet — resolving this reference creates the first.`,resourceLinkLabel:`Resource link`,corpusPaneTitle:`Similar passages`,corpusEmpty:`No similar passages found — Search is unlikely to land.`,excludedReceipt:`{{types}} excluded from this recall`,machineRead:`OCR`,userHintEffect:`steers Search and Generate`,saveLocation:`Save location`,entityTypes:`Entity types`,contentLabel:`Content`,createAndLink:`Create & Link`,creatingAndLinking:`Creating & linking…`,discardDraftPrompt:`Discard this draft?`,discardDraft:`Discard`,keepEditing:`Keep editing`,resolveTitle:`Resolve Reference`},Xm={createFailed:`Couldn’t create the annotation: {{detail}}`,deleteFailed:`Couldn’t delete the annotation: {{detail}}`,referenceUpdateFailed:`Couldn’t update the reference: {{detail}}`,unknownError:`unknown error`,assistQuiet:`Still working — no update from the annotation job for a few minutes`,resourceCreatedNamed:`Created “{{name}}”`,resourceCreated:`Resource created`,annotationComplete:`Annotation complete`,annotationFailed:`Annotation failed`,generationFailed:`Generation failed: {{detail}}`,"decline_no-text-layer":`This PDF is a scan whose text couldn’t be recognized, so there’s nothing to annotate.`,decline_encrypted:`This PDF is password-protected, so its text can’t be read.`,decline_corrupt:`This PDF couldn’t be read — the file may be damaged.`,"decline_too-large":`This document is too large to extract text from.`,decline_empty:`This document has no text to annotate.`},Zm={AssistProgress:km,PdfViewer:Am,Toolbar:jm,ResourceInfoPanel:Mm,CollaborationPanel:Nm,AnnotationHistory:Pm,CommentsPanel:Fm,HighlightPanel:Im,AssessmentPanel:Lm,TaggingPanel:Rm,UnifiedAnnotationsPanel:zm,StatisticsPanel:Bm,ReferencesPanel:Vm,KeyboardShortcuts:Hm,AnnotateToolbar:Um,CollapsibleResourceNavigation:Wm,ResourceViewer:Gm,Settings:Km,AnnotateView:qm,ResourceGenerate:Jm,ReferenceWizard:Ym,OutcomeToasts:Xm},Qm=Ce({"../../translations/ar.json":()=>s(()=>import(`./ar-AZBRADEB-CvnkaLQS.js`),[]),"../../translations/bn.json":()=>s(()=>import(`./bn-CCEW6AOS-BCI1FG86.js`),[]),"../../translations/cs.json":()=>s(()=>import(`./cs-HXPF2CTE-CbMUDpDp.js`),[]),"../../translations/da.json":()=>s(()=>import(`./da-K5NTK7LH-D2rWDXq3.js`),[]),"../../translations/de.json":()=>s(()=>import(`./de-GMRQEDZI-CVlSEip_.js`),[]),"../../translations/el.json":()=>s(()=>import(`./el-EUB4CI4G-C80i0753.js`),[]),"../../translations/en.json":()=>s(()=>import(`./en-R5XA26NF-BKJaPGLP.js`),[]),"../../translations/es.json":()=>s(()=>import(`./es-Z32DAZ6W-D7UTS3Fx.js`),[]),"../../translations/fa.json":()=>s(()=>import(`./fa-G7HN6B32-DdDi1TG_.js`),[]),"../../translations/fi.json":()=>s(()=>import(`./fi-3YBLZO7I-B3OjL1PQ.js`),[]),"../../translations/fr.json":()=>s(()=>import(`./fr-VUBH7BBS-CjoeoL9n.js`),[]),"../../translations/he.json":()=>s(()=>import(`./he-WQQEY26B-2RRJq7To.js`),[]),"../../translations/hi.json":()=>s(()=>import(`./hi-HJZ6W4JB-DPflxelg.js`),[]),"../../translations/id.json":()=>s(()=>import(`./id-ZOGZ37MI-Dd4wSvWi.js`),[]),"../../translations/it.json":()=>s(()=>import(`./it-DT6UW66F-B7ZzCBm1.js`),[]),"../../translations/ja.json":()=>s(()=>import(`./ja-RUKQCOLO-Br1kLTUs.js`),[]),"../../translations/ko.json":()=>s(()=>import(`./ko-ZH5ADKZM-8IO4IU-2.js`),[]),"../../translations/ms.json":()=>s(()=>import(`./ms-Y2AFPZTU-q4v04hSa.js`),[]),"../../translations/nl.json":()=>s(()=>import(`./nl-OQEWIXNA-DiHanxnO.js`),[]),"../../translations/no.json":()=>s(()=>import(`./no-KPAYJZWY-DdGouMG_.js`),[]),"../../translations/pl.json":()=>s(()=>import(`./pl-WSXK2UUD-DK_ieA8X.js`),[]),"../../translations/pt.json":()=>s(()=>import(`./pt-NWRJRUCK-I6-gHOkB.js`),[]),"../../translations/ro.json":()=>s(()=>import(`./ro-3CGVMOC6-wdwqXMaO.js`),[]),"../../translations/sv.json":()=>s(()=>import(`./sv-HGSEBA7S-2KvJx_dY.js`),[]),"../../translations/th.json":()=>s(()=>import(`./th-NZ4G352Z-ZMBwAbgb.js`),[]),"../../translations/tr.json":()=>s(()=>import(`./tr-LGGS4DLW-BwMx3CfM.js`),[]),"../../translations/uk.json":()=>s(()=>import(`./uk-AIX536L4-cREJjolM.js`),[]),"../../translations/vi.json":()=>s(()=>import(`./vi-V6CVQZLQ-CXAniXLX.js`),[]),"../../translations/zh.json":()=>s(()=>import(`./zh-AGKPGI3L-MsKTx_dK.js`),[])}),$m=(0,y.createContext)(null),eh=new Map;function th(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 nh(e){if(eh.has(e))return eh.get(e);if(e===`en`)return eh.set(`en`,Zm),Zm;try{let t=await Qm(`../../translations/${e}.json`),n=t.default||t;return eh.set(e,n),n}catch(t){return console.error(`Failed to load translations for locale: ${e}`,t),Zm}}var rh={t:(e,t,n)=>{let r=Zm[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=th(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}};function ih({translationManager:e,locale:t,loadingComponent:n=null,children:r}){let[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&!e&&(s(!0),nh(t).then(e=>{a(e),s(!1)}).catch(e=>{console.error(`Failed to load translations:`,e),a(Zm),s(!1)}))},[t,e]);let c=(0,y.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=th(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,R.jsx)($m.Provider,{value:e,children:r}):t&&o?(0,R.jsx)(R.Fragment,{children:n}):t&&c?(0,R.jsx)($m.Provider,{value:c,children:r}):(0,R.jsx)($m.Provider,{value:rh,children:r})}function ah(e){let t=(0,y.useContext)($m);return t?(n,r)=>t.t(e,n,r):(t,n)=>{let r=Zm[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=th(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}}var oh={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 sh(){let e=[`:root {`];return Object.entries(oh.colors.primary).forEach(([t,n])=>{e.push(` --semiont-color-primary-${t}: ${n};`)}),Object.entries(oh.colors.secondary).forEach(([t,n])=>{e.push(` --semiont-color-secondary-${t}: ${n};`)}),Object.entries(oh.colors.semantic).forEach(([t,n])=>{e.push(` --semiont-color-${t.toLowerCase().replace(/([A-Z])/g,`-$1`).toLowerCase()}: ${n};`)}),Object.entries(oh.colors.neutral).forEach(([t,n])=>{e.push(` --semiont-color-neutral-${t}: ${n};`)}),Object.entries(oh.spacing).forEach(([t,n])=>{e.push(` --semiont-spacing-${t}: ${n};`)}),Object.entries(oh.typography.fontSize).forEach(([t,n])=>{e.push(` --semiont-text-${t}: ${n};`)}),Object.entries(oh.typography.fontWeight).forEach(([t,n])=>{e.push(` --semiont-font-${t}: ${n};`)}),e.push(` --semiont-font-sans: ${oh.typography.fontFamily.sans};`),e.push(` --semiont-font-mono: ${oh.typography.fontFamily.mono};`),Object.entries(oh.borderRadius).forEach(([t,n])=>{e.push(` --semiont-radius-${t}: ${n};`)}),Object.entries(oh.shadows).forEach(([t,n])=>{e.push(` --semiont-shadow-${t}: ${n};`)}),Object.entries(oh.transitions.duration).forEach(([t,n])=>{e.push(` --semiont-duration-${t}: ${n};`)}),e.push(`}`),e.join(`
9
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}})}}),pu=z({"../../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}}),mu=z({"../../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=uu(),a=fu(),o=pu(),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()}}}),hu=z({"../../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}}}),gu=z({"../../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}}}),_u=z({"../../node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportUnhandledError=void 0;var t=hu(),n=gu();function r(e){n.timeoutProvider.setTimeout(function(){var n=t.config.onUnhandledError;if(n)n(e);else throw e})}e.reportUnhandledError=r}}),vu=z({"../../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}}),yu=z({"../../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}}),bu=z({"../../node_modules/rxjs/dist/cjs/internal/util/errorContext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.captureError=e.errorContext=void 0;var t=hu(),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}}),xu=z({"../../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=uu(),r=mu(),i=hu(),a=_u(),o=vu(),s=yu(),c=gu(),l=bu(),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}}}),Su=z({"../../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`})()}}),Cu=z({"../../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}}),wu=z({"../../node_modules/rxjs/dist/cjs/internal/util/pipe.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pipeFromArray=e.pipe=void 0;var t=Cu();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}}),Tu=z({"../../node_modules/rxjs/dist/cjs/internal/Observable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var t=xu(),n=mu(),r=Su(),i=wu(),a=hu(),o=uu(),s=bu();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)}}}),B=z({"../../node_modules/rxjs/dist/cjs/internal/util/lift.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.operate=e.hasLift=void 0;var t=uu();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}}),V=z({"../../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=xu();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}}),Eu=z({"../../node_modules/rxjs/dist/cjs/internal/operators/refCount.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.refCount=void 0;var t=B(),n=V();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}}),Du=z({"../../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=Tu(),r=mu(),i=Eu(),a=V(),o=B();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)}}),Ou=z({"../../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}}}),ku=z({"../../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=mu();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}}}),Au=z({"../../node_modules/rxjs/dist/cjs/internal/observable/dom/animationFrames.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrames=void 0;var t=Tu(),n=Ou(),r=ku();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()}}),ju=z({"../../node_modules/rxjs/dist/cjs/internal/util/ObjectUnsubscribedError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectUnsubscribedError=void 0,e.ObjectUnsubscribedError=du().createErrorClass(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}})}}),Mu=z({"../../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=Tu(),i=mu(),a=ju(),o=pu(),s=bu(),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}}),Nu=z({"../../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})(Mu().Subject)}}),Pu=z({"../../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}}}),Fu=z({"../../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=Mu(),r=Pu();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)}}),Iu=z({"../../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})(Mu().Subject)}}),Lu=z({"../../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})(mu().Subscription)}}),Ru=z({"../../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}}}),zu=z({"../../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=Lu(),r=Ru(),i=pu();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)}}),Bu=z({"../../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)}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}}}}),Vu=z({"../../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=Bu(),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}}}),Hu=z({"../../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=zu(),r=Vu();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)}}),Uu=z({"../../node_modules/rxjs/dist/cjs/internal/Scheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scheduler=void 0;var t=Pu();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})()}}),Wu=z({"../../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=Uu();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)}}),Gu=z({"../../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})(Wu().AsyncScheduler)}}),Ku=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/asap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.asap=e.asapScheduler=void 0;var t=Hu();e.asapScheduler=new(Gu()).AsapScheduler(t.AsapAction),e.asap=e.asapScheduler}}),qu=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.async=e.asyncScheduler=void 0;var t=zu();e.asyncScheduler=new(Wu()).AsyncScheduler(t.AsyncAction),e.async=e.asyncScheduler}}),Ju=z({"../../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})(zu().AsyncAction)}}),Yu=z({"../../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})(Wu().AsyncScheduler)}}),Xu=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/queue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.queue=e.queueScheduler=void 0;var t=Ju();e.queueScheduler=new(Yu()).QueueScheduler(t.QueueAction),e.queue=e.queueScheduler}}),Zu=z({"../../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=zu(),r=ku();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)}}),Qu=z({"../../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})(Wu().AsyncScheduler)}}),$u=z({"../../node_modules/rxjs/dist/cjs/internal/scheduler/animationFrame.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.animationFrame=e.animationFrameScheduler=void 0;var t=Zu();e.animationFrameScheduler=new(Qu()).AnimationFrameScheduler(t.AnimationFrameAction),e.animationFrame=e.animationFrameScheduler}}),ed=z({"../../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=zu(),r=mu();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})(Wu().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)}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}}),td=z({"../../node_modules/rxjs/dist/cjs/internal/observable/empty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=e.EMPTY=void 0;var t=Tu();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()})})}}}),nd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isScheduler.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isScheduler=void 0;var t=uu();function n(e){return e&&t.isFunction(e.schedule)}e.isScheduler=n}}),rd=z({"../../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=uu(),n=nd();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}}),id=z({"../../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`})}}),ad=z({"../../node_modules/rxjs/dist/cjs/internal/util/isPromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isPromise=void 0;var t=uu();function n(e){return t.isFunction(e?.then)}e.isPromise=n}}),od=z({"../../node_modules/rxjs/dist/cjs/internal/util/isInteropObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isInteropObservable=void 0;var t=Su(),n=uu();function r(e){return n.isFunction(e[t.observable])}e.isInteropObservable=r}}),sd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=void 0;var t=uu();function n(e){return Symbol.asyncIterator&&t.isFunction(e?.[Symbol.asyncIterator])}e.isAsyncIterable=n}}),cd=z({"../../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}}),ld=z({"../../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()}}),ud=z({"../../node_modules/rxjs/dist/cjs/internal/util/isIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterable=void 0;var t=ld(),n=uu();function r(e){return n.isFunction(e?.[t.iterator])}e.isIterable=r}}),dd=z({"../../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=uu();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}}),fd=z({"../../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=id(),o=ad(),s=Tu(),c=od(),l=sd(),u=cd(),d=ud(),f=dd(),p=uu(),m=_u(),h=Su();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]}})})}}}),pd=z({"../../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}}),md=z({"../../node_modules/rxjs/dist/cjs/internal/operators/observeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.observeOn=void 0;var t=pd(),n=B(),r=V();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}}),hd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/subscribeOn.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.subscribeOn=void 0;var t=B();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}}),gd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleObservable=void 0;var t=fd(),n=md(),r=hd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.scheduleObservable=i}}),_d=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/schedulePromise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.schedulePromise=void 0;var t=fd(),n=md(),r=hd();function i(e,i){return t.innerFrom(e).pipe(r.subscribeOn(i),n.observeOn(i))}e.schedulePromise=i}}),vd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleArray=void 0;var t=Tu();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}}),yd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleIterable=void 0;var t=Tu(),n=ld(),r=uu(),i=pd();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}}),bd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleAsyncIterable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleAsyncIterable=void 0;var t=Tu(),n=pd();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}}),xd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduleReadableStreamLike.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleReadableStreamLike=void 0;var t=bd(),n=dd();function r(e,r){return t.scheduleAsyncIterable(n.readableStreamLikeToAsyncGenerator(e),r)}e.scheduleReadableStreamLike=r}}),Sd=z({"../../node_modules/rxjs/dist/cjs/internal/scheduled/scheduled.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scheduled=void 0;var t=gd(),n=_d(),r=vd(),i=yd(),a=bd(),o=od(),s=ad(),c=id(),l=ud(),u=sd(),d=cd(),f=dd(),p=xd();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}}),Cd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/from.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.from=void 0;var t=Sd(),n=fd();function r(e,r){return r?t.scheduled(e,r):n.innerFrom(e)}e.from=r}}),wd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/of.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.of=void 0;var t=rd(),n=Cd();function r(){var e=[...arguments],r=t.popScheduler(e);return n.from(e,r)}e.of=r}}),Td=z({"../../node_modules/rxjs/dist/cjs/internal/observable/throwError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=void 0;var t=Tu(),n=uu();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}}),Ed=z({"../../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=td(),n=wd(),r=Td(),i=uu();(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}}),Dd=z({"../../node_modules/rxjs/dist/cjs/internal/util/isObservable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObservable=void 0;var t=Tu(),n=uu();function r(e){return!!e&&(e instanceof t.Observable||n.isFunction(e.lift)&&n.isFunction(e.subscribe))}e.isObservable=r}}),Od=z({"../../node_modules/rxjs/dist/cjs/internal/util/EmptyError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyError=void 0,e.EmptyError=du().createErrorClass(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}})}}),kd=z({"../../node_modules/rxjs/dist/cjs/internal/lastValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.lastValueFrom=void 0;var t=Od();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}}),Ad=z({"../../node_modules/rxjs/dist/cjs/internal/firstValueFrom.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.firstValueFrom=void 0;var t=Od(),n=xu();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}}),jd=z({"../../node_modules/rxjs/dist/cjs/internal/util/ArgumentOutOfRangeError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ArgumentOutOfRangeError=void 0,e.ArgumentOutOfRangeError=du().createErrorClass(function(e){return function(){e(this),this.name=`ArgumentOutOfRangeError`,this.message=`argument out of range`}})}}),Md=z({"../../node_modules/rxjs/dist/cjs/internal/util/NotFoundError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NotFoundError=void 0,e.NotFoundError=du().createErrorClass(function(e){return function(t){e(this),this.name=`NotFoundError`,this.message=t}})}}),Nd=z({"../../node_modules/rxjs/dist/cjs/internal/util/SequenceError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SequenceError=void 0,e.SequenceError=du().createErrorClass(function(e){return function(t){e(this),this.name=`SequenceError`,this.message=t}})}}),Pd=z({"../../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}}),Fd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeout.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeout=e.TimeoutError=void 0;var t=qu(),n=Pd(),r=B(),i=fd(),a=du(),o=V(),s=pd();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)}}}),Id=z({"../../node_modules/rxjs/dist/cjs/internal/operators/map.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=void 0;var t=B(),n=V();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}}),Ld=z({"../../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=Id(),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}}),Rd=z({"../../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=nd(),i=Tu(),a=hd(),o=Ld(),s=md(),c=Iu();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}}),zd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/bindCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindCallback=void 0;var t=Rd();function n(e,n,r){return t.bindCallbackInternals(!1,e,n,r)}e.bindCallback=n}}),Bd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/bindNodeCallback.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindNodeCallback=void 0;var t=Rd();function n(e,n,r){return t.bindCallbackInternals(!0,e,n,r)}e.bindNodeCallback=n}}),Vd=z({"../../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}}}),Hd=z({"../../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}}),Ud=z({"../../node_modules/rxjs/dist/cjs/internal/observable/combineLatest.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestInit=e.combineLatest=void 0;var t=Tu(),n=Vd(),r=Cd(),i=Cu(),a=Ld(),o=rd(),s=Hd(),c=V(),l=pd();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()}}}),Wd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeInternals=void 0;var t=fd(),n=pd(),r=V();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}}),Gd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMap=void 0;var t=Id(),n=fd(),r=B(),i=Wd(),a=uu();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}}),Kd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAll=void 0;var t=Gd(),n=Cu();function r(e){return e===void 0&&(e=1/0),t.mergeMap(n.identity,e)}e.mergeAll=r}}),qd=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatAll=void 0;var t=Kd();function n(){return t.mergeAll(1)}e.concatAll=n}}),Jd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/concat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concat=void 0;var t=qd(),n=rd(),r=Cd();function i(){var e=[...arguments];return t.concatAll()(r.from(e,n.popScheduler(e)))}e.concat=i}}),Yd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/defer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defer=void 0;var t=Tu(),n=fd();function r(e){return new t.Observable(function(t){n.innerFrom(e()).subscribe(t)})}e.defer=r}}),Xd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/connectable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connectable=void 0;var t=Mu(),n=Tu(),r=Yd(),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||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}}),Zd=z({"../../node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.forkJoin=void 0;var t=Tu(),n=Vd(),r=fd(),i=rd(),a=V(),o=Ld(),s=Hd();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}}),Qd=z({"../../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=fd(),r=Tu(),i=Gd(),a=id(),o=uu(),s=Ld(),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)}}}),$d=z({"../../node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromEventPattern=void 0;var t=Tu(),n=uu(),r=Ld();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}}),ef=z({"../../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=Cu(),r=nd(),i=Yd(),a=yd();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}}),tf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/iif.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.iif=void 0;var t=Yd();function n(e,n,r){return t.defer(function(){return e()?n:r})}e.iif=n}}),nf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/timer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timer=void 0;var t=Tu(),n=qu(),r=nd(),i=Pd();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}}),rf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/interval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.interval=void 0;var t=qu(),n=nf();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}}),af=z({"../../node_modules/rxjs/dist/cjs/internal/observable/merge.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var t=Kd(),n=fd(),r=td(),i=rd(),a=Cd();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}}),of=z({"../../node_modules/rxjs/dist/cjs/internal/observable/never.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.never=e.NEVER=void 0;var t=Tu(),n=vu();e.NEVER=new t.Observable(n.noop);function r(){return e.NEVER}e.never=r}}),sf=z({"../../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}}),cf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/onErrorResumeNext.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.onErrorResumeNext=void 0;var t=Tu(),n=sf(),r=V(),i=vu(),a=fd();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}}),lf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/pairs.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairs=void 0;var t=Cd();function n(e,n){return t.from(Object.entries(e),n)}e.pairs=n}}),uf=z({"../../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}}),df=z({"../../node_modules/rxjs/dist/cjs/internal/operators/filter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=void 0;var t=B(),n=V();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}}),ff=z({"../../node_modules/rxjs/dist/cjs/internal/observable/partition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.partition=void 0;var t=uf(),n=df(),r=fd();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}}),pf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/race.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.raceInit=e.race=void 0;var t=Tu(),n=fd(),r=sf(),i=V();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}}),mf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/range.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=void 0;var t=Tu(),n=td();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}}),hf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/using.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.using=void 0;var t=Tu(),n=fd(),r=td();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}}),gf=z({"../../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=Tu(),i=fd(),a=sf(),o=td(),s=V(),c=rd();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}}),_f=z({"../../node_modules/rxjs/dist/cjs/internal/types.js"(e){Object.defineProperty(e,"__esModule",{value:!0})}}),vf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/audit.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.audit=void 0;var t=B(),n=fd(),r=V();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}}),yf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/auditTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.auditTime=void 0;var t=qu(),n=vf(),r=nf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.audit(function(){return r.timer(e,i)})}e.auditTime=i}}),bf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/buffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buffer=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),xf=z({"../../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=B(),r=V(),i=pu();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}}),Sf=z({"../../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=mu(),r=B(),i=V(),a=pu(),o=qu(),s=rd(),c=pd();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}}),Cf=z({"../../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=mu(),r=B(),i=fd(),a=V(),o=vu(),s=pu();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}}),wf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/bufferWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bufferWhen=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),Tf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/catchError.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.catchError=void 0;var t=fd(),n=V(),r=B();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}}),Ef=z({"../../node_modules/rxjs/dist/cjs/internal/operators/scanInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scanInternals=void 0;var t=V();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}}),Df=z({"../../node_modules/rxjs/dist/cjs/internal/operators/reduce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=void 0;var t=Ef(),n=B();function r(e,r){return n.operate(t.scanInternals(e,r,arguments.length>=2,!1,!0))}e.reduce=r}}),Of=z({"../../node_modules/rxjs/dist/cjs/internal/operators/toArray.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toArray=void 0;var t=Df(),n=B(),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}}),kf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/joinAllInternals.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.joinAllInternals=void 0;var t=Cu(),n=Ld(),r=wu(),i=Gd(),a=Of();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}}),Af=z({"../../node_modules/rxjs/dist/cjs/internal/operators/combineLatestAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineLatestAll=void 0;var t=Ud(),n=kf();function r(e){return n.joinAllInternals(t.combineLatest,e)}e.combineLatestAll=r}}),jf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/combineAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.combineAll=void 0,e.combineAll=Af().combineLatestAll}}),Mf=z({"../../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=Ud(),i=B(),a=sf(),o=Ld(),s=wu(),c=rd();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}}),Nf=z({"../../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=Mf();function i(){var e=[...arguments];return r.combineLatest.apply(void 0,n([],t(e)))}e.combineLatestWith=i}}),Pf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMap=void 0;var t=Gd(),n=uu();function r(e,r){return n.isFunction(r)?t.mergeMap(e,r,1):t.mergeMap(e,1)}e.concatMap=r}}),Ff=z({"../../node_modules/rxjs/dist/cjs/internal/operators/concatMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.concatMapTo=void 0;var t=Pf(),n=uu();function r(e,r){return n.isFunction(r)?t.concatMap(function(){return e},r):t.concatMap(function(){return e})}e.concatMapTo=r}}),If=z({"../../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=B(),i=qd(),a=rd(),o=Cd();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}}),Lf=z({"../../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=If();function i(){var e=[...arguments];return r.concat.apply(void 0,n([],t(e)))}e.concatWith=i}}),Rf=z({"../../node_modules/rxjs/dist/cjs/internal/observable/fromSubscribable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromSubscribable=void 0;var t=Tu();function n(e){return new t.Observable(function(t){return e.subscribe(t)})}e.fromSubscribable=n}}),zf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/connect.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.connect=void 0;var t=Mu(),n=fd(),r=B(),i=Rf(),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}}),Bf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/count.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.count=void 0;var t=Df();function n(e){return t.reduce(function(t,n,r){return!e||e(n,r)?t+1:t},0)}e.count=n}}),Vf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/debounce.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=void 0;var t=B(),n=vu(),r=V(),i=fd();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}}),Hf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/debounceTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.debounceTime=void 0;var t=qu(),n=B(),r=V();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}}),Uf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/defaultIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultIfEmpty=void 0;var t=B(),n=V();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}}),Wf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/take.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=void 0;var t=td(),n=B(),r=V();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}}),Gf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/ignoreElements.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ignoreElements=void 0;var t=B(),n=V(),r=vu();function i(){return t.operate(function(e,t){e.subscribe(n.createOperatorSubscriber(t,r.noop))})}e.ignoreElements=i}}),Kf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapTo=void 0;var t=Id();function n(e){return t.map(function(){return e})}e.mapTo=n}}),qf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/delayWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delayWhen=void 0;var t=Jd(),n=Wf(),r=Gf(),i=Kf(),a=Gd(),o=fd();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}}),Jf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/delay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0;var t=qu(),n=qf(),r=nf();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}}),Yf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/dematerialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.dematerialize=void 0;var t=Ed(),n=B(),r=V();function i(){return n.operate(function(e,n){e.subscribe(r.createOperatorSubscriber(n,function(e){return t.observeNotification(e,n)}))})}e.dematerialize=i}}),Xf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinct.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinct=void 0;var t=B(),n=V(),r=vu(),i=fd();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}}),Zf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilChanged=void 0;var t=Cu(),n=B(),r=V();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}}}),Qf=z({"../../node_modules/rxjs/dist/cjs/internal/operators/distinctUntilKeyChanged.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.distinctUntilKeyChanged=void 0;var t=Zf();function n(e,n){return t.distinctUntilChanged(function(t,r){return n?n(t[e],r[e]):t[e]===r[e]})}e.distinctUntilKeyChanged=n}}),$f=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throwIfEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throwIfEmpty=void 0;var t=Od(),n=B(),r=V();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}}}),ep=z({"../../node_modules/rxjs/dist/cjs/internal/operators/elementAt.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.elementAt=void 0;var t=jd(),n=df(),r=$f(),i=Uf(),a=Wf();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}}),tp=z({"../../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=Jd(),i=wd();function a(){var e=[...arguments];return function(a){return r.concat(a,i.of.apply(void 0,n([],t(e))))}}e.endWith=a}}),np=z({"../../node_modules/rxjs/dist/cjs/internal/operators/every.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.every=void 0;var t=B(),n=V();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}}),rp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustMap=void 0;var t=Id(),n=fd(),r=B(),i=V();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}}),ip=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaustAll=void 0;var t=rp(),n=Cu();function r(){return t.exhaustMap(n.identity)}e.exhaustAll=r}}),ap=z({"../../node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.exhaust=void 0,e.exhaust=ip().exhaustAll}}),op=z({"../../node_modules/rxjs/dist/cjs/internal/operators/expand.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.expand=void 0;var t=B(),n=Wd();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}}),sp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/finalize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.finalize=void 0;var t=B();function n(e){return t.operate(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}e.finalize=n}}),cp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/find.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createFind=e.find=void 0;var t=B(),n=V();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}}),lp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/findIndex.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findIndex=void 0;var t=B(),n=cp();function r(e,r){return t.operate(n.createFind(e,r,`index`))}e.findIndex=r}}),up=z({"../../node_modules/rxjs/dist/cjs/internal/operators/first.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.first=void 0;var t=Od(),n=df(),r=Wf(),i=Uf(),a=$f(),o=Cu();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}}),dp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.groupBy=void 0;var t=Tu(),n=fd(),r=Mu(),i=B(),a=V();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}}),fp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/isEmpty.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=void 0;var t=B(),n=V();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}}),pp=z({"../../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=td(),r=B(),i=V();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}}),mp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/last.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.last=void 0;var t=Od(),n=df(),r=pp(),i=$f(),a=Uf(),o=Cu();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}}),hp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/materialize.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.materialize=void 0;var t=Ed(),n=B(),r=V();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}}),gp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/max.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.max=void 0;var t=Df(),n=uu();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}}),_p=z({"../../node_modules/rxjs/dist/cjs/internal/operators/flatMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.flatMap=void 0,e.flatMap=Gd().mergeMap}}),vp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMapTo=void 0;var t=Gd(),n=uu();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}}),yp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/mergeScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeScan=void 0;var t=B(),n=Wd();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}}),bp=z({"../../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=B(),i=Kd(),a=rd(),o=Cd();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}}),xp=z({"../../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=bp();function i(){var e=[...arguments];return r.merge.apply(void 0,n([],t(e)))}e.mergeWith=i}}),Sp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/min.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.min=void 0;var t=Df(),n=uu();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}}),Cp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/multicast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.multicast=void 0;var t=Du(),n=uu(),r=zf();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}}),wp=z({"../../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=sf(),i=cf();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}}),Tp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/pairwise.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pairwise=void 0;var t=B(),n=V();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}}),Ep=z({"../../node_modules/rxjs/dist/cjs/internal/operators/pluck.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pluck=void 0;var t=Id();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}}),Dp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publish.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publish=void 0;var t=Mu(),n=Cp(),r=zf();function i(e){return e?function(t){return r.connect(e)(t)}:function(e){return n.multicast(new t.Subject)(e)}}e.publish=i}}),Op=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishBehavior.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishBehavior=void 0;var t=Nu(),n=Du();function r(e){return function(r){var i=new t.BehaviorSubject(e);return new n.ConnectableObservable(r,function(){return i})}}e.publishBehavior=r}}),kp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishLast=void 0;var t=Iu(),n=Du();function r(){return function(e){var r=new t.AsyncSubject;return new n.ConnectableObservable(e,function(){return r})}}e.publishLast=r}}),Ap=z({"../../node_modules/rxjs/dist/cjs/internal/operators/publishReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.publishReplay=void 0;var t=Fu(),n=Cp(),r=uu();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}}),jp=z({"../../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=pf(),i=B(),a=Cu();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}}),Mp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/repeat.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=void 0;var t=td(),n=B(),r=V(),i=fd(),a=nf();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}}),Np=z({"../../node_modules/rxjs/dist/cjs/internal/operators/repeatWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeatWhen=void 0;var t=fd(),n=Mu(),r=B(),i=V();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}}),Pp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/retry.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retry=void 0;var t=B(),n=V(),r=Cu(),i=nf(),a=fd();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&&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}}),Fp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/retryWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.retryWhen=void 0;var t=fd(),n=Mu(),r=B(),i=V();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}}),Ip=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sample.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sample=void 0;var t=fd(),n=B(),r=vu(),i=V();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}}),Lp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sampleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sampleTime=void 0;var t=qu(),n=Ip(),r=rf();function i(e,i){return i===void 0&&(i=t.asyncScheduler),n.sample(r.interval(e,i))}e.sampleTime=i}}),Rp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/scan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.scan=void 0;var t=B(),n=Ef();function r(e,r){return t.operate(n.scanInternals(e,r,arguments.length>=2,!0))}e.scan=r}}),zp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/sequenceEqual.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sequenceEqual=void 0;var t=B(),n=V(),r=fd();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}}}}),Bp=z({"../../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=fd(),i=Mu(),a=xu(),o=B();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||s,u=e.resetOnComplete,d=u===void 0||u,f=e.resetOnRefCountZero,p=f===void 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)}}}}),Vp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/shareReplay.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shareReplay=void 0;var t=Fu(),n=Bp();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&&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}}),Hp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/single.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.single=void 0;var t=Od(),n=Nd(),r=Md(),i=B(),a=V();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}}),Up=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skip.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skip=void 0;var t=df();function n(e){return t.filter(function(t,n){return e<=n})}e.skip=n}}),Wp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipLast.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipLast=void 0;var t=Cu(),n=B(),r=V();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}}),Gp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipUntil=void 0;var t=B(),n=V(),r=fd(),i=vu();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}}),Kp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/skipWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.skipWhile=void 0;var t=B(),n=V();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}}),qp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/startWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.startWith=void 0;var t=Jd(),n=rd(),r=B();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}}),Jp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMap=void 0;var t=fd(),n=B(),r=V();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}}),Yp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchAll=void 0;var t=Jp(),n=Cu();function r(){return t.switchMap(n.identity)}e.switchAll=r}}),Xp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchMapTo.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchMapTo=void 0;var t=Jp(),n=uu();function r(e,r){return n.isFunction(r)?t.switchMap(function(){return e},r):t.switchMap(function(){return e})}e.switchMapTo=r}}),Zp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/switchScan.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.switchScan=void 0;var t=Jp(),n=B();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}}),Qp=z({"../../node_modules/rxjs/dist/cjs/internal/operators/takeUntil.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeUntil=void 0;var t=B(),n=V(),r=fd(),i=vu();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}}),$p=z({"../../node_modules/rxjs/dist/cjs/internal/operators/takeWhile.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.takeWhile=void 0;var t=B(),n=V();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}}),em=z({"../../node_modules/rxjs/dist/cjs/internal/operators/tap.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tap=void 0;var t=uu(),n=B(),r=V(),i=Cu();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}}),tm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throttle.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=void 0;var t=B(),n=V(),r=fd();function i(e,i){return t.operate(function(t,a){var o=i??{},s=o.leading,c=s===void 0||s,l=o.trailing,u=l!==void 0&&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}}),nm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/throttleTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.throttleTime=void 0;var t=qu(),n=tm(),r=nf();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}}),rm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeInterval.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimeInterval=e.timeInterval=void 0;var t=qu(),n=B(),r=V();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}}),im=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeoutWith=void 0;var t=qu(),n=Pd(),r=Fd();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}}),am=z({"../../node_modules/rxjs/dist/cjs/internal/operators/timestamp.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timestamp=void 0;var t=Pu(),n=Id();function r(e){return e===void 0&&(e=t.dateTimestampProvider),n.map(function(t){return{value:t,timestamp:e.now()}})}e.timestamp=r}}),om=z({"../../node_modules/rxjs/dist/cjs/internal/operators/window.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.window=void 0;var t=Mu(),n=B(),r=V(),i=vu(),a=fd();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}}),sm=z({"../../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=Mu(),r=B(),i=V();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}}),cm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/windowTime.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowTime=void 0;var t=Mu(),n=qu(),r=mu(),i=B(),a=V(),o=pu(),s=rd(),c=pd();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}}),lm=z({"../../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=Mu(),r=mu(),i=B(),a=fd(),o=V(),s=vu(),c=pu();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}}),um=z({"../../node_modules/rxjs/dist/cjs/internal/operators/windowWhen.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.windowWhen=void 0;var t=Mu(),n=B(),r=V(),i=fd();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}}),dm=z({"../../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=B(),i=V(),a=fd(),o=Cu(),s=vu(),c=rd();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}}),fm=z({"../../node_modules/rxjs/dist/cjs/internal/operators/zipAll.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.zipAll=void 0;var t=gf(),n=kf();function r(e){return n.joinAllInternals(t.zip,e)}e.zipAll=r}}),pm=z({"../../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=gf(),i=B();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}}),mm=z({"../../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=pm();function i(){var e=[...arguments];return r.zip.apply(void 0,n([],t(e)))}e.zipWith=i}}),hm=z({"../../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=Tu();Object.defineProperty(e,"Observable",{enumerable:!0,get:function(){return r.Observable}});var i=Du();Object.defineProperty(e,"ConnectableObservable",{enumerable:!0,get:function(){return i.ConnectableObservable}});var a=Su();Object.defineProperty(e,"observable",{enumerable:!0,get:function(){return a.observable}});var o=Au();Object.defineProperty(e,"animationFrames",{enumerable:!0,get:function(){return o.animationFrames}});var s=Mu();Object.defineProperty(e,"Subject",{enumerable:!0,get:function(){return s.Subject}});var c=Nu();Object.defineProperty(e,"BehaviorSubject",{enumerable:!0,get:function(){return c.BehaviorSubject}});var l=Fu();Object.defineProperty(e,"ReplaySubject",{enumerable:!0,get:function(){return l.ReplaySubject}});var u=Iu();Object.defineProperty(e,"AsyncSubject",{enumerable:!0,get:function(){return u.AsyncSubject}});var d=Ku();Object.defineProperty(e,"asap",{enumerable:!0,get:function(){return d.asap}}),Object.defineProperty(e,"asapScheduler",{enumerable:!0,get:function(){return d.asapScheduler}});var f=qu();Object.defineProperty(e,"async",{enumerable:!0,get:function(){return f.async}}),Object.defineProperty(e,"asyncScheduler",{enumerable:!0,get:function(){return f.asyncScheduler}});var p=Xu();Object.defineProperty(e,"queue",{enumerable:!0,get:function(){return p.queue}}),Object.defineProperty(e,"queueScheduler",{enumerable:!0,get:function(){return p.queueScheduler}});var m=$u();Object.defineProperty(e,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(e,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var h=ed();Object.defineProperty(e,"VirtualTimeScheduler",{enumerable:!0,get:function(){return h.VirtualTimeScheduler}}),Object.defineProperty(e,"VirtualAction",{enumerable:!0,get:function(){return h.VirtualAction}});var g=Uu();Object.defineProperty(e,"Scheduler",{enumerable:!0,get:function(){return g.Scheduler}});var _=mu();Object.defineProperty(e,"Subscription",{enumerable:!0,get:function(){return _.Subscription}});var v=xu();Object.defineProperty(e,"Subscriber",{enumerable:!0,get:function(){return v.Subscriber}});var y=Ed();Object.defineProperty(e,"Notification",{enumerable:!0,get:function(){return y.Notification}}),Object.defineProperty(e,"NotificationKind",{enumerable:!0,get:function(){return y.NotificationKind}});var b=wu();Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return b.pipe}});var x=vu();Object.defineProperty(e,"noop",{enumerable:!0,get:function(){return x.noop}});var S=Cu();Object.defineProperty(e,"identity",{enumerable:!0,get:function(){return S.identity}});var C=Dd();Object.defineProperty(e,"isObservable",{enumerable:!0,get:function(){return C.isObservable}});var w=kd();Object.defineProperty(e,"lastValueFrom",{enumerable:!0,get:function(){return w.lastValueFrom}});var T=Ad();Object.defineProperty(e,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var E=jd();Object.defineProperty(e,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return E.ArgumentOutOfRangeError}});var D=Od();Object.defineProperty(e,"EmptyError",{enumerable:!0,get:function(){return D.EmptyError}});var O=Md();Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return O.NotFoundError}});var k=ju();Object.defineProperty(e,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return k.ObjectUnsubscribedError}});var A=Nd();Object.defineProperty(e,"SequenceError",{enumerable:!0,get:function(){return A.SequenceError}});var j=Fd();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return j.TimeoutError}});var M=fu();Object.defineProperty(e,"UnsubscriptionError",{enumerable:!0,get:function(){return M.UnsubscriptionError}});var ee=zd();Object.defineProperty(e,"bindCallback",{enumerable:!0,get:function(){return ee.bindCallback}});var N=Bd();Object.defineProperty(e,"bindNodeCallback",{enumerable:!0,get:function(){return N.bindNodeCallback}});var te=Ud();Object.defineProperty(e,"combineLatest",{enumerable:!0,get:function(){return te.combineLatest}});var P=Jd();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return P.concat}});var F=Xd();Object.defineProperty(e,"connectable",{enumerable:!0,get:function(){return F.connectable}});var ne=Yd();Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return ne.defer}});var re=td();Object.defineProperty(e,"empty",{enumerable:!0,get:function(){return re.empty}});var ie=Zd();Object.defineProperty(e,"forkJoin",{enumerable:!0,get:function(){return ie.forkJoin}});var ae=Cd();Object.defineProperty(e,"from",{enumerable:!0,get:function(){return ae.from}});var oe=Qd();Object.defineProperty(e,"fromEvent",{enumerable:!0,get:function(){return oe.fromEvent}});var se=$d();Object.defineProperty(e,"fromEventPattern",{enumerable:!0,get:function(){return se.fromEventPattern}});var I=ef();Object.defineProperty(e,"generate",{enumerable:!0,get:function(){return I.generate}});var L=tf();Object.defineProperty(e,"iif",{enumerable:!0,get:function(){return L.iif}});var ce=rf();Object.defineProperty(e,"interval",{enumerable:!0,get:function(){return ce.interval}});var le=af();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return le.merge}});var R=of();Object.defineProperty(e,"never",{enumerable:!0,get:function(){return R.never}});var ue=wd();Object.defineProperty(e,"of",{enumerable:!0,get:function(){return ue.of}});var de=cf();Object.defineProperty(e,"onErrorResumeNext",{enumerable:!0,get:function(){return de.onErrorResumeNext}});var fe=lf();Object.defineProperty(e,"pairs",{enumerable:!0,get:function(){return fe.pairs}});var pe=ff();Object.defineProperty(e,"partition",{enumerable:!0,get:function(){return pe.partition}});var me=pf();Object.defineProperty(e,"race",{enumerable:!0,get:function(){return me.race}});var he=mf();Object.defineProperty(e,"range",{enumerable:!0,get:function(){return he.range}});var ge=Td();Object.defineProperty(e,"throwError",{enumerable:!0,get:function(){return ge.throwError}});var _e=nf();Object.defineProperty(e,"timer",{enumerable:!0,get:function(){return _e.timer}});var ve=hf();Object.defineProperty(e,"using",{enumerable:!0,get:function(){return ve.using}});var ye=gf();Object.defineProperty(e,"zip",{enumerable:!0,get:function(){return ye.zip}});var be=Sd();Object.defineProperty(e,"scheduled",{enumerable:!0,get:function(){return be.scheduled}});var xe=td();Object.defineProperty(e,"EMPTY",{enumerable:!0,get:function(){return xe.EMPTY}});var Se=of();Object.defineProperty(e,"NEVER",{enumerable:!0,get:function(){return Se.NEVER}}),n(_f(),e);var Ce=hu();Object.defineProperty(e,"config",{enumerable:!0,get:function(){return Ce.config}});var z=vf();Object.defineProperty(e,"audit",{enumerable:!0,get:function(){return z.audit}});var we=yf();Object.defineProperty(e,"auditTime",{enumerable:!0,get:function(){return we.auditTime}});var Te=bf();Object.defineProperty(e,"buffer",{enumerable:!0,get:function(){return Te.buffer}});var Ee=xf();Object.defineProperty(e,"bufferCount",{enumerable:!0,get:function(){return Ee.bufferCount}});var De=Sf();Object.defineProperty(e,"bufferTime",{enumerable:!0,get:function(){return De.bufferTime}});var Oe=Cf();Object.defineProperty(e,"bufferToggle",{enumerable:!0,get:function(){return Oe.bufferToggle}});var ke=wf();Object.defineProperty(e,"bufferWhen",{enumerable:!0,get:function(){return ke.bufferWhen}});var Ae=Tf();Object.defineProperty(e,"catchError",{enumerable:!0,get:function(){return Ae.catchError}});var je=jf();Object.defineProperty(e,"combineAll",{enumerable:!0,get:function(){return je.combineAll}});var Me=Af();Object.defineProperty(e,"combineLatestAll",{enumerable:!0,get:function(){return Me.combineLatestAll}});var Ne=Nf();Object.defineProperty(e,"combineLatestWith",{enumerable:!0,get:function(){return Ne.combineLatestWith}});var Pe=qd();Object.defineProperty(e,"concatAll",{enumerable:!0,get:function(){return Pe.concatAll}});var Fe=Pf();Object.defineProperty(e,"concatMap",{enumerable:!0,get:function(){return Fe.concatMap}});var Ie=Ff();Object.defineProperty(e,"concatMapTo",{enumerable:!0,get:function(){return Ie.concatMapTo}});var Le=Lf();Object.defineProperty(e,"concatWith",{enumerable:!0,get:function(){return Le.concatWith}});var Re=zf();Object.defineProperty(e,"connect",{enumerable:!0,get:function(){return Re.connect}});var ze=Bf();Object.defineProperty(e,"count",{enumerable:!0,get:function(){return ze.count}});var Be=Vf();Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return Be.debounce}});var Ve=Hf();Object.defineProperty(e,"debounceTime",{enumerable:!0,get:function(){return Ve.debounceTime}});var He=Uf();Object.defineProperty(e,"defaultIfEmpty",{enumerable:!0,get:function(){return He.defaultIfEmpty}});var Ue=Jf();Object.defineProperty(e,"delay",{enumerable:!0,get:function(){return Ue.delay}});var We=qf();Object.defineProperty(e,"delayWhen",{enumerable:!0,get:function(){return We.delayWhen}});var Ge=Yf();Object.defineProperty(e,"dematerialize",{enumerable:!0,get:function(){return Ge.dematerialize}});var Ke=Xf();Object.defineProperty(e,"distinct",{enumerable:!0,get:function(){return Ke.distinct}});var qe=Zf();Object.defineProperty(e,"distinctUntilChanged",{enumerable:!0,get:function(){return qe.distinctUntilChanged}});var Je=Qf();Object.defineProperty(e,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Je.distinctUntilKeyChanged}});var Ye=ep();Object.defineProperty(e,"elementAt",{enumerable:!0,get:function(){return Ye.elementAt}});var Xe=tp();Object.defineProperty(e,"endWith",{enumerable:!0,get:function(){return Xe.endWith}});var Ze=np();Object.defineProperty(e,"every",{enumerable:!0,get:function(){return Ze.every}});var Qe=ap();Object.defineProperty(e,"exhaust",{enumerable:!0,get:function(){return Qe.exhaust}});var $e=ip();Object.defineProperty(e,"exhaustAll",{enumerable:!0,get:function(){return $e.exhaustAll}});var et=rp();Object.defineProperty(e,"exhaustMap",{enumerable:!0,get:function(){return et.exhaustMap}});var tt=op();Object.defineProperty(e,"expand",{enumerable:!0,get:function(){return tt.expand}});var nt=df();Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return nt.filter}});var rt=sp();Object.defineProperty(e,"finalize",{enumerable:!0,get:function(){return rt.finalize}});var it=cp();Object.defineProperty(e,"find",{enumerable:!0,get:function(){return it.find}});var at=lp();Object.defineProperty(e,"findIndex",{enumerable:!0,get:function(){return at.findIndex}});var ot=up();Object.defineProperty(e,"first",{enumerable:!0,get:function(){return ot.first}});var st=dp();Object.defineProperty(e,"groupBy",{enumerable:!0,get:function(){return st.groupBy}});var ct=Gf();Object.defineProperty(e,"ignoreElements",{enumerable:!0,get:function(){return ct.ignoreElements}});var lt=fp();Object.defineProperty(e,"isEmpty",{enumerable:!0,get:function(){return lt.isEmpty}});var ut=mp();Object.defineProperty(e,"last",{enumerable:!0,get:function(){return ut.last}});var dt=Id();Object.defineProperty(e,"map",{enumerable:!0,get:function(){return dt.map}});var ft=Kf();Object.defineProperty(e,"mapTo",{enumerable:!0,get:function(){return ft.mapTo}});var pt=hp();Object.defineProperty(e,"materialize",{enumerable:!0,get:function(){return pt.materialize}});var mt=gp();Object.defineProperty(e,"max",{enumerable:!0,get:function(){return mt.max}});var ht=Kd();Object.defineProperty(e,"mergeAll",{enumerable:!0,get:function(){return ht.mergeAll}});var gt=_p();Object.defineProperty(e,"flatMap",{enumerable:!0,get:function(){return gt.flatMap}});var _t=Gd();Object.defineProperty(e,"mergeMap",{enumerable:!0,get:function(){return _t.mergeMap}});var vt=vp();Object.defineProperty(e,"mergeMapTo",{enumerable:!0,get:function(){return vt.mergeMapTo}});var yt=yp();Object.defineProperty(e,"mergeScan",{enumerable:!0,get:function(){return yt.mergeScan}});var bt=xp();Object.defineProperty(e,"mergeWith",{enumerable:!0,get:function(){return bt.mergeWith}});var xt=Sp();Object.defineProperty(e,"min",{enumerable:!0,get:function(){return xt.min}});var St=Cp();Object.defineProperty(e,"multicast",{enumerable:!0,get:function(){return St.multicast}});var Ct=md();Object.defineProperty(e,"observeOn",{enumerable:!0,get:function(){return Ct.observeOn}});var wt=wp();Object.defineProperty(e,"onErrorResumeNextWith",{enumerable:!0,get:function(){return wt.onErrorResumeNextWith}});var Tt=Tp();Object.defineProperty(e,"pairwise",{enumerable:!0,get:function(){return Tt.pairwise}});var Et=Ep();Object.defineProperty(e,"pluck",{enumerable:!0,get:function(){return Et.pluck}});var Dt=Dp();Object.defineProperty(e,"publish",{enumerable:!0,get:function(){return Dt.publish}});var Ot=Op();Object.defineProperty(e,"publishBehavior",{enumerable:!0,get:function(){return Ot.publishBehavior}});var kt=kp();Object.defineProperty(e,"publishLast",{enumerable:!0,get:function(){return kt.publishLast}});var At=Ap();Object.defineProperty(e,"publishReplay",{enumerable:!0,get:function(){return At.publishReplay}});var jt=jp();Object.defineProperty(e,"raceWith",{enumerable:!0,get:function(){return jt.raceWith}});var Mt=Df();Object.defineProperty(e,"reduce",{enumerable:!0,get:function(){return Mt.reduce}});var Nt=Mp();Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return Nt.repeat}});var Pt=Np();Object.defineProperty(e,"repeatWhen",{enumerable:!0,get:function(){return Pt.repeatWhen}});var Ft=Pp();Object.defineProperty(e,"retry",{enumerable:!0,get:function(){return Ft.retry}});var It=Fp();Object.defineProperty(e,"retryWhen",{enumerable:!0,get:function(){return It.retryWhen}});var Lt=Eu();Object.defineProperty(e,"refCount",{enumerable:!0,get:function(){return Lt.refCount}});var Rt=Ip();Object.defineProperty(e,"sample",{enumerable:!0,get:function(){return Rt.sample}});var zt=Lp();Object.defineProperty(e,"sampleTime",{enumerable:!0,get:function(){return zt.sampleTime}});var Bt=Rp();Object.defineProperty(e,"scan",{enumerable:!0,get:function(){return Bt.scan}});var Vt=zp();Object.defineProperty(e,"sequenceEqual",{enumerable:!0,get:function(){return Vt.sequenceEqual}});var Ht=Bp();Object.defineProperty(e,"share",{enumerable:!0,get:function(){return Ht.share}});var Ut=Vp();Object.defineProperty(e,"shareReplay",{enumerable:!0,get:function(){return Ut.shareReplay}});var Wt=Hp();Object.defineProperty(e,"single",{enumerable:!0,get:function(){return Wt.single}});var Gt=Up();Object.defineProperty(e,"skip",{enumerable:!0,get:function(){return Gt.skip}});var Kt=Wp();Object.defineProperty(e,"skipLast",{enumerable:!0,get:function(){return Kt.skipLast}});var qt=Gp();Object.defineProperty(e,"skipUntil",{enumerable:!0,get:function(){return qt.skipUntil}});var Jt=Kp();Object.defineProperty(e,"skipWhile",{enumerable:!0,get:function(){return Jt.skipWhile}});var Yt=qp();Object.defineProperty(e,"startWith",{enumerable:!0,get:function(){return Yt.startWith}});var Xt=hd();Object.defineProperty(e,"subscribeOn",{enumerable:!0,get:function(){return Xt.subscribeOn}});var Zt=Yp();Object.defineProperty(e,"switchAll",{enumerable:!0,get:function(){return Zt.switchAll}});var Qt=Jp();Object.defineProperty(e,"switchMap",{enumerable:!0,get:function(){return Qt.switchMap}});var $t=Xp();Object.defineProperty(e,"switchMapTo",{enumerable:!0,get:function(){return $t.switchMapTo}});var en=Zp();Object.defineProperty(e,"switchScan",{enumerable:!0,get:function(){return en.switchScan}});var tn=Wf();Object.defineProperty(e,"take",{enumerable:!0,get:function(){return tn.take}});var nn=pp();Object.defineProperty(e,"takeLast",{enumerable:!0,get:function(){return nn.takeLast}});var rn=Qp();Object.defineProperty(e,"takeUntil",{enumerable:!0,get:function(){return rn.takeUntil}});var an=$p();Object.defineProperty(e,"takeWhile",{enumerable:!0,get:function(){return an.takeWhile}});var on=em();Object.defineProperty(e,"tap",{enumerable:!0,get:function(){return on.tap}});var sn=tm();Object.defineProperty(e,"throttle",{enumerable:!0,get:function(){return sn.throttle}});var cn=nm();Object.defineProperty(e,"throttleTime",{enumerable:!0,get:function(){return cn.throttleTime}});var ln=$f();Object.defineProperty(e,"throwIfEmpty",{enumerable:!0,get:function(){return ln.throwIfEmpty}});var un=rm();Object.defineProperty(e,"timeInterval",{enumerable:!0,get:function(){return un.timeInterval}});var dn=Fd();Object.defineProperty(e,"timeout",{enumerable:!0,get:function(){return dn.timeout}});var fn=im();Object.defineProperty(e,"timeoutWith",{enumerable:!0,get:function(){return fn.timeoutWith}});var pn=am();Object.defineProperty(e,"timestamp",{enumerable:!0,get:function(){return pn.timestamp}});var mn=Of();Object.defineProperty(e,"toArray",{enumerable:!0,get:function(){return mn.toArray}});var hn=om();Object.defineProperty(e,"window",{enumerable:!0,get:function(){return hn.window}});var gn=sm();Object.defineProperty(e,"windowCount",{enumerable:!0,get:function(){return gn.windowCount}});var _n=cm();Object.defineProperty(e,"windowTime",{enumerable:!0,get:function(){return _n.windowTime}});var vn=lm();Object.defineProperty(e,"windowToggle",{enumerable:!0,get:function(){return vn.windowToggle}});var yn=um();Object.defineProperty(e,"windowWhen",{enumerable:!0,get:function(){return yn.windowWhen}});var bn=dm();Object.defineProperty(e,"withLatestFrom",{enumerable:!0,get:function(){return bn.withLatestFrom}});var xn=fm();Object.defineProperty(e,"zipAll",{enumerable:!0,get:function(){return xn.zipAll}});var Sn=mm();Object.defineProperty(e,"zipWith",{enumerable:!0,get:function(){return Sn.zipWith}})}}),gm=(0,y.createContext)(null);function _m({children:e}){let[t,n]=(0,y.useState)(()=>typeof window<`u`&&localStorage.getItem(`showLineNumbers`)===`true`),r=(0,y.useCallback)(()=>{n(e=>{let t=!e;return typeof window<`u`&&localStorage.setItem(`showLineNumbers`,t.toString()),t})},[]);return(0,R.jsx)(gm.Provider,{value:{showLineNumbers:t,toggleLineNumbers:r},children:e})}function vm(){let e=(0,y.useContext)(gm);if(!e)throw Error(`useLineNumbers must be used within a LineNumbersProvider`);return e}var ym=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)}}},bm=(0,y.createContext)(null);function xm({browser:e,storage:t,sessionFactory:n,children:r}){let i=(0,y.useMemo)(()=>e??Gl({storage:t??new ym,sessionFactory:n??Ul()}),[e,t,n]);return(0,R.jsx)(bm.Provider,{value:i,children:r})}function Sm(){let e=(0,y.useContext)(bm);if(!e)throw Error(`useSemiont must be used within a <SemiontProvider>`);return e}var Cm={success:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}),error:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})}),warning:(0,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`svg`,{className:`semiont-toast-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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 wm({toast:e,onClose:t}){return(0,y.useEffect)(()=>{let n=setTimeout(()=>{t(e.id)},e.duration||3e3);return()=>clearTimeout(n)},[e,t]),(0,R.jsxs)(`div`,{className:`semiont-toast`,"data-variant":e.type,role:`alert`,children:[(0,R.jsx)(`div`,{className:`semiont-toast-icon-wrapper`,children:Cm[e.type]}),(0,R.jsx)(`p`,{className:`semiont-toast-message`,children:e.message}),(0,R.jsx)(`button`,{onClick:()=>t(e.id),className:`semiont-toast-close`,"aria-label":`Close`,children:(0,R.jsx)(`svg`,{className:`semiont-toast-close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function Tm({toasts:e,onClose:t}){let[n,r]=(0,y.useState)(!1);return(0,y.useEffect)(()=>(r(!0),()=>r(!1)),[]),n?(0,lu.createPortal)((0,R.jsx)(`div`,{className:`semiont-toast-container`,children:e.map(e=>(0,R.jsx)(wm,{toast:e,onClose:t},e.id))}),document.body):null}var Em=y.createContext(void 0);function Dm({children:e}){let[t,n]=(0,y.useState)([]),r=y.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=y.useCallback((e,t)=>r(e,`success`,t),[r]),a=y.useCallback((e,t)=>r(e,`error`,t),[r]),o=y.useCallback((e,t)=>r(e,`warning`,t),[r]),s=y.useCallback((e,t)=>r(e,`info`,t),[r]),c=y.useCallback(e=>{n(t=>t.filter(t=>t.id!==e))},[]),l=y.useMemo(()=>({showToast:r,showSuccess:i,showError:a,showWarning:o,showInfo:s}),[r,i,a,o,s]);return(0,R.jsxs)(Em.Provider,{value:l,children:[e,(0,R.jsx)(Tm,{toasts:t,onClose:c})]})}function Om(){let e=y.useContext(Em);if(e===void 0)throw Error(`useToast must be used within a ToastProvider`);return e}var km={close:`Close`,codeLoading:`Loading…`,codeAnalyzing:`Marking…`,codeAnalyzingTags:`Marking tags…`,codeDetectingEntities:`Marking…`,codeCreatingAnnotations:`Creating {{count}} annotations…`,codeCreatingTagAnnotations:`Creating {{count}} tags…`,codeCompleteCreated:`Created {{count}} {{kind}}`,codeGeneratingResource:`Generating…`,codeCreatingResource:`Creating the resource…`,codeCompleteGenerated:`Created the resource`,codeCompleteGeneratedTruncated:`Created the resource — cut off at the length limit`,kindHighlight:`highlights`,kindComment:`comments`,kindAssessment:`assessments`,kindReference:`references`,kindTag:`tags`,subject:`{{kind}}: {{label}}`,subjectWithPosition:`{{kind}}: {{label}} ({{done}} of {{total}})`,paramEntityTypes:`Entity Types`,paramInstructions:`Instructions`,paramTone:`Tone`,paramDensity:`Density`,subjectKindEntityType:`Entity type`,subjectKindCategory:`Category`,cancel:`Cancel`,inProgress:`Annotating...`},Am={loadFailed:`Failed to load PDF`,loading:`Loading PDF...`,next:`Next`,pageLoadFailed:`Failed to load page`,pageOf:`Page {{page}} of {{total}}`,pagination:`Page navigation`,previous:`Previous`,viewerLoading:`Loading PDF viewer...`},jm={annotations:`Annotations`,history:`History`,resourceInfo:`Resource Info`,collaboration:`Collaboration`,userAccount:`User Account`,settings:`Settings`,knowledgeBase:`Knowledge Base`},Mm={title:`Resource Info`,locale:`Locale`,notSpecified:`Not specified`,entityTypeTags:`Entity Type Tags`,representation:`Representation`,mediaType:`Media Type`,byteSize:`Size`,storageUri:`Storage`,clone:`Clone`,cloneDescription:`Generate a shareable clone link for this resource`,generate:`Generate`,generateDescription:`Generate a new resource from this one's context`,archive:`Archive`,archiveDescription:`Move this resource to archived status`,unarchive:`Unarchive`,unarchiveDescription:`Restore this resource to active status`,provenance:`Provenance`,createdAt:`Created`,modifiedAt:`Modified`,attributedTo:`Attributed to`,derivedFrom:`Derived from`},Nm={title:`Collaboration`,connectionStatus:`Connection Status`,live:`Live`,disconnected:`Disconnected`,events:`{{count}} events`,lastSync:`Last sync:`,noActivity:`No activity yet`,justNow:`Just now`,secondsAgo:`{{count}} seconds ago`,minuteAgo:`1 minute ago`,minutesAgo:`{{count}} minutes ago`,hourAgo:`1 hour ago`,hoursAgo:`{{count}} hours ago`,realtimeActive:`Real-time updates are active`,reconnecting:`Reconnecting to server...`,sharing:`Sharing`,collaborationComingSoon:`Collaboration features coming soon`,collaborators:`Collaborators`,ceilings:`{{contextTokens}} in / {{maxOutputTokens}} out`,sharedWindow:`{{contextTokens}} window`},Pm={history:`History`,loading:`Loading...`,user:`User`,viewOriginal:`View original`,viewAnnotation:`View annotation: {{content}}`,resourceCreated:`Created Resource`,resourceCloned:`Cloned`,resourceArchived:`Archived`,resourceUnarchived:`Unarchived`,highlightAdded:`Highlight Added`,highlightRemoved:`Highlight Removed`,referenceCreated:`Reference Created`,referenceResolved:`Reference Resolved`,referenceDeleted:`Reference Deleted`,entitytagAdded:`Tag Added`,entitytagRemoved:`Tag Removed`,assessmentAdded:`Assessment Added`,assessmentRemoved:`Assessment Removed`,annotationAdded:`Annotation Added`,annotationRemoved:`Annotation Removed`,annotationBodyUpdated:`Annotation Updated`,jobEvent:`Job Event`,embeddingComputed:`Embedding Computed`,justNow:`just now`,minutesAgo:`{{count}}m ago`,hoursAgo:`{{count}}h ago`,daysAgo:`{{count}}d ago`,failed:`Could not load history.`,retry:`Try again`},Fm={title:`Comments`,noComments:`No comments yet. Select text and click Comment to add one.`,commentPlaceholder:`Type your comment here...`,save:`Save`,cancel:`Cancel`,edit:`Edit`,annotateComments:`Annotate Comments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on technical terminology...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneScholarly:`Scholarly`,toneExplanatory:`Explanatory`,toneConversational:`Conversational`,toneTechnical:`Technical`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Im={title:`Highlights`,noHighlights:`No highlights yet. Use AI annotation to find important passages.`,annotateHighlights:`Annotate Highlights`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Focus on key technical concepts...`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Lm={title:`Assessments`,noAssessments:`No assessments yet. Use AI annotation to evaluate passages.`,assessmentPlaceholder:`Type your assessment here...`,save:`Save`,cancel:`Cancel`,annotateAssessments:`Annotate Assessments`,instructions:`Instructions`,optional:`(optional)`,instructionsPlaceholder:`e.g., Evaluate claims for accuracy and evidence...`,annotate:`Annotate`,annotating:`Annotating...`,toneLabel:`Tone`,toneOptional:`(optional)`,toneAnalytical:`Analytical`,toneCritical:`Critical`,toneBalanced:`Balanced`,toneConstructive:`Constructive`,densityLabel:`Density`,densitySparse:`Sparse`,densityDense:`Dense`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`,densityPerWords:`{{density}} per 2000 words`},Rm={title:`Tags`,noTags:`No tags yet. Use AI annotation to identify structural roles.`,noSchemas:"No tag schemas registered for this knowledge base. A KB administrator must register at least one structural-analysis schema (e.g. via the `register-tag-schemas` skill) before tagging can be used.",annotateTags:`Annotate Tags`,selectSchema:`Select Framework`,selectCategories:`Select Categories`,annotate:`Annotate`,annotating:`Annotating...`,cancel:`Cancel`,selectAll:`Select All`,deselectAll:`Deselect All`,categoriesSelected:`{count, plural, =0 {No categories selected} =1 {1 category selected} other {# categories selected}}`,createTagForSelection:`Create Tag for Selection`,selectCategory:`Select Category`,chooseCategory:`Choose a category...`,fragmentSelected:`Fragment selected`,imageRegionSelected:`Image region selected`,complete:`Annotation complete!`,failed:`Annotation failed`},zm={title:`Annotations`,statistics:`Statistics`,highlight:`Highlights`,reference:`References`,assessment:`Assessments`,comment:`Comments`,tag:`Tags`,annotationsFailed:`Could not load annotations.`,retry:`Try again`},Bm={title:`Statistics`,highlights:`Highlights`,comments:`Comments`,assessments:`Assessments`,tags:`Tags`,references:`References`,stub:`Stub`,resolved:`Resolved`,entityTypes:`Entity Types`},Vm={title:`References`,noReferences:`No references yet. Select text to create references to other resources.`,outgoingReferences:`Outgoing References`,incomingReferences:`Incoming References`,noIncomingReferences:`No incoming references`,stub:`Stub reference (not linked)`,resolved:`Resolved reference (linked)`,derived:`Derived`,open:`Open`,unlink:`Unlink`,resolve:`Resolve Reference`,cancel:`Cancel`,createReference:`Create Reference`,entityTypesOptional:`Entity Types (Optional)`,fragmentSelected:`Fragment selected`,annotateReferences:`Annotate References`,selectEntityTypes:`Entity types:`,select:`Select`,deselect:`Deselect`,noEntityTypes:`No entity types available`,typesSelected:`{count, plural, =1 {1 type selected} other {# types selected}}`,annotate:`Annotate`,annotating:`Annotating...`,includeDescriptiveReferences:`Include descriptive references`,descriptiveReferencesTooltip:`Also find phrases like 'the CEO', 'the tech giant', 'the physicist' (in addition to names)`,found:`{{count}} found`,complete:`Annotation complete!`,failed:`Annotation failed`,current:`Current: {{entityType}}`,loading:`loading...`,loadingEllipsis:`Loading...`,untitledResource:`Untitled Resource`,noText:`No text`,incomingReferencesFailed:`Could not load incoming references.`,retry:`Try again`,entityTypesFailed:`Could not load entity types.`},Hm={title:`Keyboard Shortcuts`,closeDialog:`Close dialog`,or:`or`,navigationTitle:`Navigation`,navOpenSearch:`Open global search`,navOpenSearchAlt:`Open global search (alternative)`,navCreateResource:`Create new resource`,navCloseOverlays:`Close all overlays (double press)`,navShowHelp:`Show keyboard shortcuts help`,sidebarTitle:`Knowledge Sidebar`,sidebarCollapse:`Collapse sidebar`,sidebarExpand:`Expand sidebar`,sidebarPickup:`Pick up resource tab (when focused)`,sidebarMove:`Move resource tab (when dragging)`,sidebarDrop:`Drop resource tab (when dragging)`,sidebarCancel:`Cancel drag operation`,annotationsTitle:`Resource Annotations`,annotHighlight:`Create highlight from annotation (direct)`,annotReference:`Open reference popup for annotation`,annotDelete:`Delete focused annotation`,annotNavigate:`Navigate through annotations`,annotNavigateBack:`Navigate annotations backward`,listsTitle:`Lists & Grids`,listsFilterNav:`Navigate entity type filters`,listsGridNav:`Navigate resource grid`,listsJumpFirst:`Jump to first item`,listsJumpLast:`Jump to last item`,searchModalTitle:`In Search Modal`,searchNav:`Navigate search results`,searchSelect:`Select result`,searchClose:`Close search`,modalTitle:`Modal Controls`,modalClose:`Close active modal`,modalNavForward:`Navigate forward through buttons`,modalNavBackward:`Navigate backward through buttons`,modalActivate:`Activate focused button`,accessibilityTitle:`Accessibility`,a11ySkipLinks:`Navigate to skip links (when at page start)`,a11yFollowLink:`Follow skip link`,macNote:`Using Mac keyboard shortcuts. ⌘ is the Command key.`,windowsNote:`Using Windows/Linux keyboard shortcuts. Ctrl is the Control key.`,footerHint:`Press {{key}} anytime to show this help`,close:`Close`},Um={modeGroup:`Mode`,browse:`Browse`,annotate:`Annotate`,selectionGroup:`Motivation`,clickGroup:`Click`,shapeGroup:`Shape`,none:`None`,linking:`Reference`,highlighting:`Highlight`,assessing:`Assess`,commenting:`Comment`,tagging:`Tag`,detail:`Detail`,follow:`Follow`,deleting:`Delete`,jsonld:`JSON-LD`,rectangle:`Rectangle`,circle:`Circle`,polygon:`Polygon`},Wm={title:`Navigation`,collapseSidebar:`Collapse sidebar`,expandSidebar:`Expand sidebar`,dragToReorder:`Drag to reorder`,dragToReorderDoc:`Drag to reorder {{name}}`,closeResource:`Close resource`,dragInstructions:`To reorder resources: Use Tab to navigate to a resource. Press Alt+Up arrow to move up or Alt+Down arrow to move down. For drag and drop: Press space bar to pick up the item. Use arrow keys to move it. Press space bar again to drop.`},Gm={deleteConfirmationTitle:`Delete Annotation`,deleteConfirmationMessage:`Are you sure you want to delete this annotation? This action cannot be undone.`,deleteConfirmationCancel:`Cancel`,deleteConfirmationDelete:`Delete`},Km={title:`Settings`,lineNumbers:`Line Numbers`,lineNumbersVisible:`Visible`,lineNumbersHidden:`Hidden`,theme:`Theme`,themeLight:`Light`,themeDark:`Dark`,themeSystem:`System`,themeSystemActive:`System ({{mode}})`,themeModeActive:`Using {{mode}} mode`,language:`Language`,languageHint:`Change language in the main navigation`,languageChanging:`Changing language...`,hoverDelay:`Hover Delay`,hoverDelayFast:`Fast`,hoverDelaySlow:`Slow`,hoverDelayDescription:`{{delay}}ms delay before hover effects appear`},qm={},Jm={gatherIntro:`Choose what to include in the gathered context.`,includeContent:`Include resource content`,includeSummary:`Include summary`,gatherDepth:`Depth`,gatherMaxResources:`Max resources`,gatherButton:`Gather`,editGather:`Change gather settings`,recallLabel:`Included in recall — deselect to exclude`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,sourceContextLabel:`Resource`,connectionsLabel:`Connections`,citedByLabel:`Cited by`,resourceTitle:`New resource title`,resourceTitlePlaceholder:`Title for the generated resource...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Optional guidance for the generation...`,language:`Language`,languageHelp:`Language for the generated resource`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,generate:`Generate`,maxLengthCeiling:`Limited to {{maxOutputTokens}} tokens by {{model}}.`,outputFormat:`Format`,formatExtensionMismatch:`Save location must end in {{extension}} to match the selected format.`,graphPaneTitle:`Neighborhood`,graphEmpty:`No links yet.`,resourceLinkLabel:`Resource link`,corpusPaneTitle:`Similar passages`,corpusEmpty:`No similar passages found.`,excludedReceipt:`{{types}} excluded from this recall`,machineRead:`OCR`,score:`Score`,saveLocation:`Save location`,discardDraftPrompt:`Discard this draft?`,discardDraft:`Discard`,keepEditing:`Keep editing`,title:`Generate from this Resource`},Ym={sourceContextLabel:`Annotation context in resource`,connectionsLabel:`Peer Annotations`,citedByLabel:`Resource Cited By`,userHintLabel:`Hint`,userHintPlaceholder:`Describe what this annotation refers to...`,loadingContext:`Gathering context...`,failedContext:`Failed to gather context`,generate:`Generate`,compose:`Compose`,resolutionStrategyLabel:`Resolution Strategy`,back:`Back`,link:`Link`,score:`Score`,noResults:`No results found`,resourceTitle:`Resource Title`,resourceTitlePlaceholder:`Enter resource title...`,additionalInstructions:`Additional Instructions`,additionalInstructionsPlaceholder:`Enter additional instructions...`,language:`Language`,languageHelp:`Language for generated content`,creativity:`Creativity`,creativityFocused:`Focused`,creativityCreative:`Creative`,maxLength:`Max Length`,maxLengthHelp:`Maximum number of tokens`,maxResults:`Max Results`,semanticScoring:`Semantic Scoring`,semanticScoringHelp:`Use AI to score results by semantic relevance`,searching:`Searching...`,searchFailed:`Search failed`,search:`Search`,maxLengthCeiling:`Limited to {{maxOutputTokens}} tokens by {{model}}.`,outputFormat:`Format`,formatExtensionMismatch:`Save location must end in {{extension}} to match the selected format.`,graphPaneTitle:`Neighborhood`,graphEmpty:`No links yet — resolving this reference creates the first.`,resourceLinkLabel:`Resource link`,corpusPaneTitle:`Similar passages`,corpusEmpty:`No similar passages found — Search is unlikely to land.`,excludedReceipt:`{{types}} excluded from this recall`,machineRead:`OCR`,userHintEffect:`steers Search and Generate`,saveLocation:`Save location`,entityTypes:`Entity types`,contentLabel:`Content`,createAndLink:`Create & Link`,creatingAndLinking:`Creating & linking…`,discardDraftPrompt:`Discard this draft?`,discardDraft:`Discard`,keepEditing:`Keep editing`,resolveTitle:`Resolve Reference`},Xm={createFailed:`Couldn’t create the annotation: {{detail}}`,deleteFailed:`Couldn’t delete the annotation: {{detail}}`,referenceUpdateFailed:`Couldn’t update the reference: {{detail}}`,unknownError:`unknown error`,assistQuiet:`Still working — no update from the annotation job for a few minutes`,resourceCreatedNamed:`Created “{{name}}”`,resourceCreated:`Resource created`,annotationComplete:`Annotation complete`,annotationFailed:`Annotation failed`,generationFailed:`Generation failed: {{detail}}`,"decline_no-text-layer":`This PDF is a scan whose text couldn’t be recognized, so there’s nothing to annotate.`,decline_encrypted:`This PDF is password-protected, so its text can’t be read.`,decline_corrupt:`This PDF couldn’t be read — the file may be damaged.`,"decline_too-large":`This document is too large to extract text from.`,decline_empty:`This document has no text to annotate.`},Zm={AssistProgress:km,PdfViewer:Am,Toolbar:jm,ResourceInfoPanel:Mm,CollaborationPanel:Nm,AnnotationHistory:Pm,CommentsPanel:Fm,HighlightPanel:Im,AssessmentPanel:Lm,TaggingPanel:Rm,UnifiedAnnotationsPanel:zm,StatisticsPanel:Bm,ReferencesPanel:Vm,KeyboardShortcuts:Hm,AnnotateToolbar:Um,CollapsibleResourceNavigation:Wm,ResourceViewer:Gm,Settings:Km,AnnotateView:qm,ResourceGenerate:Jm,ReferenceWizard:Ym,OutcomeToasts:Xm},Qm=Ce({"../../translations/ar.json":()=>s(()=>import(`./ar-AZBRADEB-CvnkaLQS.js`),[]),"../../translations/bn.json":()=>s(()=>import(`./bn-CCEW6AOS-BCI1FG86.js`),[]),"../../translations/cs.json":()=>s(()=>import(`./cs-HXPF2CTE-CbMUDpDp.js`),[]),"../../translations/da.json":()=>s(()=>import(`./da-K5NTK7LH-D2rWDXq3.js`),[]),"../../translations/de.json":()=>s(()=>import(`./de-GMRQEDZI-CVlSEip_.js`),[]),"../../translations/el.json":()=>s(()=>import(`./el-EUB4CI4G-C80i0753.js`),[]),"../../translations/en.json":()=>s(()=>import(`./en-R5XA26NF-BxJGw0oZ.js`),[]),"../../translations/es.json":()=>s(()=>import(`./es-Z32DAZ6W-D7UTS3Fx.js`),[]),"../../translations/fa.json":()=>s(()=>import(`./fa-G7HN6B32-DdDi1TG_.js`),[]),"../../translations/fi.json":()=>s(()=>import(`./fi-3YBLZO7I-B3OjL1PQ.js`),[]),"../../translations/fr.json":()=>s(()=>import(`./fr-VUBH7BBS-CjoeoL9n.js`),[]),"../../translations/he.json":()=>s(()=>import(`./he-WQQEY26B-2RRJq7To.js`),[]),"../../translations/hi.json":()=>s(()=>import(`./hi-HJZ6W4JB-DPflxelg.js`),[]),"../../translations/id.json":()=>s(()=>import(`./id-ZOGZ37MI-Dd4wSvWi.js`),[]),"../../translations/it.json":()=>s(()=>import(`./it-DT6UW66F-B7ZzCBm1.js`),[]),"../../translations/ja.json":()=>s(()=>import(`./ja-RUKQCOLO-Br1kLTUs.js`),[]),"../../translations/ko.json":()=>s(()=>import(`./ko-ZH5ADKZM-8IO4IU-2.js`),[]),"../../translations/ms.json":()=>s(()=>import(`./ms-Y2AFPZTU-q4v04hSa.js`),[]),"../../translations/nl.json":()=>s(()=>import(`./nl-OQEWIXNA-DiHanxnO.js`),[]),"../../translations/no.json":()=>s(()=>import(`./no-KPAYJZWY-DdGouMG_.js`),[]),"../../translations/pl.json":()=>s(()=>import(`./pl-WSXK2UUD-DK_ieA8X.js`),[]),"../../translations/pt.json":()=>s(()=>import(`./pt-NWRJRUCK-I6-gHOkB.js`),[]),"../../translations/ro.json":()=>s(()=>import(`./ro-3CGVMOC6-wdwqXMaO.js`),[]),"../../translations/sv.json":()=>s(()=>import(`./sv-HGSEBA7S-2KvJx_dY.js`),[]),"../../translations/th.json":()=>s(()=>import(`./th-NZ4G352Z-ZMBwAbgb.js`),[]),"../../translations/tr.json":()=>s(()=>import(`./tr-LGGS4DLW-BwMx3CfM.js`),[]),"../../translations/uk.json":()=>s(()=>import(`./uk-AIX536L4-cREJjolM.js`),[]),"../../translations/vi.json":()=>s(()=>import(`./vi-V6CVQZLQ-CXAniXLX.js`),[]),"../../translations/zh.json":()=>s(()=>import(`./zh-AGKPGI3L-MsKTx_dK.js`),[])}),$m=(0,y.createContext)(null),eh=new Map;function th(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 nh(e){if(eh.has(e))return eh.get(e);if(e===`en`)return eh.set(`en`,Zm),Zm;try{let t=await Qm(`../../translations/${e}.json`),n=t.default||t;return eh.set(e,n),n}catch(t){return console.error(`Failed to load translations for locale: ${e}`,t),Zm}}var rh={t:(e,t,n)=>{let r=Zm[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=th(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}};function ih({translationManager:e,locale:t,loadingComponent:n=null,children:r}){let[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&!e&&(s(!0),nh(t).then(e=>{a(e),s(!1)}).catch(e=>{console.error(`Failed to load translations:`,e),a(Zm),s(!1)}))},[t,e]);let c=(0,y.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=th(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,R.jsx)($m.Provider,{value:e,children:r}):t&&o?(0,R.jsx)(R.Fragment,{children:n}):t&&c?(0,R.jsx)($m.Provider,{value:c,children:r}):(0,R.jsx)($m.Provider,{value:rh,children:r})}function ah(e){let t=(0,y.useContext)($m);return t?(n,r)=>t.t(e,n,r):(t,n)=>{let r=Zm[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=th(e,n),Object.entries(n).forEach(([t,n])=>{e=e.replace(RegExp(`\\{\\{${t}\\}\\}`,`g`),String(n))}),e}return r}}var oh={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 sh(){let e=[`:root {`];return Object.entries(oh.colors.primary).forEach(([t,n])=>{e.push(` --semiont-color-primary-${t}: ${n};`)}),Object.entries(oh.colors.secondary).forEach(([t,n])=>{e.push(` --semiont-color-secondary-${t}: ${n};`)}),Object.entries(oh.colors.semantic).forEach(([t,n])=>{e.push(` --semiont-color-${t.toLowerCase().replace(/([A-Z])/g,`-$1`).toLowerCase()}: ${n};`)}),Object.entries(oh.colors.neutral).forEach(([t,n])=>{e.push(` --semiont-color-neutral-${t}: ${n};`)}),Object.entries(oh.spacing).forEach(([t,n])=>{e.push(` --semiont-spacing-${t}: ${n};`)}),Object.entries(oh.typography.fontSize).forEach(([t,n])=>{e.push(` --semiont-text-${t}: ${n};`)}),Object.entries(oh.typography.fontWeight).forEach(([t,n])=>{e.push(` --semiont-font-${t}: ${n};`)}),e.push(` --semiont-font-sans: ${oh.typography.fontFamily.sans};`),e.push(` --semiont-font-mono: ${oh.typography.fontFamily.mono};`),Object.entries(oh.borderRadius).forEach(([t,n])=>{e.push(` --semiont-radius-${t}: ${n};`)}),Object.entries(oh.shadows).forEach(([t,n])=>{e.push(` --semiont-shadow-${t}: ${n};`)}),Object.entries(oh.transitions.duration).forEach(([t,n])=>{e.push(` --semiont-duration-${t}: ${n};`)}),e.push(`}`),e.join(`
10
10
  `)}sh();var ch=(0,y.createContext)(null),lh={didCatch:!1,error:null},uh=class extends y.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=lh}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{didCatch:t}=this.state;t&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(lh))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.didCatch&&dh(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(lh))}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,y.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,y.createElement)(ch.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function dh(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var fh=n((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,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}})),ph=n(((e,t)=>{t.exports=fh()}));function mh(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var hh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_h={};function vh(e,t){return((t||_h).jsx?gh:hh).test(e)}var yh=/[ \t\n\f\r]/g;function bh(e){return typeof e==`object`?e.type===`text`&&xh(e.value):xh(e)}function xh(e){return e.replace(yh,``)===``}var Sh=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Sh.prototype.normal={},Sh.prototype.property={},Sh.prototype.space=void 0;function Ch(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Sh(n,r,t)}function wh(e){return e.toLowerCase()}var Th=class{constructor(e,t){this.attribute=t,this.property=e}};Th.prototype.attribute=``,Th.prototype.booleanish=!1,Th.prototype.boolean=!1,Th.prototype.commaOrSpaceSeparated=!1,Th.prototype.commaSeparated=!1,Th.prototype.defined=!1,Th.prototype.mustUseProperty=!1,Th.prototype.number=!1,Th.prototype.overloadedBoolean=!1,Th.prototype.property=``,Th.prototype.spaceSeparated=!1,Th.prototype.space=void 0;var Eh=e({boolean:()=>H,booleanish:()=>Oh,commaOrSpaceSeparated:()=>Mh,commaSeparated:()=>jh,number:()=>U,overloadedBoolean:()=>kh,spaceSeparated:()=>Ah}),Dh=0,H=Nh(),Oh=Nh(),kh=Nh(),U=Nh(),Ah=Nh(),jh=Nh(),Mh=Nh();function Nh(){return 2**++Dh}var Ph=Object.keys(Eh),Fh=class extends Th{constructor(e,t,n,r){let i=-1;if(super(e,t),Ih(this,`space`,r),typeof n==`number`)for(;++i<Ph.length;){let e=Ph[i];Ih(this,Ph[i],(n&Eh[e])===Eh[e])}}};Fh.prototype.defined=!0;function Ih(e,t,n){n&&(e[t]=n)}function Lh(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Fh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wh(r)]=r,n[wh(a.attribute)]=r}return new Sh(t,n,e.space)}var Rh=Lh({properties:{ariaActiveDescendant:null,ariaAtomic:Oh,ariaAutoComplete:null,ariaBusy:Oh,ariaChecked:Oh,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:Ah,ariaCurrent:null,ariaDescribedBy:Ah,ariaDetails:null,ariaDisabled:Oh,ariaDropEffect:Ah,ariaErrorMessage:null,ariaExpanded:Oh,ariaFlowTo:Ah,ariaGrabbed:Oh,ariaHasPopup:null,ariaHidden:Oh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ah,ariaLevel:U,ariaLive:null,ariaModal:Oh,ariaMultiLine:Oh,ariaMultiSelectable:Oh,ariaOrientation:null,ariaOwns:Ah,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:Oh,ariaReadOnly:Oh,ariaRelevant:null,ariaRequired:Oh,ariaRoleDescription:Ah,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:Oh,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function zh(e,t){return t in e?e[t]:t}function Bh(e,t){return zh(e,t.toLowerCase())}var Vh=Lh({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:jh,acceptCharset:Ah,accessKey:Ah,action:null,allow:null,allowFullScreen:H,allowPaymentRequest:H,allowUserMedia:H,alpha:H,alt:null,as:null,async:H,autoCapitalize:null,autoComplete:Ah,autoFocus:H,autoPlay:H,blocking:Ah,capture:null,charSet:null,checked:H,cite:null,className:Ah,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:Oh,controls:H,controlsList:Ah,coords:U|jh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:kh,draggable:Oh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:H,formTarget:null,headers:Ah,height:U,hidden:kh,high:U,href:null,hrefLang:null,htmlFor:Ah,httpEquiv:Ah,id:null,imageSizes:null,imageSrcSet:null,inert:H,inputMode:null,integrity:null,is:null,isMap:H,itemId:null,itemProp:Ah,itemRef:Ah,itemScope:H,itemType:Ah,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:H,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:H,muted:H,name:null,nonce:null,noModule:H,noValidate:H,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:H,optimum:U,pattern:null,ping:Ah,placeholder:null,playsInline:H,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:H,referrerPolicy:null,rel:Ah,required:H,reversed:H,rows:U,rowSpan:U,sandbox:Ah,scope:null,scoped:H,seamless:H,selected:H,shadowRootClonable:H,shadowRootCustomElementRegistry:H,shadowRootDelegatesFocus:H,shadowRootMode:null,shadowRootSerializable:H,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:Oh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:H,useMap:null,value:Oh,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ah,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:H,declare:H,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:H,noHref:H,noShade:H,noWrap:H,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:Oh,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:H,disablePictureInPicture:H,disableRemotePlayback:H,exportParts:jh,part:Ah,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:Bh}),Hh=Lh({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Mh,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:Ah,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:H,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:jh,g2:jh,glyphName:jh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:Mh,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ah,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mh,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mh,rev:Mh,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mh,requiredFeatures:Mh,requiredFonts:Mh,requiredFormats:Mh,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:Mh,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mh,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mh,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:zh}),Uh=Lh({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()}}),Wh=Lh({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Bh}),Gh=Lh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Kh={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`},qh=/[A-Z]/g,Jh=/-[a-z]/g,Yh=/^data[-\w.:]+$/i;function Xh(e,t){let n=wh(t),r=t,i=Th;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Yh.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Jh,Qh);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Jh.test(e)){let n=e.replace(qh,Zh);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Fh}return new i(r,t)}function Zh(e){return`-`+e.toLowerCase()}function Qh(e){return e.charAt(1).toUpperCase()}var $h=Ch([Rh,Vh,Uh,Wh,Gh],`html`),eg=Ch([Rh,Hh,Uh,Wh,Gh],`svg`);function tg(e){return e.join(` `).trim()}var ng=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
11
11
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),rg=n((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(ng());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}})),ig=n((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))}})),ag=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(rg()),r=ig();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})),og=cg(`end`),sg=cg(`start`);function cg(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 lg(e){let t=sg(e),n=og(e);if(t&&n)return{start:t,end:n}}function ug(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?fg(e.position):`start`in e||`end`in e?fg(e):`line`in e||`column`in e?dg(e):``}function dg(e){return pg(e&&e.line)+`:`+pg(e&&e.column)}function fg(e){return dg(e&&e.start)+`-`+dg(e&&e.end)}function pg(e){return e&&typeof e==`number`?e:1}var mg=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=ug(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}};mg.prototype.file=``,mg.prototype.name=``,mg.prototype.reason=``,mg.prototype.message=``,mg.prototype.stack=``,mg.prototype.column=void 0,mg.prototype.line=void 0,mg.prototype.ancestors=void 0,mg.prototype.cause=void 0,mg.prototype.fatal=void 0,mg.prototype.place=void 0,mg.prototype.ruleId=void 0,mg.prototype.source=void 0;var hg=t(ag(),1),gg={}.hasOwnProperty,_g=new Map,vg=/[A-Z]/g,yg=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),bg=new Set([`td`,`th`]),xg=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Sg(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=Ng(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=Mg(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`?eg:$h,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Cg(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Cg(e,t,n){if(t.type===`element`)return wg(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Tg(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Dg(e,t,n);if(t.type===`mdxjsEsm`)return Eg(e,t);if(t.type===`root`)return Og(e,t,n);if(t.type===`text`)return kg(e,t)}function wg(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=eg,e.schema=i),e.ancestors.push(t);let a=zg(e,t.tagName,!1),o=Pg(e,t),s=Ig(e,t);return yg.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!bh(e)})),Ag(e,o,a,t),jg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tg(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)}Bg(e,t.position)}function Eg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bg(e,t.position)}function Dg(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=eg,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:zg(e,t.name,!0),o=Fg(e,t),s=Ig(e,t);return Ag(e,o,a,t),jg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Og(e,t,n){let r={};return jg(r,Ig(e,t)),e.create(t,e.Fragment,r,n)}function kg(e,t){return t.value}function Ag(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jg(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Mg(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 Ng(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=sg(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 Pg(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&gg.call(t.properties,i)){let a=Lg(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&bg.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 Fg(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 Bg(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 Bg(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ig(e,t){let n=[],r=-1,i=e.passKeys?new Map:_g;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=Cg(e,a,o);s!==void 0&&n.push(s)}return n}function Lg(e,t,n){let r=Xh(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?mh(n):tg(n)),r.property===`style`){let t=typeof n==`object`?n:Rg(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Vg(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Kh[r.property]||r.property:r.attribute,n]}}function Rg(e,t){try{return(0,hg.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new mg("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=xg+`#cannot-parse-style-attribute`,r}}function zg(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=vh(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=vh(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gg.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bg(e)}function Bg(e,t){let n=new mg("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=xg+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Vg(e){let t={},n;for(n in e)gg.call(e,n)&&(t[Hg(n)]=e[n]);return t}function Hg(e){let t=e.replace(vg,Ug);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ug(e){return`-`+e.toLowerCase()}var Wg={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`]},Gg={};function Kg(e,t){let n=t||Gg;return qg(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function qg(e,t,n){if(Yg(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 Jg(e.children,t,n)}return Array.isArray(e)?Jg(e,t,n):``}function Jg(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=qg(e[i],t,n);return r.join(``)}function Yg(e){return!!(e&&typeof e==`object`)}var Xg=document.createElement(`i`);function Zg(e){let t=`&`+e+`;`;Xg.innerHTML=t;let n=Xg.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Qg(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 $g(e,t){return e.length>0?(Qg(e,e.length,0,t),e):t}var e_={}.hasOwnProperty;function t_(e){let t={},n=-1;for(;++n<e.length;)n_(t,e[n]);return t}function n_(e,t){let n;for(n in t){let r=(e_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){e_.call(r,a)||(r[a]=[]);let e=i[a];r_(r[a],Array.isArray(e)?e:e?[e]:[])}}}function r_(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Qg(e,0,0,r)}function i_(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 a_(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var o_=__(/[A-Za-z]/),s_=__(/[\dA-Za-z]/),c_=__(/[#-'*+\--9=?A-Z^-~]/);function l_(e){return e!==null&&(e<32||e===127)}var u_=__(/\d/),d_=__(/[\dA-Fa-f]/),f_=__(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function p_(e){return e!==null&&(e<0||e===32)}function m_(e){return e===-2||e===-1||e===32}var h_=__(/\p{P}|\p{S}/u),g_=__(/\s/);function __(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function v_(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&s_(e.charCodeAt(n+1))&&s_(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 y_(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return m_(r)?(e.enter(n),s(r)):t(r)}function s(r){return m_(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var b_={tokenize:x_};function x_(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`),y_(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 W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var S_={tokenize:w_},C_={tokenize:T_};function w_(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 Qg(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(C_,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(C_,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 W(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++;Qg(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 T_(e,t,n){return y_(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function E_(e){if(e===null||p_(e)||g_(e))return 1;if(h_(e))return 2}function D_(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 O_={name:`attention`,resolveAll:k_,tokenize:A_};function k_(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};j_(d,-c),j_(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=$g(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=$g(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=$g(l,D_(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=$g(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=$g(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Qg(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 A_(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=E_(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=E_(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 j_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var M_={name:`autolink`,tokenize:N_};function N_(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 o_(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||s_(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||s_(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||l_(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):c_(t)?(e.consume(t),l):n(t)}function u(e){return s_(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||s_(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var P_={partial:!0,tokenize:F_};function F_(e,t,n){return r;function r(t){return m_(t)?y_(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var I_={continuation:{tokenize:R_},exit:z_,name:`blockQuote`,tokenize:L_};function L_(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 m_(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function R_(e,t,n){let r=this;return i;function i(t){return m_(t)?y_(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(I_,t,n)(r)}}function z_(e){e.exit(`blockQuote`)}var B_={name:`characterEscape`,tokenize:V_};function V_(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 f_(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var H_={name:`characterReference`,tokenize:U_};function U_(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=s_,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=d_,u):(e.enter(`characterReferenceValue`),a=7,o=u_,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===s_&&!Zg(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 W_={partial:!0,tokenize:q_},G_={concrete:!0,name:`codeFenced`,tokenize:K_};function K_(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`),m_(t)?y_(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(W_,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):m_(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),y_(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(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&&m_(t)?y_(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(W_,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(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`),m_(t)?y_(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`),m_(t)?y_(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function q_(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 J_={name:`codeIndented`,tokenize:X_},Y_={partial:!0,tokenize:Z_};function X_(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),y_(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):W(t)?e.attempt(Y_,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||W(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Z_(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):y_(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):W(e)?i(e):n(e)}}var Q_={name:`codeText`,previous:ev,resolve:$_,tokenize:tv};function $_(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 tv(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)):W(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||W(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 nv=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&&rv(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),rv(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rv(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);rv(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);rv(this.left,t.reverse())}}}};function rv(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 iv(e){let t={},n=-1,r,i,a,o,s,c,l,u=new nv(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,av(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 Qg(e,0,1/0,u.slice(0)),!l}function av(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 ov={resolve:cv,tokenize:lv},sv={partial:!0,tokenize:uv};function cv(e){return iv(e),e}function lv(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):W(t)?e.check(sv,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 uv(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y_(e,a,`linePrefix`)}function a(i){if(i===null||W(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 dv(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||l_(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||W(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||p_(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||l_(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 fv(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):W(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||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!m_(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function pv(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):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y_(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(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 mv(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):m_(i)?y_(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var hv={name:`definition`,tokenize:_v},gv={partial:!0,tokenize:vv};function _v(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return fv.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=a_(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 p_(t)?mv(e,l)(t):l(t)}function l(t){return dv(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(gv,d,d)(t)}function d(t){return m_(t)?y_(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function vv(e,t,n){return r;function r(t){return p_(t)?mv(e,i)(t):n(t)}function i(t){return pv(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return m_(t)?y_(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var yv={name:`hardBreakEscape`,tokenize:bv};function bv(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var xv={name:`headingAtx`,resolve:Sv,tokenize:Cv};function Sv(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`},Qg(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Cv(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||p_(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):m_(n)?y_(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||p_(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var wv=`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(`.`),Tv=[`pre`,`script`,`style`,`textarea`],Ev={concrete:!0,name:`htmlFlow`,resolveTo:kv,tokenize:Av},Dv={partial:!0,tokenize:Mv},Ov={partial:!0,tokenize:jv};function kv(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 Av(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:P):o_(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):o_(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):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 o_(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||p_(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Tv.includes(l)?(i=1,r.interrupt?t(s):O(s)):wv.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||s_(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 m_(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||o_(t)?(e.consume(t),b):m_(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||s_(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):m_(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):m_(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(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||p_(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||m_(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):m_(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Dv,ne,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ov,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Tv.includes(n)?(e.consume(t),F):O(t)}return o_(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||W(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),F)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function jv(e,t,n){let r=this;return i;function i(t){return W(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 Mv(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(P_,t,n)}}var Nv={name:`htmlText`,tokenize:Pv};function Pv(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):o_(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):o_(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):W(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):W(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return o_(t)?(e.consume(t),S):n(t)}function S(t){return t===45||s_(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,ee(t)):m_(t)?(e.consume(t),C):M(t)}function w(t){return t===45||s_(t)?(e.consume(t),w):t===47||t===62||p_(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||o_(t)?(e.consume(t),E):W(t)?(o=T,ee(t)):m_(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||s_(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,ee(t)):m_(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):W(t)?(o=O,ee(t)):m_(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):W(t)?(o=k,ee(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||p_(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||p_(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return m_(t)?y_(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var Fv={name:`labelEnd`,resolveAll:zv,resolveTo:Bv,tokenize:Vv},Iv={tokenize:Hv},Lv={tokenize:Uv},Rv={tokenize:Wv};function zv(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&&Qg(e,0,e.length,n),e}function Bv(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=$g(s,e.slice(a+1,a+r+3)),s=$g(s,[[`enter`,u,t]]),s=$g(s,D_(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=$g(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=$g(s,e.slice(o+1)),s=$g(s,[[`exit`,c,t]]),Qg(e,a,e.length,s),e}function Vv(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(a_(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(Iv,u,o?u:d)(t):t===91?e.attempt(Lv,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Rv,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Hv(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 p_(t)?mv(e,a)(t):a(t)}function a(t){return t===41?u(t):dv(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return p_(t)?mv(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?pv(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return p_(t)?mv(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 Uv(e,t,n){let r=this;return i;function i(t){return fv.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(a_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Wv(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 Gv={name:`labelStartImage`,resolveAll:Fv.resolveAll,tokenize:Kv};function Kv(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 qv={name:`labelStartLink`,resolveAll:Fv.resolveAll,tokenize:Jv};function Jv(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 Yv={name:`lineEnding`,tokenize:Xv};function Xv(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),y_(e,t,`linePrefix`)}}var Zv={name:`thematicBreak`,tokenize:Qv};function Qv(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||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),m_(t)?y_(e,s,`whitespace`)(t):s(t))}}var $v={continuation:{tokenize:ry},exit:ay,name:`list`,tokenize:ny},ey={partial:!0,tokenize:oy},ty={partial:!0,tokenize:iy};function ny(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:u_(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(Zv,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 u_(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(P_,r.interrupt?n:u,e.attempt(ey,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return m_(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 ry(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(P_,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,y_(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!m_(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(ty,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,y_(e,e.attempt($v,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function iy(e,t,n){let r=this;return y_(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 ay(e){e.exit(this.containerState.type)}function oy(e,t,n){let r=this;return y_(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!m_(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var sy={name:`setextUnderline`,resolveTo:cy,tokenize:ly};function cy(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 ly(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`),m_(t)?y_(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var uy={tokenize:dy};function dy(e){let t=this,n=e.attempt(P_,r,e.attempt(this.parser.constructs.flowInitial,i,y_(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ov,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 fy={resolveAll:gy()},py=hy(`string`),my=hy(`text`);function hy(e){return{resolveAll:gy(e===`text`?_y: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 gy(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 _y(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 vy=e({attentionMarkers:()=>Ey,contentInitial:()=>by,disable:()=>Dy,document:()=>yy,flow:()=>Sy,flowInitial:()=>xy,insideSpan:()=>Ty,string:()=>Cy,text:()=>wy}),yy={42:$v,43:$v,45:$v,48:$v,49:$v,50:$v,51:$v,52:$v,53:$v,54:$v,55:$v,56:$v,57:$v,62:I_},by={91:hv},xy={[-2]:J_,[-1]:J_,32:J_},Sy={35:xv,42:Zv,45:[sy,Zv],60:Ev,61:sy,95:Zv,96:G_,126:G_},Cy={38:H_,92:B_},wy={[-5]:Yv,[-4]:Yv,[-3]:Yv,33:Gv,38:H_,42:O_,60:[M_,Nv],91:qv,92:[yv,B_],93:Fv,95:O_,96:Q_},Ty={null:[O_,fy]},Ey={null:[42,95]},Dy={null:[]};function Oy(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=$g(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=D_(a,l.events,l),l.events):[]}function f(e,t){return Ay(p(e),t)}function p(e){return ky(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){W(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&&Qg(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 ky(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 Ay(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=`
12
12
  `;break;case-3:o=`\r
@@ -131,12 +131,12 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{i as r,n
131
131
  `),``,`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(`
132
132
  `)].join(`
133
133
  `))}else{let e=u.props?.className,t=typeof e==`function`?(...t)=>TW(e(...t),c.className):TW(e,c.className),n=t?{className:t}:{},r=PW(u.props,IW(LW(c,[`ref`])));for(let e in d)e in r&&delete d[e];return(0,y.cloneElement)(u,Object.assign({},r,d,l,{ref:i(RW(u),l.ref)},n))}}return(0,y.createElement)(a,Object.assign({},LW(c,[`ref`]),!BW(a)&&l,!BW(a)&&d),u)}function MW(){let e=(0,y.useRef)([]),t=(0,y.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 NW(...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 PW(...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 FW(e){return Object.assign((0,y.forwardRef)(e),{displayName:e.displayName??e.name})}function IW(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function LW(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function RW(e){return`19.2.8`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function zW(e){if(e!=null&&e.$$typeof===Symbol.for(`react.lazy`)){let t=e._payload;if(t!=null&&t.status===`fulfilled`)return zW(t.value)}return e}function BW(e){return e===y.Fragment||e===Symbol.for(`react.fragment`)}function VW(e){return BW(e.type)}var HW=`span`,UW=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(UW||{});function WW(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||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 kW()({ourProps:i,theirProps:r,slot:{},defaultTag:HW,name:`Hidden`})}var GW=FW(WW);function KW(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function qW(e){return KW(e)&&`tagName`in e}function JW(e){return qW(e)&&`accessKey`in e}function YW(e){return qW(e)&&`tabIndex`in e}function XW(e){return qW(e)&&`style`in e}function ZW(e){return JW(e)&&e.nodeName===`IFRAME`}function QW(e){return JW(e)&&e.nodeName===`INPUT`}var $W=Symbol();function eG(e,t=!0){return Object.assign(e,{[$W]:t})}function tG(...e){let t=(0,y.useRef)(e);(0,y.useEffect)(()=>{t.current=e},[e]);let n=xW(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[$W])?void 0:n}var nG=(0,y.createContext)(null);nG.displayName=`DescriptionContext`;function rG(){let e=(0,y.useContext)(nG);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,rG),e}return e}function iG(){let[e,t]=(0,y.useState)([]);return[e.length>0?e.join(` `):void 0,(0,y.useMemo)(()=>function(e){let n=xW(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,y.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 y.createElement(nG.Provider,{value:r},e.children)},[t])]}var aG=`p`;function oG(e,t){let n=(0,y.useId)(),r=wW(),{id:i=`headlessui-description-${n}`,...a}=e,o=rG(),s=tG(t);yW(()=>o.register(i),[i,o.register]);let c=SW({...o.slot,disabled:r||!1}),l={ref:s,...o.props,id:i};return kW()({ourProps:l,theirProps:a,slot:c,defaultTag:aG,name:o.name||`Description`})}var sG=FW(oG),cG=Object.assign(sG,{}),lG=(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))(lG||{}),uG=(0,y.createContext)(()=>{});function dG({value:e,children:t}){return y.createElement(uG.Provider,{value:e},t)}var fG=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}},pG=Object.defineProperty,mG=(e,t,n)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t,n)=>(mG(e,typeof t==`symbol`?t:t+``,n),n),gG=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},_G=(e,t,n)=>(gG(e,t,`read from private field`),n?n.call(e):t.get(e)),vG=(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)},yG=(e,t,n,r)=>(gG(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),bG,xG,SG,CG=class{constructor(e){vG(this,bG,{}),vG(this,xG,new fG(()=>new Set)),vG(this,SG,new Set),hG(this,`disposables`,_W()),yG(this,bG,e),dW.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return _G(this,bG)}subscribe(e,t){if(dW.isServer)return()=>{};let n={selector:e,callback:t,current:e(_G(this,bG))};return _G(this,SG).add(n),this.disposables.add(()=>{_G(this,SG).delete(n)})}on(e,t){return dW.isServer?()=>{}:(_G(this,xG).get(e).add(t),this.disposables.add(()=>{_G(this,xG).get(e).delete(t)}))}send(e){let t=this.reduce(_G(this,bG),e);if(t!==_G(this,bG)){yG(this,bG,t);for(let e of _G(this,SG)){let t=e.selector(_G(this,bG));wG(e.current,t)||(e.current=t,e.callback(t))}for(let t of _G(this,xG).get(e.type))t(_G(this,bG),e)}}};bG=new WeakMap,xG=new WeakMap,SG=new WeakMap;function wG(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&&TG(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&TG(e.entries(),t.entries()):EG(e)&&EG(t)?TG(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function TG(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 EG(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var DG=Object.defineProperty,OG=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kG=(e,t,n)=>(OG(e,typeof t==`symbol`?t:t+``,n),n),AG=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(AG||{}),jG={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}}},MG=class e extends CG{constructor(){super(...arguments),kG(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),kG(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 EW(t.type,jG,e,t)}},NG=new fG(()=>MG.new());function PG(e,t,n=wG){return(0,$w.useSyncExternalStoreWithSelector)(xW(t=>e.subscribe(FG,t)),xW(()=>e.state),xW(()=>e.state),xW(t),n)}function FG(e){return e}function IG(e,t){let n=(0,y.useId)(),r=NG.get(t),[i,a]=PG(r,(0,y.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return yW(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?!a||i:!1}var LG=new Map,RG=new Map;function zG(e){let t=RG.get(e)??0;return RG.set(e,t+1),t===0?(LG.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>BG(e)):()=>BG(e)}function BG(e){let t=RG.get(e)??1;if(t===1?RG.delete(e):RG.set(e,t-1),t!==1)return;let n=LG.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,LG.delete(e))}function VG(e,{allowed:t,disallowed:n}={}){let r=IG(e,`inert-others`);yW(()=>{if(!r)return;let e=_W();for(let t of n?.()??[])t&&e.add(zG(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=fW(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(zG(t));r=r.parentElement}}return e.dispose},[r,t,n])}function HG(e,t,n){let r=bW(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,y.useEffect)(()=>{if(!e)return;let n=t===null?null:JW(t)?t:t.current;if(!n)return;let i=_W();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 UG=[`[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(`,`),WG=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),GG=(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))(GG||{}),KG=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(KG||{}),qG=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(qG||{});function JG(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(UG)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function YG(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(WG)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var XG=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(XG||{});function ZG(e,t=0){return e!==fW(e)?.body&&EW(t,{0(){return e.matches(UG)},1(){let t=e;for(;t!==null;){if(t.matches(UG))return!0;t=t.parentElement}return!1}})}var QG=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(QG||{});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 $G(e){e?.focus({preventScroll:!0})}var eK=[`textarea`,`input`].join(`,`);function tK(e){return(e?.matches)?.call(e,eK)??!1}function nK(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 rK(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?pW(e[0]):document:pW(e),o=Array.isArray(e)?n?nK(e):e:t&64?YG(e):JG(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!==mW(f));return t&6&&tK(f)&&f.select(),2}function iK(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function aK(){return/Android/gi.test(window.navigator.userAgent)}function oK(){return iK()||aK()}function sK(e,t,n,r){let i=bW(n);(0,y.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 cK(e,t,n,r){let i=bW(n);(0,y.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 lK=30;function uK(e,t,n){let r=bW(n),i=(0,y.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!ZG(i,XG.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,y.useRef)(null);sK(e,`pointerdown`,e=>{oK()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),sK(e,`pointerup`,e=>{if(oK()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,y.useRef)({x:0,y:0});sK(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),sK(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=lK||Math.abs(t.y-o.current.y)>=lK))return i(e,()=>YW(e.target)?e.target:null)},!0),cK(e,`blur`,e=>i(e,()=>ZW(window.document.activeElement)?window.document.activeElement:null),!0)}function dK(...e){return(0,y.useMemo)(()=>fW(...e),[...e])}function fK(e,t,n,r){let i=bW(n);(0,y.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function pK(e){return(0,y.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function mK(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 hK(){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 gK(){return iK()?{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=_W();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(YW(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);YW(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),YW(e.target)&&XW(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(YW(e.target)){if(QW(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(()=>{let e=window.scrollY??window.pageYOffset;n!==e&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function _K(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function vK(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var yK=mK(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:_W(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=vK(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=vK(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[gK(),hK(),_K()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});yK.subscribe(()=>{let e=yK.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)&&yK.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&yK.dispatch(`TEARDOWN`,n)}});function bK(e,t,n=()=>({containers:[]})){let r=pK(yK),i=t?r.get(t):void 0,a=i?i.count>0:!1;return yW(()=>{if(!(!t||!e))return yK.dispatch(`PUSH`,t,n),()=>yK.dispatch(`POP`,t,n)},[e,t]),a}function xK(e,t,n=()=>[document.body]){bK(IG(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function SK(e=0){let[t,n]=(0,y.useState)(e);return{flags:t,setFlag:(0,y.useCallback)(e=>n(e),[]),addFlag:(0,y.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,y.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,y.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,y.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(`
134
- `)),[]});var CK=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(CK||{});function wK(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function TK(e,t,n,r){let[i,a]=(0,y.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=SK(e&&i?3:0),l=(0,y.useRef)(!1),u=(0,y.useRef)(!1);return yW(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),EK(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&&kK(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,vW()]),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 EK(e,{prepare:t,run:n,done:r,inFlight:i}){let a=_W();return OK(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(DK(e,r))})}),a.dispose}function DK(e,t){let n=_W();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 OK(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 kK(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function AK(e,t){let n=(0,y.useRef)([]),r=xW(e);(0,y.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 jK=(0,y.createContext)(null);jK.displayName=`OpenClosedContext`;var MK=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(MK||{});function NK(){return(0,y.useContext)(jK)}function PK({value:e,children:t}){return y.createElement(jK.Provider,{value:e},t)}function FK({children:e}){return y.createElement(jK.Provider,{value:null},e)}function IK(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var LK=[];IK(()=>{function e(e){if(!YW(e.target)||e.target===document.body||LK[0]===e.target)return;let t=e.target;t=t.closest(UG),LK.unshift(t??e.target),LK=LK.filter(e=>e!=null&&e.isConnected),LK.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 RK(e){let t=xW(e),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>(n.current=!1,()=>{n.current=!0,gW(()=>{n.current&&t()})}),[t])}function zK(){let e=typeof document>`u`;return`useSyncExternalStore`in y&&(e=>e.useSyncExternalStore)(y)(()=>()=>{},()=>!1,()=>!e)}function BK(){let e=zK(),[t,n]=y.useState(dW.isHandoffComplete);return t&&dW.isHandoffComplete===!1&&n(!1),y.useEffect(()=>{t!==!0&&n(!0)},[t]),y.useEffect(()=>dW.handoff(),[]),!e&&t}var VK=(0,y.createContext)(!1);function HK(){return(0,y.useContext)(VK)}function UK(e){return y.createElement(VK.Provider,{value:e.force},e.children)}function WK(e){let t=HK(),n=(0,y.useContext)(YK),[r,i]=(0,y.useState)(()=>{if(!t&&n!==null)return n.current??null;if(dW.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,y.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,y.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var GK=y.Fragment,KK=FW(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,y.useRef)(null),a=tG(eG(e=>{i.current=e}),t),o=dK(i.current),s=WK(n??o),c=(0,y.useContext)(ZK),l=vW(),u=BK(),d=kW();return RK(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!u?null:(0,lu.createPortal)(y.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},d({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:GK,name:`Portal`})),s)});function qK(e,t){let n=tG(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=kW();return r?y.createElement(KK,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:GK,name:`Portal`})}var JK=y.Fragment,YK=(0,y.createContext)(null);function XK(e,t){let{target:n,...r}=e,i={ref:tG(t)},a=kW();return y.createElement(YK.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:JK,name:`Popover.Group`}))}var ZK=(0,y.createContext)(null);function QK(){let e=(0,y.useContext)(ZK),t=(0,y.useRef)([]),n=xW(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=xW(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,y.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,y.useMemo)(()=>function({children:e}){return y.createElement(ZK.Provider,{value:i},e)},[i])]}var $K=FW(qK),eq=FW(XK),tq=Object.assign($K,{Group:eq});function nq(e,t=typeof document<`u`?document.defaultView:null,n){let r=IG(e,`escape`);fK(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===lG.Escape&&n(e))})}function rq(){let[e]=(0,y.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,y.useState)(e?.matches??!1);return yW(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function iq({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=xW(()=>{let r=fW(n),i=[];for(let t of e)t!==null&&(qW(t)?i.push(t):`current`in t&&qW(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&&qW(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:xW(e=>r().some(t=>t.contains(e)))}}var aq=(0,y.createContext)(null);function oq({children:e,node:t}){let[n,r]=(0,y.useState)(null),i=sq(t??n);return y.createElement(aq.Provider,{value:i},e,i===null&&y.createElement(GW,{features:UW.Hidden,ref:e=>{if(e){for(let t of fW(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&qW(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function sq(e=null){return(0,y.useContext)(aq)??e}function cq(){let e=(0,y.useRef)(!1);return yW(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var lq=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(lq||{});function uq(){let e=(0,y.useRef)(0);return cK(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function dq(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)qW(n.current)&&t.add(n.current);return t}var fq=`div`,pq=(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))(pq||{});function mq(e,t){let n=(0,y.useRef)(null),r=tG(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;BK()||(s=0);let l=dK(n.current);vq(s,{ownerDocument:l});let u=yq(s,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});bq(s,{ownerDocument:l,container:n,containers:o,previousActiveElement:u});let d=uq(),f=xW(e=>{if(!JW(n.current))return;let t=n.current;(e=>e())(()=>{EW(d.current,{[lq.Forwards]:()=>{rK(t,GG.First,{skipElements:[e.relatedTarget,a]})},[lq.Backwards]:()=>{rK(t,GG.Last,{skipElements:[e.relatedTarget,a]})}})})}),p=IG(!!(s&2),`focus-trap#tab-lock`),m=vW(),h=(0,y.useRef)(!1),g={ref:r,onKeyDown(e){e.key==`Tab`&&(h.current=!0,m.requestAnimationFrame(()=>{h.current=!1}))},onBlur(e){if(!(s&4))return;let t=dq(o);JW(n.current)&&t.add(n.current);let r=e.relatedTarget;YW(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(xq(t,r)||(h.current?rK(n.current,EW(d.current,{[lq.Forwards]:()=>GG.Next,[lq.Backwards]:()=>GG.Previous})|GG.WrapAround,{relativeTo:e.target}):YW(e.target)&&$G(e.target)))}},_=kW();return y.createElement(y.Fragment,null,p&&y.createElement(GW,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:UW.Focusable}),_({ourProps:g,theirProps:c,defaultTag:fq,name:`FocusTrap`}),p&&y.createElement(GW,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:UW.Focusable}))}var hq=FW(mq),gq=Object.assign(hq,{features:pq});function _q(e=!0){let t=(0,y.useRef)(LK.slice());return AK(([e],[n])=>{n===!0&&e===!1&&gW(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=LK.slice())},[e,LK,t]),xW(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function vq(e,{ownerDocument:t}){let n=!!(e&8),r=_q(n);AK(()=>{n||hW(t?.body)&&$G(r())},[n]),RK(()=>{n&&$G(r())})}function yq(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,y.useRef)(null),o=IG(!!(e&1),`focus-trap#initial-focus`),s=cq();return AK(()=>{if(e===0)return;if(!o){i!=null&&i.current&&$G(i.current);return}let c=n.current;c&&gW(()=>{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)$G(r.current);else{if(e&16){if(rK(c,GG.First|GG.AutoFocus)!==KG.Error)return}else if(rK(c,GG.First)!==KG.Error)return;if(i!=null&&i.current&&($G(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 bq(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=cq(),o=!!(e&4);fK(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=dq(r);JW(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;JW(c)?xq(t,c)?(i.current=c,$G(c)):(e.preventDefault(),e.stopPropagation(),$G(s)):$G(i.current)},!0)}function xq(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function Sq(e){return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!BW(e.as??Aq)||y.Children.count(e.children)===1}var Cq=(0,y.createContext)(null);Cq.displayName=`TransitionContext`;var wq=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(wq||{});function Tq(){let e=(0,y.useContext)(Cq);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function Eq(){let e=(0,y.useContext)(Dq);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var Dq=(0,y.createContext)(null);Dq.displayName=`NestingContext`;function Oq(e){return`children`in e?Oq(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function kq(e,t){let n=bW(e),r=(0,y.useRef)([]),i=cq(),a=vW(),o=xW((e,t=OW.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(EW(t,{[OW.Unmount](){r.current.splice(o,1)},[OW.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!Oq(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=xW(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,OW.Unmount)}),c=(0,y.useRef)([]),l=(0,y.useRef)(Promise.resolve()),u=(0,y.useRef)({enter:[],leave:[]}),d=xW((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=xW((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,y.useMemo)(()=>({children:r,register:s,unregister:o,onStart:d,onStop:f,wait:l,chains:u}),[s,o,r,d,f,u,l])}var Aq=y.Fragment,jq=DW.RenderStrategy;function Mq(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:m,...h}=e,[g,_]=(0,y.useState)(null),v=(0,y.useRef)(null),b=Sq(e),x=tG(...b?[v,t,_]:t===null?[]:[t]),S=(n=h.unmount)==null||n?OW.Unmount:OW.Hidden,{show:C,appear:w,initial:T}=Tq(),[E,D]=(0,y.useState)(C?`visible`:`hidden`),O=Eq(),{register:k,unregister:A}=O;yW(()=>k(v),[k,v]),yW(()=>{if(S===OW.Hidden&&v.current){if(C&&E!==`visible`){D(`visible`);return}return EW(E,{hidden:()=>A(v),visible:()=>k(v)})}},[E,v,k,A,C,S]);let j=BK();yW(()=>{if(b&&j&&E===`visible`&&v.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,E,j,b]);let M=T&&!w,ee=w&&C&&T,N=(0,y.useRef)(!1),te=kq(()=>{N.current||(D(`hidden`),A(v))},O),P=xW(e=>{N.current=!0;let t=e?`enter`:`leave`;te.onStart(v,t,e=>{e===`enter`?i?.():e===`leave`&&o?.()})}),F=xW(e=>{let t=e?`enter`:`leave`;N.current=!1,te.onStop(v,t,e=>{e===`enter`?a?.():e===`leave`&&s?.()}),t===`leave`&&!Oq(te)&&(D(`hidden`),A(v))});(0,y.useEffect)(()=>{b&&r||(P(C),F(C))},[C,b,r]);let[,ne]=TK(!(!r||!b||!j||M),g,C,{start:P,end:F}),re=IW({ref:x,className:TW(h.className,ee&&c,ee&&l,ne.enter&&c,ne.enter&&ne.closed&&l,ne.enter&&!ne.closed&&u,ne.leave&&f,ne.leave&&!ne.closed&&p,ne.leave&&ne.closed&&m,!ne.transition&&C&&d)?.trim()||void 0,...wK(ne)}),ie=0;E===`visible`&&(ie|=MK.Open),E===`hidden`&&(ie|=MK.Closed),C&&E===`hidden`&&(ie|=MK.Opening),!C&&E===`visible`&&(ie|=MK.Closing);let ae=kW();return y.createElement(Dq.Provider,{value:te},y.createElement(PK,{value:ie},ae({ourProps:re,theirProps:h,defaultTag:Aq,features:jq,visible:E===`visible`,name:`Transition.Child`})))}function Nq(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=(0,y.useRef)(null),s=tG(...Sq(e)?[o,t]:t===null?[]:[t]);BK();let c=NK();if(n===void 0&&c!==null&&(n=(c&MK.Open)===MK.Open),n===void 0)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=(0,y.useState)(n?`visible`:`hidden`),d=kq(()=>{n||u(`hidden`)}),[f,p]=(0,y.useState)(!0),m=(0,y.useRef)([n]);yW(()=>{f!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),p(!1))},[m,n]);let h=(0,y.useMemo)(()=>({show:n,appear:r,initial:f}),[n,r,f]);yW(()=>{n?u(`visible`):!Oq(d)&&o.current!==null&&u(`hidden`)},[n,d]);let g={unmount:i},_=xW(()=>{var t;f&&p(!1),(t=e.beforeEnter)==null||t.call(e)}),v=xW(()=>{var t;f&&p(!1),(t=e.beforeLeave)==null||t.call(e)}),b=kW();return y.createElement(Dq.Provider,{value:d},y.createElement(Cq.Provider,{value:h},b({ourProps:{...g,as:y.Fragment,children:y.createElement(Iq,{ref:s,...g,...a,beforeEnter:_,beforeLeave:v})},theirProps:{},defaultTag:y.Fragment,features:jq,visible:l===`visible`,name:`Transition`})))}function Pq(e,t){let n=(0,y.useContext)(Cq)!==null,r=NK()!==null;return y.createElement(y.Fragment,null,!n&&r?y.createElement(Fq,{ref:t,...e}):y.createElement(Iq,{ref:t,...e}))}var Fq=FW(Nq),Iq=FW(Mq),Lq=FW(Pq),Rq=Object.assign(Fq,{Child:Lq,Root:Fq}),zq=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(zq||{}),Bq=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(Bq||{}),Vq={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Hq=(0,y.createContext)(null);Hq.displayName=`DialogContext`;function Uq(e){let t=(0,y.useContext)(Hq);if(t===null){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Uq),t}return t}function Wq(e,t){return EW(t.type,Vq,e,t)}var Gq=FW(function(e,t){let n=(0,y.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,y.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=NK();i===void 0&&p!==null&&(i=(p&MK.Open)===MK.Open);let m=(0,y.useRef)(null),h=tG(m,t),g=dK(m.current),_=+!i,[v,b]=(0,y.useReducer)(Wq,{titleId:null,descriptionId:null,panelRef:(0,y.createRef)()}),x=xW(()=>a(!1)),S=xW(e=>b({type:0,id:e})),C=BK()?_===0:!1,[w,T]=QK(),E={get current(){return v.panelRef.current??m.current}},D=sq(),{resolveContainers:O}=iq({mainTreeNode:D,portals:w,defaultContainers:[E]}),k=p!==null&&(p&MK.Closing)===MK.Closing;VG(l||k?!1:C,{allowed:xW(()=>[m.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:xW(()=>[D?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let A=NG.get(null);yW(()=>{if(C)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,C]);let j=PG(A,(0,y.useCallback)(e=>A.selectors.isTop(e,r),[A,r]));uK(j,O,e=>{e.preventDefault(),x()}),nq(j,g?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),x()}),xK(l||k?!1:C,g,O),HG(C,m,x);let[M,ee]=iG(),N=(0,y.useMemo)(()=>[{dialogState:_,close:x,setTitleId:S,unmount:u},v],[_,x,S,u,v]),te=SW({open:_===0}),P={ref:h,id:r,role:s,tabIndex:-1,"aria-modal":l?void 0:_===0||void 0,"aria-labelledby":v.titleId,"aria-describedby":M,unmount:u},F=!rq(),ne=pq.None;C&&!l&&(ne|=pq.RestoreFocus,ne|=pq.TabLock,c&&(ne|=pq.AutoFocus),F&&(ne|=pq.InitialFocus));let re=kW();return y.createElement(FK,null,y.createElement(UK,{force:!0},y.createElement(tq,null,y.createElement(Hq.Provider,{value:N},y.createElement(eq,{target:m},y.createElement(UK,{force:!1},y.createElement(ee,{slot:te},y.createElement(T,null,y.createElement(gq,{initialFocus:o,initialFocusFallback:m,containers:O,features:ne},y.createElement(dG,{value:x},re({ourProps:P,theirProps:d,slot:te,defaultTag:Kq,features:qq,visible:_===0,name:`Dialog`})))))))))))}),Kq=`div`,qq=DW.RenderStrategy|DW.Static;function Jq(e,t){let{transition:n=!1,open:r,...i}=e,a=NK(),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?y.createElement(oq,null,y.createElement(Rq,{show:r,transition:n,unmount:i.unmount},y.createElement(Gq,{ref:t,...i}))):y.createElement(oq,null,y.createElement(Gq,{ref:t,open:r,...i}))}var Yq=`div`;function Xq(e,t){let n=(0,y.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=Uq(`Dialog.Panel`),l=tG(t,c.panelRef),u=SW({open:o===0}),d={ref:l,id:r,onClick:xW(e=>{e.stopPropagation()})},f=i?Lq:y.Fragment,p=i?{unmount:s}:{},m=kW();return y.createElement(f,{...p},m({ourProps:d,theirProps:a,slot:u,defaultTag:Yq,name:`Dialog.Panel`}))}var Zq=`div`;function Qq(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=Uq(`Dialog.Backdrop`),o=SW({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?Lq:y.Fragment,l=n?{unmount:a}:{},u=kW();return y.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:Zq,name:`Dialog.Backdrop`}))}var $q=`h2`;function eJ(e,t){let n=(0,y.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=Uq(`Dialog.Title`),s=tG(t);(0,y.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=SW({open:a===0}),l={ref:s,id:r};return kW()({ourProps:l,theirProps:i,slot:c,defaultTag:$q,name:`Dialog.Title`})}var tJ=FW(Jq),nJ=FW(Xq);FW(Qq);var rJ=FW(eJ),iJ=Object.assign(tJ,{Panel:nJ,Title:rJ,Description:cG});function aJ({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,R.jsx)(Rq,{appear:!0,show:r,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-popup-overlay`,onClose:n,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-popup-backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-popup-container`,children:(0,R.jsx)(Lq,{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,R.jsx)(nJ,{className:`semiont-popup-panel`,style:s,"data-annotation-ui":!0,"data-wide":i?`true`:`false`,children:(0,R.jsx)(R.Fragment,{children:e})})})})]})})}function oJ(e){return Sr(e)?{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`}:Cr(e)?{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`}:wr(e)?{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`}:Tr(e)?{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`}:Er(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 sJ(e){return Tr(e)?`Comment`:Sr(e)?`Highlight`:wr(e)?`Assessment`:Er(e)?`Tag`:Or(e)?`Resolved Reference`:Cr(e)?`Unresolved Reference`:`Annotation`}function cJ({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,y.useMemo)(()=>Yl(e=>a?.client.beckon.hover(e),c),[a,c]);return(0,R.jsx)(`svg`,{className:`semiont-annotation-overlay`,style:{width:r,height:i},children:e.map(e=>{if(typeof e.target==`string`)return null;let t=_r(e.target.selector);if(!t)return null;let n=si(t.value);if(!n)return null;let r=e.id===o,i=e.id===s,c=oJ(e),p=Cr(e),m=p&&br(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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}default:return null}})})}function lJ(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 uJ({imageUrl:e,resourceUri:t,existingAnnotations:n=[],drawingMode:r,selectedMotivation:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s}){let{hoverDelayMs:c}=LF(),l=(0,y.useRef)(null),u=(0,y.useRef)(null),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=new Image;t.onload=()=>{f({width:t.naturalWidth,height:t.naturalHeight})},t.src=e},[e]),(0,y.useEffect)(()=>{let e=()=>{u.current&&m({width:u.current.clientWidth,height:u.current.clientHeight})};e();let t=null;try{t=new ResizeObserver(e),u.current&&t.observe(u.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 S=(0,y.useCallback)(e=>{if(!u.current)return null;let t=u.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},[]),C=(0,y.useCallback)(e=>{if(!r)return;let t=S(e);t&&(g(!0),v(t),x(t))},[r,S]),w=(0,y.useCallback)(e=>{if(!h||!_)return;let t=S(e);t&&x(t)},[h,_,S]),T=(0,y.useCallback)(e=>{if(!h||!_||!r)return;let o=S(e);if(!o||!p||!d)return;if(Math.sqrt((o.x-_.x)**2+(o.y-_.y)**2)<10){if(n.length>0){let e,t=n.find(t=>{if(typeof t.target==`string`)return!1;let n=t.target.selector;if(!n)return!1;let r=(Array.isArray(n)?n:[n]).find(e=>e.type===`SvgSelector`);if(!r||r.type!==`SvgSelector`)return!1;let i=si(r.value);if(!i)return!1;let a=p.width/d.width,s=p.height/d.height;if(i.type===`rect`){let{x:t,y:n,width:r,height:c}=i.data,l=t*a,d=n*s,f=r*a,p=c*s,m=o.x>=l&&o.x<=l+f&&o.y>=d&&o.y<=d+p;return m&&u.current&&(e=ge(u.current.getBoundingClientRect(),l,d,f,p)),m}return!1});if(t){a?.client.browse.click(t.id,e),g(!1),v(null),x(null);return}}g(!1),v(null),x(null);return}let s;switch(r){case`circle`:{let e=Math.sqrt((o.x-_.x)**2+(o.y-_.y)**2);s=oi(_,e);break}case`polygon`:{let e=(_.x+o.x)/2,t=(_.y+o.y)/2,n=Math.abs(o.x-_.x)/2,r=Math.abs(o.y-_.y)/2;s=ai([{x:e,y:t-r},{x:e+n,y:t},{x:e,y:t+r},{x:e-n,y:t}]);break}default:s=ii(_,o)}let c=ci(s,p.width,p.height,d.width,d.height);a&&i&&a.client.mark.request(cr(t),{type:`SvgSelector`,value:c},i),g(!1),v(null),x(null)},[h,_,r,p,d,S,i,n]),E=(0,y.useCallback)(()=>{h&&(g(!1),v(null),x(null))},[h]);return(0,R.jsxs)(`div`,{ref:l,className:`semiont-svg-drawing-canvas`,onMouseDown:C,onMouseMove:w,onMouseUp:T,onMouseLeave:E,"data-drawing-mode":r||`none`,children:[(0,R.jsx)(`img`,{ref:u,src:e,alt:`Annotatable content`,className:`semiont-svg-drawing-canvas__image`,draggable:!1}),p&&d&&(0,R.jsx)(`div`,{className:`semiont-svg-drawing-canvas__overlay-container`,children:(0,R.jsxs)(`div`,{className:`semiont-svg-drawing-canvas__overlay`,style:{width:p.width,height:p.height},children:[(0,R.jsx)(cJ,{annotations:n,imageWidth:d.width,imageHeight:d.height,displayWidth:p.width,displayHeight:p.height,hoverDelayMs:c,...a&&{session:a},...o!==void 0&&{hoveredAnnotationId:o},...s!==void 0&&{selectedAnnotationId:s}}),h&&_&&b&&(()=>{let e=lJ(i||null);return(0,R.jsxs)(`svg`,{className:`semiont-svg-drawing-canvas__preview`,style:{width:p.width,height:p.height},children:[r===`circle`&&(()=>{let t=Math.sqrt((b.x-_.x)**2+(b.y-_.y)**2);return(0,R.jsx)(`circle`,{cx:_.x,cy:_.y,r:t,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`polygon`&&(()=>{let t=(_.x+b.x)/2,n=(_.y+b.y)/2,r=Math.abs(b.x-_.x)/2,i=Math.abs(b.y-_.y)/2,a=[{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(` `);return(0,R.jsx)(`polygon`,{points:a,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`rectangle`&&(0,R.jsx)(`rect`,{x:Math.min(_.x,b.x),y:Math.min(_.y,b.y),width:Math.abs(b.x-_.x),height:Math.abs(b.y-_.y),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})]})})()]})})]})}var dJ=[{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 fJ({isOpen:e,onClose:t}){let n=ah(`KeyboardShortcuts`),r=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:t,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--large`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__header`,children:(0,R.jsxs)(`div`,{className:`semiont-modal__header-content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title`,children:n(`title`)}),(0,R.jsx)(`button`,{onClick:t,"aria-label":n(`closeDialog`),className:`semiont-modal__close`,children:(0,R.jsx)(`svg`,{className:`semiont-modal__close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}),(0,R.jsxs)(`div`,{className:`semiont-modal__body`,children:[(0,R.jsx)(`div`,{className:`semiont-shortcuts`,children:dJ.map(e=>(0,R.jsxs)(`div`,{className:`semiont-shortcuts__group`,children:[(0,R.jsx)(`h3`,{className:`semiont-shortcuts__group-title`,children:n(e.titleKey)}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__list`,children:e.shortcuts.map((e,t)=>(0,R.jsxs)(`div`,{className:`semiont-shortcuts__item`,children:[(0,R.jsx)(`span`,{className:`semiont-shortcuts__description`,children:n(e.descriptionKey)}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__keys`,children:e.keys.map((e,t)=>e.includes(`⌘`)&&!r||e.includes(`Ctrl`)&&r?null:(0,R.jsxs)(y.Fragment,{children:[t>0&&!e.includes(`⌘`)&&!e.includes(`Ctrl`)&&(0,R.jsx)(`span`,{className:`semiont-shortcuts__separator`,children:n(`or`)}),(0,R.jsx)(`kbd`,{className:`semiont-shortcuts__key`,children:e})]},t))})]},t))})]},e.titleKey))}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__note`,children:(0,R.jsx)(`p`,{className:`semiont-shortcuts__note-text`,children:n(r?`macNote`:`windowsNote`)})})]}),(0,R.jsx)(`div`,{className:`semiont-modal__footer`,children:(0,R.jsxs)(`div`,{className:`semiont-modal__footer-content`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__hint`,children:n(`footerHint`,{key:`?`}).split(`?`).map((e,t,n)=>(0,R.jsxs)(y.Fragment,{children:[e,t<n.length-1&&(0,R.jsx)(`kbd`,{className:`semiont-modal__hint-key`,children:`?`})]},t))}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-button semiont-button--secondary`,children:n(`close`)})]})})]})})})})]})})}function pJ(){let e=Z(Sm().activeSignals$),t=Z(e?.permissionDeniedAt$)??null,n=Z(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,R.jsx)(Rq,{appear:!0,show:i,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-modal__icon`,children:(0,R.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,R.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,R.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Access Denied`}),(0,R.jsx)(`p`,{className:`semiont-modal__description`,children:a})]}),(0,R.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,R.jsx)(`p`,{style:{color:`var(--semiont-text-secondary)`,marginBottom:`0.5rem`},children:`This could be because:`}),(0,R.jsxs)(`ul`,{style:{listStyle:`disc`,listStylePosition:`inside`,color:`var(--semiont-text-tertiary)`,display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,R.jsx)(`li`,{children:`You don't have the required permissions`}),(0,R.jsx)(`li`,{children:`The resource is restricted to specific users or teams`}),(0,R.jsx)(`li`,{children:`Your account type doesn't include this feature`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--primary semiont-button--flex`,children:`Go Back`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/`},className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`})]}),(0,R.jsx)(`div`,{className:`semiont-modal__actions`,style:{marginTop:`0.5rem`,paddingTop:`0.5rem`,borderTop:`1px solid var(--semiont-border-primary)`},children:(0,R.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 mJ(){let e=Z(Sm().activeSignals$),t=Z(e?.sessionExpiredAt$)??null,n=Z(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,R.jsx)(Rq,{appear:!0,show:i,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,R.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,R.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,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})})}),(0,R.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Session Expired`}),(0,R.jsx)(`p`,{className:`semiont-modal__description`,children:n??`Your session has expired for security reasons. Please sign in again to continue working.`})]}),(0,R.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`}),(0,R.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button--primary semiont-button--flex`,children:`Sign In Again`})]})]})})})})]})})}function hJ(e,t,n,r){if(!t||n<0||r<=n||r>e.length)return null;let i=di(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 gJ(e,t){let n=e.indexOf(t);return n===-1?null:{start:n,end:n+t.length}}var _J=new Set;function vJ(e,t){if(!e)return[{exact:``,start:0,end:0}];let n=t.map(t=>{let n=xr(t.target),r=gr(n),i=n?jr(n):null,a=Yr(e,{...r?{position:{start:r.start,end:r.end}}:{},...i?{quote:{exact:i.exact,...i.prefix===void 0?{}:{prefix:i.prefix},...i.suffix===void 0?{}:{suffix:i.suffix}}}:{}});return a&&a.confidence!==`high`&&yJ(t.id,a.strategy,a.confidence),{annotation:t,start:a?.start??0,end:a?.end??0,...a?.strategy?{strategy:a.strategy}:{},...a?.confidence?{confidence:a.confidence}:{}}}).filter(t=>t.start>=0&&t.end<=e.length&&t.start<t.end).sort((e,t)=>e.start-t.start);if(n.length===0)return[{exact:e,start:0,end:e.length}];let r=[],i=0;for(let{annotation:t,start:a,end:o,strategy:s,confidence:c}of n)a<i||(a>i&&r.push({exact:e.slice(i,a),start:i,end:a}),r.push({exact:e.slice(a,o),annotation:t,start:a,end:o,...s?{strategy:s}:{},...c?{confidence:c}:{}}),i=o);return i<e.length&&r.push({exact:e.slice(i),start:i,end:e.length}),r}function yJ(e,t,n){_J.has(e)||(_J.add(e),console.warn(`[segmentTextWithAnnotations] annotation anchored via degraded strategy`,{annotationId:e,strategy:t,confidence:n}))}function bJ(){let e=ah(`PdfViewer`);return(0,R.jsx)(R.Fragment,{children:e(`viewerLoading`)})}var xJ=(0,y.lazy)(()=>s(()=>import(`./PdfAnnotationCanvas.client-LSH3PZPY-DzZPOyF8.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([4,2,3,1])));function SJ({content:e,annotations:t,session:n,sparkleAnnotationIds:r,hoveredAnnotationId:i,scrollToAnnotationId:a,showLineNumbers:o=!1,hoverDelayMs:s=150,enableWidgets:c=!1,getTargetResourceName:l,generatingReferenceId:u}){let d=vJ(e,t);return(0,R.jsx)(DU,{content:e,segments:d,editable:!1,sparkleAnnotationIds:r,...i!==void 0&&{hoveredAnnotationId:i},...a!==void 0&&{scrollToAnnotationId:a},sourceView:!0,showLineNumbers:o,hoverDelayMs:s,enableWidgets:c,session:n,...l&&{getTargetResourceName:l},...u!==void 0&&{generatingReferenceId:u}})}function CJ({content:e,resourceUri:t,annotations:n,session:r,drawingMode:i,selectedMotivation:a,hoveredAnnotationId:o,hoverDelayMs:s=150}){return e?(0,R.jsx)(uJ,{imageUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:i,selectedMotivation:a,session:r,hoveredAnnotationId:o||null,hoverDelayMs:s}):null}function wJ({content:e,resourceUri:t,annotations:n,session:r,drawingMode:i,selectedMotivation:a,hoveredAnnotationId:o,hoverDelayMs:s=150}){return e?(0,R.jsx)(y.Suspense,{fallback:(0,R.jsx)(`div`,{className:`semiont-annotate-view__loading`,children:(0,R.jsx)(bJ,{})}),children:(0,R.jsx)(xJ,{pdfUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:i,selectedMotivation:a,session:r,hoveredAnnotationId:o||null,hoverDelayMs:s,pageLayout:`scroll`})}):null}var TJ={text:SJ,image:CJ,pdf:wJ};function EJ({resourceUri:e,session:t}){let n=t?.client??null,{token:r}=JF(n,cr(e)),i=bF(n,cr(e),r);return i?(0,R.jsx)(`a`,{href:i,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`}):(0,R.jsx)(`button`,{type:`button`,disabled:!0,className:`semiont-button semiont-button--primary semiont-button--disabled`,children:`Download File`})}function DJ({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,session:f,sparkleAnnotationIds:p,onModeChange:m,showToolbar:h=!0,renderers:g}){let _=(0,y.useRef)(null),v=bi(t)?.render??`none`,{highlights:b,references:x,assessments:S,comments:C,tags:w}=r,T=[...b,...x,...S,...C,...w],{selectedMotivation:E,selectedClick:D,selectedShape:O,hoveredAnnotationId:k,scrollToAnnotationId:A}=i,j=(0,y.useRef)(a);j.current=a;let M=(0,y.useCallback)(e=>{j.current?.({selectedMotivation:e})},[]),ee=(0,y.useCallback)(e=>{j.current?.({selectedClick:e})},[]),N=(0,y.useCallback)(e=>{j.current?.({selectedShape:e})},[]);XF(f,{"beckon:hover":(0,y.useCallback)(({annotationId:e})=>{j.current?.({hoveredAnnotationId:e})},[]),"beckon:focus":(0,y.useCallback)(({annotationId:e,resourceId:t})=>{t&&t!==n||_.current&&uU(e??null,_.current,{pulse:!0})},[n])}),(0,y.useEffect)(()=>{let t=_.current;if(!t)return;let r=!1,i=e=>{let t=e.target;r=!!t.closest(`[data-annotation-id]`),t.closest(`[data-annotation-ui]`)},a=i=>{let a=i.target;if(a.closest(`.semiont-pdf-annotation-canvas`)||a.closest(`.semiont-svg-drawing-canvas`))return;let o=window.getSelection();if(!o||o.isCollapsed||!o.toString()){r=!1;return}if(r){r=!1;return}r=!1;let s=o.getRangeAt(0),c=o.toString(),l=t.querySelector(`.codemirror-renderer`)?.__cmView,u,d;if(!l||!l.posAtDOM){let t=gJ(e,c);if(!t)return;u=t.start,d=t.end}else u=l.posAtDOM(s.startContainer,s.startOffset),d=u+c.length;if(u>=0&&E){let t=hJ(e,c,u,d);if(!t)return;f?.client.mark.request(cr(n),t,E),o.removeAllRanges()}};return t.addEventListener(`mouseup`,a),t.addEventListener(`mousedown`,i),()=>{t.removeEventListener(`mouseup`,a),t.removeEventListener(`mousedown`,i)}},[E,e,n]);let te={...TJ,...g}[v];return te?(0,R.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":v,ref:_,children:[h&&(0,R.jsx)(zU,{selectedMotivation:E,selectedClick:D,selectedShape:O,mediaType:t,annotateMode:d,annotators:rT,onModeChange:m,onClickActionChange:ee,onSelectionChange:M,onShapeChange:N}),(0,R.jsx)(`div`,{className:`semiont-annotate-view__content`,children:(0,R.jsx)(te,{content:e,mimeType:t,resourceUri:n,annotations:T,session:f,drawingMode:E?O:null,selectedMotivation:E,hoveredAnnotationId:k,hoverDelayMs:u,sparkleAnnotationIds:p,scrollToAnnotationId:A,showLineNumbers:l,enableWidgets:o,...s&&{getTargetResourceName:s},generatingReferenceId:c})})]}):(0,R.jsx)(`div`,{ref:_,className:`semiont-annotate-view semiont-annotate-view--unsupported`,"data-mime-type":`unsupported`,children:(0,R.jsxs)(`div`,{className:`semiont-annotate-view__empty`,children:[(0,R.jsxs)(`p`,{className:`semiont-annotate-view__empty-message`,children:[`Annotation not supported for `,t]}),(0,R.jsx)(EJ,{resourceUri:n,session:f})]})})}function OJ(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 kJ(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:failed`:return t(`jobEvent`);case`yield:representation-added`:case`yield:representation-removed`:return t(`representationEvent`);default:return e}}function AJ(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`?rT.highlight.iconEmoji||`📝`:e===`linking`?rT.reference.iconEmoji||`📝`:e===`assessing`&&rT.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`:return`⚙️`;case`job:failed`:return`❌`;case`yield:representation-added`:case`yield:representation-removed`:return`📄`;default:return`📝`}}function jJ(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 MJ(e,t=50){let n=e.trim();return n.length>t?n.substring(0,t)+`...`:n}function NJ(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=kr(xr(e.target));if(t)return{exact:MJ(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=kr(t.selector);if(e)return{exact:MJ(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=kr(e.selector);if(t)return{exact:MJ(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=kr(xr(e.target));if(t)return{exact:MJ(t),isQuoted:!0,isTag:!1}}catch{}}return null;case`job:started`:case`job:failed`:case`yield:representation-added`:case`yield:representation-removed`:return null;default:return null}}function PJ(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 FJ(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 IJ({event:e,annotations:t,allEvents:n,isRelated:r,t:i,Link:a,routes:o,onEventRef:s,onEventClick:c,onEventHover:l}){let u=NJ(e,t,n),d=fr(e),f=FJ(e),p=PJ(e),m=(0,y.useRef)(null),h=(0,y.useRef)(l);(0,y.useEffect)(()=>{h.current=l});let g=(0,y.useCallback)(()=>{!d||!h.current||(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{h.current?.(d)},300))},[d]),_=(0,y.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null),h.current&&h.current(null)},[]),v=d?`button`:`div`,b=d?{type:`button`,onClick:()=>c?.(d),"aria-label":i(`viewAnnotation`,{content:u?.exact||kJ(e.type,i)}),className:`semiont-history-event`,"data-related":r?`true`:`false`,"data-interactive":`true`}:{className:`semiont-history-event`,"data-related":r?`true`:`false`};return(0,R.jsxs)(v,{ref:e=>{s&&s(d,e)},...b,children:[(0,R.jsxs)(`div`,{className:`semiont-history-event__content`,children:[(0,R.jsx)(`span`,{className:`semiont-history-event__emoji`,onMouseEnter:g,onMouseLeave:_,children:AJ(e.type,e.payload)}),u?u.isTag?(0,R.jsx)(`span`,{className:`semiont-history-event__tag`,children:u.exact}):u.isQuoted?(0,R.jsxs)(`span`,{className:`semiont-history-event__text semiont-history-event__text--quoted`,children:[`“`,u.exact,`”`]}):(0,R.jsx)(`span`,{className:`semiont-history-event__text`,children:u.exact}):(0,R.jsx)(`span`,{className:`semiont-history-event__text`,children:kJ(e.type,i,e.payload)}),e.userId&&(0,R.jsx)(`span`,{className:`semiont-history-event__user`,children:OJ(e.userId)}),(0,R.jsx)(`span`,{className:`semiont-history-event__timestamp`,children:jJ(e.timestamp,i)})]}),p.length>0&&(0,R.jsx)(`div`,{className:`semiont-history-event__entity-types`,children:p.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--small`,"data-variant":`blue`,children:e},e))}),f&&(0,R.jsxs)(`div`,{className:`semiont-history-event__details`,children:[(0,R.jsxs)(`span`,{className:`semiont-history-event__detail`,children:[i(`user`),`: `,(0,R.jsx)(`span`,{className:`semiont-history-event__detail-value`,children:f.userId?OJ(f.userId):``})]}),f.type===`cloned`&&f.sourceDocId&&(0,R.jsx)(a,{href:o.resourceDetail(f.sourceDocId),className:`semiont-history-event__link`,onClick:e=>e.stopPropagation(),children:i(`viewOriginal`)})]})]})}function LJ({events:e,eventsLoading:t=!1,eventsError:n=null,onRetryEvents:r,annotations:i=[],hoveredAnnotationId:a,onEventHover:o,onEventClick:s,Link:c,routes:l}){let u=ah(`AnnotationHistory`),d=t,f=n,p=(0,y.useRef)(new Map),m=(0,y.useRef)(null),h=e.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,y.useEffect)(()=>{m.current&&h.length>0&&requestAnimationFrame(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)})},[h.length]),(0,y.useEffect)(()=>{if(!a)return;let e=p.current.get(a);e&&m.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))},[a]),f?(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsxs)(`p`,{className:`semiont-history-panel__error`,children:[u(`failed`),r&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:r,className:`semiont-panel__inline-action`,children:u(`retry`)})]})]})]}):d?(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsx)(`div`,{className:`semiont-history-panel__loading`,children:u(`loading`)})]}):h.length===0?null:(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsx)(`div`,{ref:m,className:`semiont-history-panel__list`,children:h.map(e=>{let t=a?(()=>{let t=fr(e);return t?t===a:!1})():!1;return(0,R.jsx)(IJ,{event:e,annotations:i,allEvents:h,isRelated:t,t:u,Link:c,routes:l,onEventRef:(e,t)=>{t&&e?p.current.set(e,t):!t&&e&&p.current.delete(e)},...s&&{onEventClick:s},...o&&{onEventHover:o}},e.id)})})]})}function RJ(){let e=ah(`PdfViewer`);return(0,R.jsx)(R.Fragment,{children:e(`viewerLoading`)})}var zJ=(0,y.lazy)(()=>s(()=>import(`./PdfAnnotationCanvas.client-LSH3PZPY-DzZPOyF8.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([4,2,3,1]))),BJ=(0,y.memo)(function({content:e}){return(0,R.jsx)(Jx,{remarkPlugins:[Qw],children:e})});function VJ({content:e}){return(0,R.jsx)(BJ,{content:e})}function HJ({content:e,resourceUri:t,annotations:n,session:r}){return(0,R.jsx)(uJ,{imageUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:null,selectedMotivation:null,session:r})}function UJ({content:e,resourceUri:t,annotations:n,session:r}){return(0,R.jsx)(y.Suspense,{fallback:(0,R.jsx)(`div`,{className:`semiont-browse-view__loading`,children:(0,R.jsx)(RJ,{})}),children:(0,R.jsx)(zJ,{pdfUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:null,selectedMotivation:null,session:r,pageLayout:`scroll`})})}var WJ={text:VJ,image:HJ,pdf:UJ},GJ=(0,y.memo)(function({content:e,mimeType:t,resourceUri:n,annotations:r,selectedClick:i=`detail`,onModeChange:a,onClickActionChange:o,showToolbar:s=!0,annotateMode:c,hoverDelayMs:l=150,session:u,sparkleAnnotationIds:d,renderers:f,onLinkClick:p,onReferenceHover:m,inline:h=!1}){let g=(0,y.useRef)(null),_=h?` semiont-browse-view--inline`:``,v=bi(t)?.render??`none`,{highlights:b,references:x,assessments:S,comments:C,tags:w}=r,T=(0,y.useMemo)(()=>[...b,...x,...S,...C,...w],[b,x,S,C,w]),E=(0,y.useMemo)(()=>EF(T),[T]);(0,y.useEffect)(()=>{if(!g.current||E.length===0)return;let t=g.current,n=xF(e,t),r=SF(t);return wF(CF(E,n),r),()=>TF(t)},[e,E]),(0,y.useEffect)(()=>{if(!g.current||!u)return;let e=g.current,t=e=>{let t=e.target.closest(`[data-annotation-id]`);if(!t)return;let n=window.getSelection();if(n&&!n.isCollapsed)return;let r=t.getAttribute(`data-annotation-id`);if(r){let e=T.find(e=>e.id===r);e&&u.client.browse.click(e.id,t.getBoundingClientRect())}},n=null,r=null,i=!1,a=e=>{if(!m)return;let t=T.find(t=>t.id===e);if(!t||!Or(t))return;let a=yr(t.body),o=n;!a||!o||(r?.unsubscribe(),r=u.client.browse.resource(cr(a)).subscribe({next:e=>{if(e.status!==`ready`)return;let n=e.value;r?.unsubscribe(),r=null,i=!0,m({annotation:t,referent:n,anchorRect:o.getBoundingClientRect()})},error:()=>{r=null}}))},o=()=>{r?.unsubscribe(),r=null,i&&(i=!1,m?.(null))},{handleMouseEnter:s,handleMouseLeave:c,cleanup:f}=Yl(e=>{u.client.beckon.hover(e),e?a(e):o()},l),p=e=>{let t=e.target.closest(`[data-annotation-id]`),r=t?.getAttribute(`data-annotation-id`);r&&(n=t,s(lr(r)))},h=e=>{e.target.closest(`[data-annotation-id]`)&&c()};return d&&e.querySelectorAll(`[data-annotation-id]`).forEach(e=>{let t=e.getAttribute(`data-annotation-id`);t&&d.has(t)&&e.classList.add(`annotation-sparkle`)}),e.addEventListener(`click`,t),e.addEventListener(`mouseover`,p),e.addEventListener(`mouseout`,h),()=>{e.removeEventListener(`click`,t),e.removeEventListener(`mouseover`,p),e.removeEventListener(`mouseout`,h),f(),r?.unsubscribe()}},[e,T,d,l,u,m]);let D=(0,y.useCallback)((e,t=!1)=>{g.current&&uU(e,g.current,{pulse:t})},[]);XF(u,{"beckon:hover":(0,y.useCallback)(({annotationId:e})=>{D(e)},[D]),"beckon:focus":(0,y.useCallback)(({annotationId:e,resourceId:t})=>{t&&t!==n||D(e??null,!0)},[D,n])});let O=(0,y.useCallback)(e=>{let t=e.target.closest(`a[href]`);if(!t)return;e.preventDefault();let n=t.getAttribute(`href`);n&&p?.({href:n,event:e})},[p]),k={...WJ,...f},A=v===`none`?void 0:k[v];return A?(0,R.jsxs)(`div`,{className:`semiont-browse-view${_}`,"data-mime-type":v,children:[s&&(0,R.jsx)(zU,{selectedMotivation:null,selectedClick:i,parts:[`clickAction`,`mode`],showDeleteButton:!1,annotateMode:c,annotators:rT,onModeChange:a,onClickActionChange:o,compact:h}),(0,R.jsx)(`div`,{ref:g,className:`semiont-browse-view__content`,onClick:O,children:(0,R.jsx)(A,{content:e,mimeType:t,resourceUri:n,annotations:T,session:u})})]}):(0,R.jsx)(`div`,{ref:g,className:`semiont-browse-view semiont-browse-view--unsupported${_}`,"data-mime-type":`unsupported`,children:(0,R.jsxs)(`div`,{className:`semiont-browse-view__empty`,children:[(0,R.jsxs)(`p`,{className:`semiont-browse-view__empty-message`,children:[`Preview not available for `,t]}),(0,R.jsx)(EJ,{resourceUri:n,session:u})]})})});function KJ({resource:e,annotations:t,session:n,onOpenResource:r,onOpenPanel:i,onLinkClick:a,onReferenceHover:o,inline:s=!1,sparkleAnnotationIds:c,generatingReferenceId:l,showLineNumbers:u=!1,hoverDelayMs:d,hoveredAnnotationId:f,annotateMode:p,onAnnotateModeChange:m,clickAction:h,onClickActionChange:g,selectionMotivation:_,onSelectionMotivationChange:v,shape:b,onShapeChange:x,showToolbar:S=!0,browseRenderers:C,annotateRenderers:w}){let T=ah(`ResourceViewer`),E=(0,y.useRef)(null),{highlights:D,references:O,assessments:k,comments:A,tags:j}=t;if(!e[`@id`])throw Error(`Resource has no @id`);let M=e[`@id`],ee=Hr(e)||`text/plain`,[N,te]=(0,y.useState)(!1),P=p??N,F=(0,y.useCallback)(e=>{p===void 0&&te(e),m?.(e)},[p,m]),ne=P?`annotate`:`browse`,[re,ie]=(0,y.useState)(`linking`),ae=_===void 0?re:_,oe=(0,y.useCallback)(e=>{_===void 0&&ie(e),v?.(e)},[_,v]),[se,I]=(0,y.useState)(`detail`),L=h??se,ce=(0,y.useCallback)(e=>{h===void 0&&I(e),g?.(e)},[h,g]),[le,ue]=(0,y.useState)(`rectangle`),de=b??le,fe=(0,y.useCallback)(e=>{b===void 0&&ue(e),x?.(e)},[b,x]),[pe,me]=(0,y.useState)(!1),[he,ge]=(0,y.useState)(null),[_e,ve]=(0,y.useState)(null),ye=f??null,be=()=>typeof window>`u`?{x:0,y:0}:{x:Math.max(0,(window.innerWidth-800)/2),y:Math.max(0,(window.innerHeight-700)/2)},xe=(0,y.useCallback)(e=>{n?.client.mark.delete(M,e)},[n,M]),Se=(0,y.useCallback)((e,t)=>{if(Object.values(rT).find(t=>t.matchesAnnotation(e))?.hasSidePanel&&L!==`deleting`&&L!==`jsonld`&&L!==`follow`)return;let n=Sr(e)||wr(e)||Tr(e)||Cr(e)||Er(e);if(L===`follow`&&Cr(e)){let t=yr(e.body);t&&r?.(t);return}if(L===`jsonld`&&n){ge(e),me(!0);return}if(P&&L===`deleting`&&n){let n=t?{x:t.clientX,y:t.clientY+10}:{x:window.innerWidth/2-150,y:window.innerHeight/2-75};ve({annotation:e,position:n});return}},[P,L,r]);XF(n,{"browse:click":(0,y.useCallback)(({annotationId:e,anchorRect:t})=>{let n=[...D,...O,...k,...A,...j].find(t=>t.id===e);if(n){if(!Object.values(rT).find(e=>e.matchesAnnotation(n))?.hasSidePanel||L!==`detail`){Se(n);return}i?.({panel:`annotations`,scrollToAnnotationId:e,motivation:n.motivation,...t?{anchorRect:t}:{}})}},[D,O,k,A,j,Se,L,i])});let Ce=(0,y.useMemo)(()=>({highlights:D,references:O,assessments:k,comments:A,tags:j}),[D,O,k,A,j]),z={selectedMotivation:ae,selectedClick:L,selectedShape:de,hoveredAnnotationId:ye},we=(0,y.useCallback)(e=>{let t=O.find(t=>yr(t.body)===e);return t?kr(xr(t.target)):void 0},[O]);return(0,R.jsxs)(`div`,{ref:E,className:`semiont-resource-viewer${s?` semiont-resource-viewer--inline`:``}`,children:[ne===`annotate`?(0,R.jsx)(DJ,{content:e.content,mimeType:ee,resourceUri:e[`@id`],annotations:Ce,uiState:z,onUIStateChange:e=>{`selectedMotivation`in e&&oe(e.selectedMotivation??null),`selectedClick`in e&&ce(e.selectedClick),`selectedShape`in e&&fe(e.selectedShape)},enableWidgets:!0,getTargetResourceName:we,...l!==void 0&&{generatingReferenceId:l},showLineNumbers:u,hoverDelayMs:d,annotateMode:P,onModeChange:F,showToolbar:S,session:n,sparkleAnnotationIds:c,...w&&{renderers:w}}):(0,R.jsx)(GJ,{content:e.content,mimeType:ee,resourceUri:e[`@id`],annotations:Ce,selectedClick:L,hoverDelayMs:d,annotateMode:P,onModeChange:F,onClickActionChange:ce,showToolbar:S,session:n,sparkleAnnotationIds:c,onLinkClick:a,onReferenceHover:o,inline:s,...C&&{renderers:C}}),he&&(0,R.jsx)(aJ,{isOpen:pe,onClose:()=>me(!1),position:be(),wide:!0,children:(0,R.jsx)(sW,{annotation:he,onBack:()=>{me(!1),ge(null)}})}),_e&&(()=>{let e=_e.annotation,t=Object.values(rT).find(t=>t.matchesAnnotation(e)),n=kr(xr(e.target)),r=t?.iconEmoji||`📝`;return(0,R.jsx)(aJ,{isOpen:!!_e,onClose:()=>ve(null),position:_e.position,children:(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation`,children:[(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation__header`,children:[(0,R.jsx)(`span`,{className:`semiont-delete-confirmation__icon`,children:r}),(0,R.jsx)(`h3`,{className:`semiont-delete-confirmation__title`,children:T(`deleteConfirmationTitle`)})]}),n&&(0,R.jsx)(`div`,{className:`semiont-delete-confirmation__quote`,children:(0,R.jsxs)(`p`,{className:`semiont-delete-confirmation__text`,children:[`"`,n.length>100?n.substring(0,100)+`...`:n,`"`]})}),(0,R.jsx)(`p`,{className:`semiont-delete-confirmation__message`,children:T(`deleteConfirmationMessage`)}),(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>ve(null),className:`semiont-button semiont-button--secondary`,children:T(`deleteConfirmationCancel`)}),(0,R.jsx)(`button`,{onClick:()=>{xe(_e.annotation.id),ve(null)},className:`semiont-button semiont-button--danger`,children:T(`deleteConfirmationDelete`)})]})]})})})()]})}function qJ(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 YJ(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`TextualBody`&&`value`in e&&typeof e.value==`string`}function XJ(e){return e.body?YJ(e.body)?e.body.value||null:Array.isArray(e.body)&&e.body.length>0&&e.body.find(YJ)?.value||null:null}function ZJ({session:e,assessment:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t),s=XJ(t);return(0,R.jsxs)(`div`,{ref:i,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`assessment`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...a,children:[o&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`assessment`,children:[`"`,o.substring(0,100),o.length>100?`...`:``,`"`]}),s&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__body`,"data-type":`assessment`,children:s}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,JJ(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function QJ(e){return t=>{switch(t.code){case`loading`:return e(`codeLoading`);case`analyzing`:return e(`codeAnalyzing`);case`analyzing-tags`:return e(`codeAnalyzingTags`);case`generating-resource`:return e(`codeGeneratingResource`);case`creating-resource`:return e(`codeCreatingResource`);case`complete-generated`:return t.truncated?e(`codeCompleteGeneratedTruncated`):e(`codeCompleteGenerated`);case`detecting-entities`:return e(`codeDetectingEntities`);case`creating-annotations`:return e(`codeCreatingAnnotations`,{count:t.count});case`creating-tag-annotations`:return e(`codeCreatingTagAnnotations`,{count:t.count});case`complete-created`:return e(`codeCompleteCreated`,{count:t.count,kind:e($J(t.kind))});default:return t}}}function $J(e){return`kind${e.charAt(0).toUpperCase()}${e.slice(1)}`}function eY(e){let t=tY(e);return(n,r,i)=>r===void 0||i===void 0?e(`subject`,{kind:t(n.kind),label:n.value}):e(`subjectWithPosition`,{kind:t(n.kind),label:n.value,done:r+1,total:i})}function tY(e){return t=>{switch(t){case`entity-type`:return e(`subjectKindEntityType`);case`category`:return e(`subjectKindCategory`);default:return t}}}function nY(e){return t=>{switch(t){case`entity-types`:return e(`paramEntityTypes`);case`instructions`:return e(`paramInstructions`);case`tone`:return e(`paramTone`);case`density`:return e(`paramDensity`);default:return t}}}function rY(e,t){return{cancel:e(`cancel`),close:e(`close`),inProgress:e(`inProgress`),message:QJ(e),subject:eY(e),paramLabel:nY(e),...t?.found?{found:t.found}:{}}}function iY({session:e,annotationType:t,isAssisting:n,locale:r,sourceLanguage:i,progress:a}){let o=ah(t===`highlight`?`HighlightPanel`:t===`assessment`?`AssessmentPanel`:`CommentsPanel`),s=ah(`AssistProgress`),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(``),[f,p]=(0,y.useState)(t===`assessment`?4:5),[m,h]=(0,y.useState)(!0),g=(0,y.useCallback)(()=>{let n=t===`highlight`?`highlighting`:t===`assessment`?`assessing`:`commenting`;e?.client.mark.requestAssist(n,{instructions:c.trim()||void 0,tone:(t===`comment`||t===`assessment`)&&u?u:void 0,density:m?f:void 0,language:t===`comment`||t===`assessment`?r:void 0,sourceLanguage:i}),l(``),d(``)},[t,c,u,m,f,r,i,e]),_=(0,y.useCallback)(()=>{e?.client.mark.dismissProgress()},[e]);return(0,R.jsx)(AU,{assistType:t,title:o(t===`highlight`?`annotateHighlights`:t===`assessment`?`annotateAssessments`:`annotateComments`),isAssisting:n,progress:a,progressProps:{onDismiss:_,translations:{cancel:o(`cancel`),inProgress:o(`annotating`),close:s(`close`),message:QJ(s),subject:eY(s),paramLabel:nY(s)}},form:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label`,children:[o(`instructions`),` `,o(`optional`)]}),(0,R.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),className:`semiont-textarea`,rows:3,placeholder:o(`instructionsPlaceholder`),maxLength:500}),(0,R.jsxs)(`div`,{className:`semiont-form-field__char-count`,children:[c.length,`/500`]})]}),(t===`comment`||t===`assessment`)&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label`,children:[o(`toneLabel`),` `,o(`toneOptional`)]}),(0,R.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:``,children:`Default`}),t===`comment`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`option`,{value:`scholarly`,children:o(`toneScholarly`)}),(0,R.jsx)(`option`,{value:`explanatory`,children:o(`toneExplanatory`)}),(0,R.jsx)(`option`,{value:`conversational`,children:o(`toneConversational`)}),(0,R.jsx)(`option`,{value:`technical`,children:o(`toneTechnical`)})]}),t===`assessment`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`option`,{value:`analytical`,children:o(`toneAnalytical`)}),(0,R.jsx)(`option`,{value:`critical`,children:o(`toneCritical`)}),(0,R.jsx)(`option`,{value:`balanced`,children:o(`toneBalanced`)}),(0,R.jsx)(`option`,{value:`constructive`,children:o(`toneConstructive`)})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`div`,{className:`semiont-form-field__header`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label semiont-form-field__label--with-checkbox`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked),className:`semiont-checkbox`,"data-variant":t}),(0,R.jsx)(`span`,{children:o(`densityLabel`)})]}),m&&(0,R.jsx)(`span`,{className:`semiont-form-field__info`,children:o(`densityPerWords`,{density:f})})]}),m&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{type:`range`,min:t===`comment`?`2`:`1`,max:t===`comment`?`12`:t===`assessment`?`10`:`15`,value:f,onChange:e=>p(Number(e.target.value)),className:`semiont-slider`}),(0,R.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,R.jsx)(`span`,{children:o(`densitySparse`)}),(0,R.jsx)(`span`,{children:o(`densityDense`)})]})]})]}),(0,R.jsxs)(`button`,{onClick:g,className:`semiont-button`,"data-variant":`assist`,"data-type":t,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:o(`annotate`)})]})]})})}function aY({count:e,title:t}){return(0,R.jsx)(`div`,{className:`semiont-panel-header`,children:(0,R.jsxs)(`h2`,{className:`semiont-panel-header__title`,children:[(0,R.jsx)(`span`,{className:`semiont-panel-header__text`,children:t}),(0,R.jsxs)(`span`,{className:`semiont-panel-header__count`,children:[`(`,e,`)`]})]})})}function oY(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 sY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,isAssisting:i=!1,progress:a,locale:o,sourceLanguage:s,annotateMode:c=!0,scrollToAnnotationId:l,onScrollCompleted:u,hoveredAnnotationId:d}){let f=ah(`AssessmentPanel`),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(new Map),b=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),x=(0,y.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!l)return;let e=v.current.get(l);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`),u&&u()}},[l]),(0,y.useEffect)(()=>{if(!d)return;let e=v.current.get(d);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`})}},[d]),(0,y.useEffect)(()=>{if(!r)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),m(``))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[r,e]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`assessment`,count:n.length,title:f(`title`)}),r&&r.motivation===`assessing`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`assessment`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=oY(r.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,R.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`assessmentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[p.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),m(``)},className:`semiont-button semiont-button--secondary`,"data-type":`assessment`,children:f(`cancel`)}),(0,R.jsx)(`button`,{onClick:()=>{if(r){let n=p.trim(),i=n?{type:`TextualBody`,value:n,purpose:`assessing`}:void 0;e?.client.mark.submit({source:t,motivation:`assessing`,selector:r.selector,...i===void 0?{}:{body:i}}),m(``)}},className:`semiont-button semiont-button--primary`,"data-type":`assessment`,children:f(`save`)})]})]})]}),(0,R.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[c&&(0,R.jsx)(iY,{session:e,annotationType:`assessment`,isAssisting:i,locale:o,sourceLanguage:s,progress:a}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noAssessments`)}):b.map(t=>(0,R.jsx)(ZJ,{session:e,assessment:t,isFocused:t.id===h,isHovered:t.id===d,ref:e=>x(t.id,e)},t.id))})]})]})}function cY(e){if(e>=1e6){let t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){let t=e/1e3;return`${Number.isInteger(t)?t:t.toFixed(1)}K`}return String(e)}function lY({state:e,eventCount:t,lastEventTimestamp:n,knowledgeBaseName:r,collaborators:i}){let a=ah(`CollaborationPanel`),o=(i??[]).filter(e=>e.agent[`@type`]===`Software`),s=e===`open`||e===`reconnecting`||e===`initial`||e===`connecting`,c;if(!n)c=a(`noActivity`);else{let e=new Date,t=new Date(n),r=e.getTime()-t.getTime(),i=Math.floor(r/1e3),o=Math.floor(i/60),s=Math.floor(o/60);c=i<10?a(`justNow`):i<60?a(`secondsAgo`,{count:i}):o===1?a(`minuteAgo`):o<60?a(`minutesAgo`,{count:o}):s===1?a(`hourAgo`):s<24?a(`hoursAgo`,{count:s}):t.toLocaleDateString()}return(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__title`,children:a(`title`)}),r&&(0,R.jsx)(`div`,{style:{padding:`0 0.75rem 0.5rem`,fontSize:`0.8rem`,color:`var(--semiont-color-neutral-400)`},children:r}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`connectionStatus`)}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__status`,children:[(0,R.jsxs)(`span`,{className:`semiont-collaboration-panel__indicator`,children:[(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__dot`,"data-connected":s?`true`:`false`}),(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__status-text`,"data-connected":s?`true`:`false`,children:a(s?`live`:`disconnected`)})]}),s&&t>0&&(0,R.jsxs)(`span`,{className:`semiont-collaboration-panel__event-count`,children:[`(`,a(`events`,{count:t}),`)`]})]}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__details`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__label`,children:a(`lastSync`)}),` `,c]}),(0,R.jsx)(`div`,{children:a(s?`realtimeActive`:`reconnecting`)})]})]}),o.length>0&&(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`collaborators`)}),o.map((e,t)=>{let n=e.agent,r=e.limits,i=r?r.maxOutputTokens===r.contextTokens?a(`sharedWindow`,{contextTokens:cY(r.contextTokens)}):a(`ceilings`,{contextTokens:cY(r.contextTokens),maxOutputTokens:cY(r.maxOutputTokens)}):null;return(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__collaborator`,"data-testid":`semiont-collaborator-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__collaborator-id`,children:[n.provider&&(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__collaborator-provider`,children:n.provider}),(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__collaborator-model`,children:n.model??n.name})]}),e.servesJobTypes&&e.servesJobTypes.length>0&&(0,R.jsx)(`div`,{className:`semiont-collaboration-panel__collaborator-jobs`,children:e.servesJobTypes.join(`, `)}),i&&(0,R.jsx)(`div`,{className:`semiont-collaboration-panel__collaborator-limits`,children:i})]},n[`@id`]??`${n.provider}:${n.model}:${t}`)})]}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`sharing`)}),(0,R.jsx)(`p`,{className:`semiont-collaboration-panel__description`,children:a(`collaborationComingSoon`)})]})]})}function uY(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 dY({session:e,comment:t,isFocused:n,isHovered:r=!1,annotateMode:i=!0,ref:a}){let o=ah(`CommentsPanel`),s=IF(e,t.id),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(``),f=(0,y.useRef)(null);(0,y.useImperativeHandle)(a,()=>f.current);let p=Dr(t)||``,m=Ar(t);(0,y.useEffect)(()=>{n&&f.current&&f.current.scrollIntoView({behavior:`smooth`,block:`center`})},[n]);let h=()=>{d(p),l(!0)},g=()=>{l(!1)},_=()=>{l(!1),d(``)};return(0,R.jsxs)(`div`,{ref:f,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`comment`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...s,children:[m&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`comment`,children:[`"`,m.substring(0,100),m.length>100?`...`:``,`"`]}),c?(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__edit`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),className:`semiont-textarea`,rows:3,autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__edit-footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-entry__char-count`,children:[u.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__button-group`,children:[(0,R.jsx)(`button`,{onClick:g,className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:o(`save`)}),(0,R.jsx)(`button`,{onClick:_,className:`semiont-button semiont-button--secondary`,children:o(`cancel`)})]})]})]}):(0,R.jsx)(`div`,{className:`semiont-annotation-entry__body`,children:p}),!c&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__footer`,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,uY(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]}),i&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__actions`,onClick:e=>e.stopPropagation(),children:(0,R.jsx)(`button`,{onClick:h,className:`semiont-text-button`,"data-variant":`comment`,children:o(`edit`)})})]})]})}function fY(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 pY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,annotateMode:i=!0,isAssisting:a=!1,progress:o,locale:s,sourceLanguage:c,scrollToAnnotationId:l,onScrollCompleted:u,hoveredAnnotationId:d}){let f=ah(`CommentsPanel`),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(new Map),b=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),x=(0,y.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!l)return;let e=v.current.get(l);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`),u&&u()}},[l]),(0,y.useEffect)(()=>{if(!d)return;let e=v.current.get(d);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`})}},[d]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,y.useEffect)(()=>{if(!r)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),m(``))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[r,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`comment`,count:n.length,title:f(`title`)}),r&&r.motivation===`commenting`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`comment`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=fY(r.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,R.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`commentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[p.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),m(``)},className:`semiont-button semiont-button--secondary`,"data-type":`comment`,children:f(`cancel`)}),(0,R.jsx)(`button`,{onClick:()=>{p.trim()&&r&&(e?.client.mark.submit({source:t,motivation:`commenting`,selector:r.selector,body:[{type:`TextualBody`,value:p,purpose:`commenting`}]}),m(``))},disabled:!p.trim(),className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:f(`save`)})]})]})]}),(0,R.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[i&&(0,R.jsx)(iY,{session:e,annotationType:`comment`,isAssisting:a,locale:s,sourceLanguage:c,progress:o}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noComments`)}):b.map(t=>(0,R.jsx)(dY,{session:e,comment:t,isFocused:t.id===h,isHovered:t.id===d,annotateMode:i,ref:e=>x(t.id,e)},t.id))})]})]})}function mY(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 hY({session:e,highlight:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t);return(0,R.jsxs)(`div`,{ref:i,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`highlight`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...a,children:[o&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`highlight`,children:[`"`,o.substring(0,200),o.length>200?`...`:``,`"`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,mY(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function gY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,isAssisting:i=!1,progress:a,annotateMode:o=!0,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l,sourceLanguage:u}){let d=ah(`HighlightPanel`),[f,p]=(0,y.useState)(null),m=(0,y.useRef)(null),h=(0,y.useRef)(new Map),g=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),_=(0,y.useCallback)((e,t)=>{t?h.current.set(e,t):h.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!s)return;let e=h.current.get(s);if(e&&m.current){let t=e.offsetTop,n=m.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;m.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,y.useEffect)(()=>{if(!l)return;let e=h.current.get(l);if(!e||!m.current)return;let t=m.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]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{p(e),setTimeout(()=>p(null),3e3)},[])}),(0,y.useEffect)(()=>{r&&r.motivation===`highlighting`&&e?.client.mark.submit({source:t,motivation:`highlighting`,selector:r.selector})},[r,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`highlight`,count:n.length,title:d(`title`)}),(0,R.jsxs)(`div`,{ref:m,className:`semiont-panel__content`,children:[o&&(0,R.jsx)(iY,{session:e,annotationType:`highlight`,isAssisting:i,progress:a,sourceLanguage:u}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:g.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:d(`noHighlights`)}):g.map(t=>(0,R.jsx)(hY,{session:e,highlight:t,isFocused:t.id===f,isHovered:t.id===l,ref:e=>_(t.id,e)},t.id))})]})]})}function _Y(e){let t=Z(Sm().activeSession$)?.client,[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!t||!e){a(!1);return}let n=!1;return a(!0),s(null),t.browse.resourceGraph(e).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e:Error(String(e))),a(!1))}),()=>{n=!0}},[t,e]),{graph:n,loading:i,error:o}}function vY({resourceId:e}){let t=(0,y.useRef)(null),n=(0,y.useRef)(null),{showLineNumbers:r}=vm(),{graph:i,loading:a,error:o}=_Y(e),s=i?JSON.stringify(i,null,2):``;return(0,y.useEffect)(()=>{if(!t.current||!s)return;let e=document.documentElement?.classList.contains(`dark`)??!1,i=[UU(),J.editable.of(!1),FE.readOnly.of(!0)];r&&i.push(ZM()),e?i.push(oW):(i.push(dF),i.push(eF(fF)));let a=new J({state:FE.create({doc:s,extensions:i}),parent:t.current});return n.current=a,()=>{a.destroy(),n.current=null}},[s,r]),(0,R.jsxs)(`div`,{className:`semiont-jsonld-panel`,children:[(0,R.jsxs)(`div`,{className:`semiont-jsonld-panel__header`,children:[(0,R.jsx)(`h3`,{className:`semiont-jsonld-panel__title`,children:`JSON-LD`}),(0,R.jsx)(`button`,{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s)}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-button semiont-button--icon`,title:`Copy to clipboard`,disabled:!i,children:`📋 Copy`})]}),a&&(0,R.jsx)(`p`,{className:`semiont-jsonld-panel__status`,role:`status`,children:`Loading JSON-LD…`}),o&&!a&&(0,R.jsx)(`p`,{className:`semiont-jsonld-panel__status semiont-jsonld-panel__status--error`,role:`alert`,children:`Failed to load JSON-LD.`}),(0,R.jsx)(`div`,{ref:t,className:`semiont-jsonld-panel__editor`})]})}function yY(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 bY(e){return e.motivation===`tagging`}function xY(e){if(!bY(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 SY(e){if(!bY(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 CY({session:e,reference:t,isFocused:n,isHovered:r=!1,onOpenResource:i,annotateMode:a=!0,isGenerating:o=!1,sparkle:s=!1,ref:c}){let l=ah(`ReferencesPanel`),u=e?.client,d=IF(e,t.id),f=Ar(t)||``,p=br(t.body),m=p?yr(t.body):null,h=yY(t),g=xr(t.target),_=vr(g),v=_r(g),y=_?`Fragment annotation`:v?`Image annotation`:`Annotation`,b=t,x=b._resolvedDocumentName,S=b._resolvedDocumentMediaType,C=DF(S),w=()=>{m&&i?.(m)},T=typeof t.target==`object`&&`source`in t.target?t.target.source:``,E=()=>{T&&m&&u&&u.bind.body(cr(T),t.id,[{op:`remove`,item:{type:`SpecificResource`,source:m,purpose:`linking`}}]).catch(e=>{u.bind.reportBodyError({resourceId:T,message:e instanceof Error?e.message:String(e)})})},D=()=>{e?.client.bind.initiate({annotationId:t.id,resourceId:cr(T),defaultTitle:f,entityTypes:h})},O=e=>{e.stopPropagation(),p?w():a&&D()},k=p||a;return(0,R.jsxs)(`div`,{ref:c,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`reference`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...d,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,R.jsxs)(`div`,{className:`semiont-reference-icon-group`,children:[(0,R.jsx)(`button`,{className:`semiont-reference-icon${k?` semiont-reference-icon--clickable`:``}${s?` annotation-sparkle`:``}`,title:l(p?`open`:a?`resolve`:`stub`),onClick:k?O:void 0,"data-generating":!p&&o?`true`:`false`,tabIndex:k?0:-1,children:p?`🔗`:`❓`}),a&&p&&(0,R.jsx)(`button`,{className:`semiont-reference-unlink`,title:l(`unlink`),onClick:e=>{e.stopPropagation(),E()},children:`⛓️‍💥`})]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__content`,children:[f&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`reference`,children:[`"`,f.substring(0,100),f.length>100?`...`:``,`"`]}),!f&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__meta`,children:!g&&x?l(`derived`):y}),x&&(0,R.jsx)(`div`,{className:`semiont-reference-link`,children:(0,R.jsxs)(`span`,{children:[`→ `,C,` `,x]})})]})]}),h.length>0&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__tags`,children:h.map((e,t)=>(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},t))}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function wY(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 TY({session:e,onOpenResource:t,resourceId:n,annotations:r=[],isAssisting:i,progress:a,annotateMode:o=!0,Link:s,routes:c,allEntityTypes:l,entityTypesError:u=null,generatingReferenceId:d,referencedBy:f=[],referencedByLoading:p=!1,referencedByError:m=null,onRetryReferencedBy:h,pendingAnnotation:g,scrollToAnnotationId:_,onScrollCompleted:v,hoveredAnnotationId:b,sparkleAnnotationIds:x,locale:S,sourceLanguage:C}){let w=ah(`ReferencesPanel`),T=ah(`AssistProgress`),[E,D]=(0,y.useState)([]),[O,k]=(0,y.useState)(null),[A,j]=(0,y.useState)([]),[M,ee]=(0,y.useState)(!1),[N,te]=(0,y.useState)(null),P=(0,y.useRef)(null),F=(0,y.useRef)(new Map),ne=(0,y.useMemo)(()=>[...r].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[r]),re=(0,y.useCallback)((e,t)=>{t?F.current.set(e,t):F.current.delete(e)},[]);(0,y.useEffect)(()=>{if(!_)return;let e=F.current.get(_);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`),v&&v()}else console.warn(`[ReferencesPanel] Element not found for scrollToAnnotationId:`,_)},[_]),(0,y.useEffect)(()=>{if(!b)return;let e=F.current.get(b);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`})}},[b]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{te(e),setTimeout(()=>te(null),3e3)},[])});let ie=()=>{k(null),e?.client.mark.requestAssist(`linking`,{entityTypes:E,includeDescriptiveReferences:M,language:S,sourceLanguage:C})},ae=(0,y.useRef)(!1);(0,y.useEffect)(()=>{if(i){ae.current=!1;return}!ae.current&&a?.completedItems&&(ae.current=!0,k(a.completedItems),D([]))},[i,a?.completedItems]);let oe=e=>{j(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,y.useEffect)(()=>{if(!g)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),j([]))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[g,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`reference`,count:r.length,title:w(`title`)}),g&&g.motivation===`linking`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`reference`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=wY(g.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:w(`fragmentSelected`)})()}),l.length>0&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`p`,{className:`semiont-form-field__label`,children:w(`entityTypesOptional`)}),(0,R.jsx)(`div`,{className:`semiont-tag-selector`,children:l.map(e=>(0,R.jsx)(`button`,{onClick:()=>oe(e),className:`semiont-tag-selector__item`,"data-selected":A.includes(e)?`true`:`false`,children:e},e))})]}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),j([])},className:`semiont-button semiont-button--secondary`,"data-type":`reference`,children:w(`cancel`)}),(0,R.jsxs)(`button`,{onClick:()=>{if(g){let t=A.join(`,`)||void 0;e?.client.mark.submit({source:n,motivation:`linking`,selector:g.selector,...t?{body:[{type:`TextualBody`,value:t,purpose:`tagging`}]}:{}}),j([])}},className:`semiont-button semiont-button--primary`,"data-type":`reference`,children:[`🔗 `,w(`createReference`)]})]})})]}),(0,R.jsxs)(`div`,{ref:P,className:`semiont-panel__content`,children:[o&&(0,R.jsx)(AU,{assistType:`reference`,title:w(`annotateReferences`),isAssisting:i,progress:a,progressProps:{onCancel:()=>e?.client.job.cancelRequest(`annotation`),onDismiss:()=>e?.client.mark.dismissProgress(),translations:rY(T,{found:e=>w(`found`,{count:e})})},form:(0,R.jsxs)(R.Fragment,{children:[O&&(0,R.jsx)(OU,{entries:O,formatFound:e=>w(`found`,{count:e})}),(0,R.jsxs)(`div`,{className:`semiont-assist-widget__entity-types`,children:[(0,R.jsx)(`p`,{className:`semiont-assist-widget__label`,children:w(`selectEntityTypes`)}),(0,R.jsx)(`div`,{className:`semiont-assist-widget__chips`,children:l.length>0?l.map(e=>(0,R.jsx)(`button`,{onClick:()=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":E.includes(e),"aria-label":`${E.includes(e)?w(`deselect`):w(`select`)} ${e}`,className:`semiont-chip semiont-chip--selectable`,"data-selected":E.includes(e),children:e},e)):(0,R.jsx)(`p`,{className:`semiont-assist-widget__no-types`,children:w(u?`entityTypesFailed`:`noEntityTypes`)})})]}),E.length>0&&(0,R.jsx)(`p`,{className:`semiont-assist-widget__count`,children:w(`typesSelected`,{count:E.length})}),(0,R.jsxs)(`div`,{className:`semiont-assist-widget__checkbox-group`,children:[(0,R.jsxs)(`label`,{className:`semiont-assist-widget__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>ee(e.target.checked),className:`semiont-assist-widget__checkbox`}),(0,R.jsx)(`span`,{children:w(`includeDescriptiveReferences`)})]}),(0,R.jsx)(`p`,{className:`semiont-assist-widget__checkbox-hint`,children:w(`descriptiveReferencesTooltip`)})]}),(0,R.jsxs)(`button`,{onClick:ie,disabled:E.length===0,title:w(`annotate`),className:`semiont-button`,"data-variant":`assist`,"data-type":`reference`,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:w(`annotate`)})]})]})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,R.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[w(`outgoingReferences`),` (`,ne.length,`)`]})}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:ne.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty-message`,children:w(`noReferences`)}):ne.map(n=>(0,R.jsx)(CY,{session:e,reference:n,isFocused:n.id===N,isHovered:n.id===b,onOpenResource:t,annotateMode:o,isGenerating:n.id===d,sparkle:x?.has(n.id)??!1,ref:e=>re(n.id,e)},n.id))})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,R.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[w(`incomingReferences`),` (`,f.length,`)`,p&&!m&&(0,R.jsxs)(`span`,{className:`semiont-panel__loading-indicator`,children:[`(`,w(`loading`),`)`]})]})}),m?(0,R.jsxs)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:[w(`incomingReferencesFailed`),h&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:h,className:`semiont-panel__inline-action`,children:w(`retry`)})]})]}):f.length>0?(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:f.map(e=>{let t=e.target.source;return(0,R.jsxs)(`div`,{className:`semiont-reference-item semiont-reference-item--incoming`,children:[(0,R.jsxs)(`div`,{className:`semiont-reference-item__header`,children:[(0,R.jsx)(`span`,{className:`semiont-reference-item__title`,children:e.resourceName||w(`untitledResource`)}),(0,R.jsx)(s,{href:c.resourceDetail(t),className:`semiont-reference-item__link`,title:w(`open`),children:`🔗`})]}),(0,R.jsxs)(`span`,{className:`semiont-reference-item__excerpt`,children:[`"`,e.target.selector?.exact||w(`noText`),`"`]})]},e.id)})}):(0,R.jsx)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:w(p?`loadingEllipsis`:`noIncomingReferences`)})]})]})]})}function EY({session:e,resourceId:t,documentEntityTypes:n,documentLocale:r,primaryMediaType:i,primaryByteSize:a,storageUri:o,isArchived:s=!1,dateCreated:c,dateModified:l,wasAttributedTo:u,wasDerivedFrom:d,generator:f,onGenerate:p,isGenerating:m=!1,generationProgress:h=null,generationOutcome:g=null,onDismissProgress:_}){let v=ah(`ResourceInfoPanel`),y=ah(`AssistProgress`),b=u?Array.isArray(u)?u:[u]:f?Array.isArray(f)?f:[f]:[];return(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__title`,children:v(`title`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`locale`)}),r?(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__value`,children:ri(r)}):(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__value semiont-resource-info-panel__value--empty`,children:v(`notSpecified`)})]}),(i||a!==void 0)&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`representation`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[i&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`mediaType`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:i})]}),a!==void 0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`byteSize`)}),(0,R.jsxs)(`span`,{className:`semiont-resource-info-panel__value`,children:[a.toLocaleString(),` bytes`]})]}),o&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`storageUri`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:o})]})]})]}),(c||l||b.length>0||d)&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`provenance`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[c&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`createdAt`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(c).toLocaleString()})]}),l&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`modifiedAt`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(l).toLocaleString()})]}),b.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`attributedTo`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:b.map(qJ).join(`, `)})]}),d&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`derivedFrom`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:(Array.isArray(d)?d:[d]).map((t,n)=>(0,R.jsx)(DY,{session:e,id:t,first:n===0},t))})]})]})]}),n.length>0&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`entityTypeTags`)}),(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__tag-list`,children:n.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},e))})]}),p&&(0,R.jsx)(AU,{assistType:`generation`,title:v(`generate`),isAssisting:m,progress:h,progressProps:{onCancel:()=>e?.client.job.cancelRequest(`generation`),..._?{onDismiss:_}:{},...g?{outcome:{label:g.resourceName,onOpen:()=>e?.client.browse.openResource(g.resourceId)},endedMessage:g.truncated?y(`codeCompleteGeneratedTruncated`):y(`codeCompleteGenerated`)}:{},translations:rY(y)},form:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:p,className:`semiont-resource-button semiont-resource-button--secondary`,children:[`✨ `,v(`generate`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`generateDescription`)})]})}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.yield.clone(),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`🔗 `,v(`clone`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`cloneDescription`)})]}),(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__action-section`,children:s?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.mark.unarchive(cr(t)),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`📤 `,v(`unarchive`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`unarchiveDescription`)})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.mark.archive(cr(t)),className:`semiont-resource-button semiont-resource-button--archive`,children:[`📦 `,v(`archive`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`archiveDescription`)})]})})]})}function DY({session:e,id:t,first:n}){let r=Z(e?e.client.browse.resource(cr(t)):null),i=r?Wc(r)?.name:void 0;return(0,R.jsxs)(`button`,{className:`semiont-resource-info-panel__link`,onClick:()=>e?.client.browse.openResource(cr(t)),children:[!n&&`, `,i??t]})}function OY({highlights:e,comments:t,assessments:n,references:r,tags:i}){let a=ah(`StatisticsPanel`),o=r.filter(e=>!br(e.body)).length,s=r.filter(e=>br(e.body)).length,c=new Map;r.forEach(e=>{yY(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,R.jsx)(`div`,{className:`semiont-statistics-panel`,children:(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__content`,children:[(0,R.jsx)(`h2`,{className:`semiont-statistics-panel__title`,children:a(`title`)}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__list`,children:[(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`highlights`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:e.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`comments`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:t.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`assessments`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:n.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`tags`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:i.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`references`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:r.length}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitems`,children:[(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`stub`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:o})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`resolved`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:s})]})]})]}),l.length>0&&(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__entity-types`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`entityTypes`)}),(0,R.jsx)(`div`,{className:`semiont-statistics-panel__entity-list`,children:l.map(([e,t])=>(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__entity-item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__entity-name`,children:e}),(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:t})]},e))})]})]})]})})}function kY({session:e,tag:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t),s=xY(t),c=SY(t),l=Z((0,y.useMemo)(()=>e?.client.browse.tagSchemas()??null,[e])),u=c&&l&&Uc(l)?l.value.find(e=>e.id===c)??null:null;return(0,R.jsxs)(`div`,{ref:i,onClick:()=>{e?.client.browse.click(t.id)},...a,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`tag`,"data-focused":n?`true`:`false`,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,R.jsx)(`span`,{className:`semiont-tag-badge`,"data-variant":`tag`,children:s}),u&&(0,R.jsx)(`span`,{className:`semiont-annotation-entry__meta`,children:u.name})]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`tag`,children:[`"`,o.substring(0,150),o.length>150?`...`:``,`"`]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function AY(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 jY({session:e,resourceId:t,annotations:n,annotateMode:r=!0,isAssisting:i=!1,progress:a,pendingAnnotation:o,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l,locale:u,sourceLanguage:d}){let f=ah(`TaggingPanel`),p=ah(`AssistProgress`),m=(0,y.useCallback)(()=>{e?.client.mark.dismissProgress()},[e]),h=Z((0,y.useMemo)(()=>e?.client.browse.tagSchemas()??null,[e])),g=h&&Uc(h)?h.value:void 0,_=g??[],v=g!==void 0&&g.length===0,[b,x]=(0,y.useState)(``),[S,C]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{!b&&_.length>0&&x(_[0].id)},[_,b]);let[w,T]=(0,y.useState)(null),E=(0,y.useRef)(null);XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{T(e),setTimeout(()=>T(null),3e3)},[])});let D=(0,y.useRef)(new Map),O=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),k=(0,y.useCallback)((e,t)=>{t?D.current.set(e,t):D.current.delete(e)},[]);(0,y.useEffect)(()=>{if(!s)return;let e=D.current.get(s);if(e&&E.current){let t=e.offsetTop,n=E.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;E.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,y.useEffect)(()=>{if(!l)return;let e=D.current.get(l);if(!e||!E.current)return;let t=E.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]);let A=_.find(e=>e.id===b),j=e=>{x(e),C(new Set)},M=e=>{let t=new Set(S);t.has(e)?t.delete(e):t.add(e),C(t)};return(0,y.useEffect)(()=>{if(!o)return;let t=t=>{t.key===`Escape`&&e?.client.mark.cancelPending()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[o,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`tag`,count:n.length,title:f(`title`)}),(0,R.jsxs)(`div`,{ref:E,className:`semiont-panel__content`,children:[o&&o.motivation===`tagging`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`tag`,children:[(0,R.jsx)(`h3`,{className:`semiont-annotation-prompt__title`,children:f(`createTagForSelection`)}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(0,R.jsx)(`p`,{className:`semiont-annotation-prompt__text`,children:(()=>{let e=AY(o.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()})}),v&&(0,R.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!v&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,R.jsx)(`select`,{value:b,onChange:e=>j(e.target.value),className:`semiont-select`,children:_.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),A&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategory`)}),(0,R.jsxs)(`select`,{className:`semiont-select`,onChange:n=>{n.target.value&&o&&e?.client.mark.submit({source:t,motivation:`tagging`,selector:o.selector,body:[{type:`TextualBody`,value:n.target.value,purpose:`tagging`},{type:`TextualBody`,value:b,purpose:`classifying`}]})},defaultValue:``,children:[(0,R.jsx)(`option`,{value:``,children:f(`chooseCategory`)}),A.tags.map(e=>(0,R.jsx)(`option`,{value:e.name,children:e.name},e.name))]})]}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,R.jsx)(`button`,{onClick:()=>e?.client.mark.cancelPending(),className:`semiont-button semiont-button--secondary`,"data-type":`tag`,children:f(`cancel`)})})]}),r&&(0,R.jsx)(AU,{assistType:`tag`,title:f(`annotateTags`),isAssisting:i,progress:a,progressProps:{onDismiss:m,translations:rY(p)},form:(0,R.jsxs)(R.Fragment,{children:[v&&(0,R.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!v&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,R.jsx)(`select`,{value:b,onChange:e=>j(e.target.value),className:`semiont-select`,children:_.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))}),A&&(0,R.jsx)(`p`,{className:`semiont-form__help`,children:A.description})]}),A&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategories`)}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`,marginBottom:`0.75rem`},children:[(0,R.jsx)(`button`,{onClick:()=>{A&&C(new Set(A.tags.map(e=>e.name)))},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`selectAll`)}),(0,R.jsx)(`button`,{onClick:()=>{C(new Set)},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`deselectAll`)})]}),(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`0.75rem`},children:A.tags.map(e=>(0,R.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,R.jsx)(`input`,{type:`checkbox`,id:`category-${e.name.replace(/\s+/g,`-`)}`,checked:S.has(e.name),onChange:()=>M(e.name),className:`semiont-checkbox`}),(0,R.jsxs)(`label`,{htmlFor:`category-${e.name.replace(/\s+/g,`-`)}`,className:`semiont-form__checkbox-label`,style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,R.jsx)(`span`,{style:{fontWeight:500},children:e.name}),(0,R.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-secondary)`},children:e.description})]})]},e.name))}),(0,R.jsx)(`p`,{className:`semiont-form__help`,children:f(`categoriesSelected`,{count:S.size})})]}),(0,R.jsxs)(`button`,{onClick:()=>{S.size>0&&(e?.client.mark.requestAssist(`tagging`,{schemaId:b,categories:Array.from(S),language:u,sourceLanguage:d}),C(new Set))},disabled:S.size===0||i,className:`semiont-button`,"data-variant":`assist`,"data-type":`tag`,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:f(`annotate`)})]})]})}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:O.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noTags`)}):O.map(t=>(0,R.jsx)(kY,{session:e,tag:t,isFocused:t.id===w,isHovered:t.id===l,ref:e=>k(t.id,e)},t.id))})]})]})}var MY=[`statistics`,`reference`,`highlight`,`assessment`,`comment`,`tag`];function NY(e){let t=ah(`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,y.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&&MY.includes(n)?n:e.initialTab||`statistics`});(0,y.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,y.useEffect)(()=>{e.initialTab&&e.initialTabGeneration!==void 0&&a(e.initialTab)},[e.initialTabGeneration]),(0,y.useEffect)(()=>{if(e.pendingAnnotation){let t=iT(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 e.annotationsError?(0,R.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,R.jsxs)(`p`,{className:`semiont-unified-panel__error`,children:[t(`annotationsFailed`),e.onRetryAnnotations&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:e.onRetryAnnotations,className:`semiont-panel__inline-action`,children:t(`retry`)})]})]})]}):(0,R.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,R.jsx)(`div`,{className:`semiont-unified-panel__tabs`,children:MY.map(n=>{if(n===`statistics`)return(0,R.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,R.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:`📊`})},n);let r=e.annotators[n];return r?(0,R.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,R.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:r.iconEmoji})},n):null})}),(0,R.jsx)(`div`,{className:`semiont-unified-panel__content`,children:(()=>{if(i===`statistics`)return(0,R.jsx)(OY,{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={session:e.session,resourceId:e.resourceId,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,R.jsx)(gY,{...s}):i===`reference`?(0,R.jsx)(TY,{session:s.session,onOpenResource:e.onOpenResource,resourceId:s.resourceId,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||[],entityTypesError:e.entityTypesError,generatingReferenceId:e.generatingReferenceId,referencedBy:e.referencedBy,referencedByLoading:e.referencedByLoading,referencedByError:e.referencedByError,onRetryReferencedBy:e.onRetryReferencedBy,sparkleAnnotationIds:e.sparkleAnnotationIds,Link:e.Link,routes:e.routes}):i===`assessment`?(0,R.jsx)(sY,{...s}):i===`comment`?(0,R.jsx)(pY,{...s}):i===`tag`?(0,R.jsx)(jY,{...s}):null})()})]})}function PY({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,y.useState)(!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`footer`,{role:`contentinfo`,className:`semiont-footer`,children:(0,R.jsx)(`div`,{className:`semiont-footer__container`,children:(0,R.jsxs)(`div`,{className:`semiont-footer__content`,children:[(0,R.jsx)(`div`,{className:`semiont-footer__copyright`,children:n(`copyright`,{year:new Date().getFullYear()})}),(0,R.jsxs)(`div`,{className:`semiont-footer__links`,children:[o&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e,{href:t.about?.()||`/about`,className:`semiont-footer__link`,children:n(`about`)}),(0,R.jsx)(e,{href:t.privacy?.()||`/privacy`,className:`semiont-footer__link`,children:n(`privacyPolicy`)}),r&&(0,R.jsx)(`button`,{onClick:()=>c(!0),className:`semiont-footer__link`,children:n(`cookiePreferences`)}),(0,R.jsx)(e,{href:t.terms?.()||`/terms`,className:`semiont-footer__link`,children:n(`termsOfService`)})]}),i&&(0,R.jsxs)(`button`,{onClick:i,className:`semiont-footer__link semiont-footer__link--keyboard`,children:[n(`keyboardShortcuts`),(0,R.jsx)(`kbd`,{className:`semiont-footer__kbd`,children:`?`})]}),(0,R.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-footer__link`,children:n(`sourceCode`)})]})]})})}),o&&r&&(0,R.jsx)(r,{isOpen:s,onClose:()=>c(!1)})]})}function FY({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,R.jsxs)(`nav`,{className:c,"aria-label":`Main navigation`,children:[(0,R.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,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,R.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,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,R.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 IY({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,y.useState)(!1),p=(0,y.useRef)(null),m=Sm(),h=()=>f(!d),g=()=>f(!1);return(0,y.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&g()};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,R.jsxs)(`div`,{className:`semiont-simple-nav`,children:[(0,R.jsxs)(`div`,{style:{position:`relative`},ref:i?p:void 0,children:[(0,R.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[i?(0,R.jsx)(`button`,{onClick:h,className:`semiont-nav-section__header-button`,"aria-expanded":d,"aria-haspopup":`true`,type:`button`,children:!a&&(0,R.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e})}):!a&&(0,R.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e}),(0,R.jsx)(`button`,{onClick:()=>m.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,R.jsx)(u,{}):(0,R.jsx)(l,{})})]}),d&&i&&!a&&(0,R.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:i(g)})]}),!a&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),a&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})})]})}function LY(){var e=[...arguments];return(0,y.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var RY=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function zY(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function BY(e){return`nodeType`in e}function VY(e){return e?zY(e)?e:BY(e)?e.ownerDocument?.defaultView??window:window:window}function HY(e){let{Document:t}=VY(e);return e instanceof t}function UY(e){return!zY(e)&&e instanceof VY(e).HTMLElement}function WY(e){return e instanceof VY(e).SVGElement}function GY(e){return e?zY(e)?e.document:BY(e)?HY(e)?e:UY(e)||WY(e)?e.ownerDocument:document:document:document}var KY=RY?y.useLayoutEffect:y.useEffect;function qY(e){let t=(0,y.useRef)(e);return KY(()=>{t.current=e}),(0,y.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function JY(){let e=(0,y.useRef)(null);return[(0,y.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,y.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function YY(e,t){t===void 0&&(t=[e]);let n=(0,y.useRef)(e);return KY(()=>{n.current!==e&&(n.current=e)},t),n}function XY(e,t){let n=(0,y.useRef)();return(0,y.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ZY(e){let t=qY(e),n=(0,y.useRef)(null);return[n,(0,y.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function QY(e){let t=(0,y.useRef)();return(0,y.useEffect)(()=>{t.current=e},[e]),t.current}var $Y={};function eX(e,t){return(0,y.useMemo)(()=>{if(t)return t;let n=$Y[e]==null?0:$Y[e]+1;return $Y[e]=n,e+`-`+n},[e,t])}function tX(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 nX=tX(1),rX=tX(-1);function iX(e){return`clientX`in e&&`clientY`in e}function aX(e){if(!e)return!1;let{KeyboardEvent:t}=VY(e.target);return t&&e instanceof t}function oX(e){if(!e)return!1;let{TouchEvent:t}=VY(e.target);return t&&e instanceof t}function sX(e){if(oX(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return iX(e)?{x:e.clientX,y:e.clientY}:null}var cX=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[cX.Translate.toString(e),cX.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),lX=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function uX(e){return e.matches(lX)?e:e.querySelector(lX)}var dX={display:`none`};function fX(e){let{id:t,value:n}=e;return y.createElement(`div`,{id:t,style:dX},n)}function pX(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return y.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 mX(){let[e,t]=(0,y.useState)(``);return{announce:(0,y.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var hX=(0,y.createContext)(null);function gX(e){let t=(0,y.useContext)(hX);(0,y.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function _X(){let[e]=(0,y.useState)(()=>new Set),t=(0,y.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,y.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var vX={draggable:`
134
+ `)),[]});var CK=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(CK||{});function wK(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function TK(e,t,n,r){let[i,a]=(0,y.useState)(n),{hasFlag:o,addFlag:s,removeFlag:c}=SK(e&&i?3:0),l=(0,y.useRef)(!1),u=(0,y.useRef)(!1);return yW(()=>{var i;if(e){if(n&&a(!0),!t){n&&s(3);return}return(i=r?.start)==null||i.call(r,n),EK(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&&kK(t)||(l.current=!1,c(7),n||a(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,vW()]),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 EK(e,{prepare:t,run:n,done:r,inFlight:i}){let a=_W();return OK(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(DK(e,r))})}),a.dispose}function DK(e,t){let n=_W();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 OK(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 kK(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}function AK(e,t){let n=(0,y.useRef)([]),r=xW(e);(0,y.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 jK=(0,y.createContext)(null);jK.displayName=`OpenClosedContext`;var MK=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(MK||{});function NK(){return(0,y.useContext)(jK)}function PK({value:e,children:t}){return y.createElement(jK.Provider,{value:e},t)}function FK({children:e}){return y.createElement(jK.Provider,{value:null},e)}function IK(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var LK=[];IK(()=>{function e(e){if(!YW(e.target)||e.target===document.body||LK[0]===e.target)return;let t=e.target;t=t.closest(UG),LK.unshift(t??e.target),LK=LK.filter(e=>e!=null&&e.isConnected),LK.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 RK(e){let t=xW(e),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>(n.current=!1,()=>{n.current=!0,gW(()=>{n.current&&t()})}),[t])}function zK(){let e=typeof document>`u`;return`useSyncExternalStore`in y&&(e=>e.useSyncExternalStore)(y)(()=>()=>{},()=>!1,()=>!e)}function BK(){let e=zK(),[t,n]=y.useState(dW.isHandoffComplete);return t&&dW.isHandoffComplete===!1&&n(!1),y.useEffect(()=>{t!==!0&&n(!0)},[t]),y.useEffect(()=>dW.handoff(),[]),!e&&t}var VK=(0,y.createContext)(!1);function HK(){return(0,y.useContext)(VK)}function UK(e){return y.createElement(VK.Provider,{value:e.force},e.children)}function WK(e){let t=HK(),n=(0,y.useContext)(YK),[r,i]=(0,y.useState)(()=>{if(!t&&n!==null)return n.current??null;if(dW.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,y.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,y.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var GK=y.Fragment,KK=FW(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,y.useRef)(null),a=tG(eG(e=>{i.current=e}),t),o=dK(i.current),s=WK(n??o),c=(0,y.useContext)(ZK),l=vW(),u=BK(),d=kW();return RK(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!u?null:(0,lu.createPortal)(y.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{l.dispose(),c&&e&&l.add(c.register(e))}},d({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:GK,name:`Portal`})),s)});function qK(e,t){let n=tG(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=kW();return r?y.createElement(KK,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:GK,name:`Portal`})}var JK=y.Fragment,YK=(0,y.createContext)(null);function XK(e,t){let{target:n,...r}=e,i={ref:tG(t)},a=kW();return y.createElement(YK.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:JK,name:`Popover.Group`}))}var ZK=(0,y.createContext)(null);function QK(){let e=(0,y.useContext)(ZK),t=(0,y.useRef)([]),n=xW(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=xW(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,y.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,y.useMemo)(()=>function({children:e}){return y.createElement(ZK.Provider,{value:i},e)},[i])]}var $K=FW(qK),eq=FW(XK),tq=Object.assign($K,{Group:eq});function nq(e,t=typeof document<`u`?document.defaultView:null,n){let r=IG(e,`escape`);fK(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===lG.Escape&&n(e))})}function rq(){let[e]=(0,y.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,y.useState)(e?.matches??!1);return yW(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function iq({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=xW(()=>{let r=fW(n),i=[];for(let t of e)t!==null&&(qW(t)?i.push(t):`current`in t&&qW(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&&qW(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:xW(e=>r().some(t=>t.contains(e)))}}var aq=(0,y.createContext)(null);function oq({children:e,node:t}){let[n,r]=(0,y.useState)(null),i=sq(t??n);return y.createElement(aq.Provider,{value:i},e,i===null&&y.createElement(GW,{features:UW.Hidden,ref:e=>{if(e){for(let t of fW(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&qW(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function sq(e=null){return(0,y.useContext)(aq)??e}function cq(){let e=(0,y.useRef)(!1);return yW(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var lq=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(lq||{});function uq(){let e=(0,y.useRef)(0);return cK(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function dq(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)qW(n.current)&&t.add(n.current);return t}var fq=`div`,pq=(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))(pq||{});function mq(e,t){let n=(0,y.useRef)(null),r=tG(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;BK()||(s=0);let l=dK(n.current);vq(s,{ownerDocument:l});let u=yq(s,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});bq(s,{ownerDocument:l,container:n,containers:o,previousActiveElement:u});let d=uq(),f=xW(e=>{if(!JW(n.current))return;let t=n.current;(e=>e())(()=>{EW(d.current,{[lq.Forwards]:()=>{rK(t,GG.First,{skipElements:[e.relatedTarget,a]})},[lq.Backwards]:()=>{rK(t,GG.Last,{skipElements:[e.relatedTarget,a]})}})})}),p=IG(!!(s&2),`focus-trap#tab-lock`),m=vW(),h=(0,y.useRef)(!1),g={ref:r,onKeyDown(e){e.key==`Tab`&&(h.current=!0,m.requestAnimationFrame(()=>{h.current=!1}))},onBlur(e){if(!(s&4))return;let t=dq(o);JW(n.current)&&t.add(n.current);let r=e.relatedTarget;YW(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(xq(t,r)||(h.current?rK(n.current,EW(d.current,{[lq.Forwards]:()=>GG.Next,[lq.Backwards]:()=>GG.Previous})|GG.WrapAround,{relativeTo:e.target}):YW(e.target)&&$G(e.target)))}},_=kW();return y.createElement(y.Fragment,null,p&&y.createElement(GW,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:UW.Focusable}),_({ourProps:g,theirProps:c,defaultTag:fq,name:`FocusTrap`}),p&&y.createElement(GW,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:f,features:UW.Focusable}))}var hq=FW(mq),gq=Object.assign(hq,{features:pq});function _q(e=!0){let t=(0,y.useRef)(LK.slice());return AK(([e],[n])=>{n===!0&&e===!1&&gW(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=LK.slice())},[e,LK,t]),xW(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function vq(e,{ownerDocument:t}){let n=!!(e&8),r=_q(n);AK(()=>{n||hW(t?.body)&&$G(r())},[n]),RK(()=>{n&&$G(r())})}function yq(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,y.useRef)(null),o=IG(!!(e&1),`focus-trap#initial-focus`),s=cq();return AK(()=>{if(e===0)return;if(!o){i!=null&&i.current&&$G(i.current);return}let c=n.current;c&&gW(()=>{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)$G(r.current);else{if(e&16){if(rK(c,GG.First|GG.AutoFocus)!==KG.Error)return}else if(rK(c,GG.First)!==KG.Error)return;if(i!=null&&i.current&&($G(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 bq(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=cq(),o=!!(e&4);fK(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=dq(r);JW(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;JW(c)?xq(t,c)?(i.current=c,$G(c)):(e.preventDefault(),e.stopPropagation(),$G(s)):$G(i.current)},!0)}function xq(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function Sq(e){return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!BW(e.as??Aq)||y.Children.count(e.children)===1}var Cq=(0,y.createContext)(null);Cq.displayName=`TransitionContext`;var wq=(e=>(e.Visible=`visible`,e.Hidden=`hidden`,e))(wq||{});function Tq(){let e=(0,y.useContext)(Cq);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}function Eq(){let e=(0,y.useContext)(Dq);if(e===null)throw Error(`A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.`);return e}var Dq=(0,y.createContext)(null);Dq.displayName=`NestingContext`;function Oq(e){return`children`in e?Oq(e.children):e.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e===`visible`).length>0}function kq(e,t){let n=bW(e),r=(0,y.useRef)([]),i=cq(),a=vW(),o=xW((e,t=OW.Hidden)=>{let o=r.current.findIndex(({el:t})=>t===e);o!==-1&&(EW(t,{[OW.Unmount](){r.current.splice(o,1)},[OW.Hidden](){r.current[o].state=`hidden`}}),a.microTask(()=>{var e;!Oq(r)&&i.current&&((e=n.current)==null||e.call(n))}))}),s=xW(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,OW.Unmount)}),c=(0,y.useRef)([]),l=(0,y.useRef)(Promise.resolve()),u=(0,y.useRef)({enter:[],leave:[]}),d=xW((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=xW((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,y.useMemo)(()=>({children:r,register:s,unregister:o,onStart:d,onStop:f,wait:l,chains:u}),[s,o,r,d,f,u,l])}var Aq=y.Fragment,jq=DW.RenderStrategy;function Mq(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:m,...h}=e,[g,_]=(0,y.useState)(null),v=(0,y.useRef)(null),b=Sq(e),x=tG(...b?[v,t,_]:t===null?[]:[t]),S=(n=h.unmount)==null||n?OW.Unmount:OW.Hidden,{show:C,appear:w,initial:T}=Tq(),[E,D]=(0,y.useState)(C?`visible`:`hidden`),O=Eq(),{register:k,unregister:A}=O;yW(()=>k(v),[k,v]),yW(()=>{if(S===OW.Hidden&&v.current){if(C&&E!==`visible`){D(`visible`);return}return EW(E,{hidden:()=>A(v),visible:()=>k(v)})}},[E,v,k,A,C,S]);let j=BK();yW(()=>{if(b&&j&&E===`visible`&&v.current===null)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,E,j,b]);let M=T&&!w,ee=w&&C&&T,N=(0,y.useRef)(!1),te=kq(()=>{N.current||(D(`hidden`),A(v))},O),P=xW(e=>{N.current=!0;let t=e?`enter`:`leave`;te.onStart(v,t,e=>{e===`enter`?i?.():e===`leave`&&o?.()})}),F=xW(e=>{let t=e?`enter`:`leave`;N.current=!1,te.onStop(v,t,e=>{e===`enter`?a?.():e===`leave`&&s?.()}),t===`leave`&&!Oq(te)&&(D(`hidden`),A(v))});(0,y.useEffect)(()=>{b&&r||(P(C),F(C))},[C,b,r]);let[,ne]=TK(!(!r||!b||!j||M),g,C,{start:P,end:F}),re=IW({ref:x,className:TW(h.className,ee&&c,ee&&l,ne.enter&&c,ne.enter&&ne.closed&&l,ne.enter&&!ne.closed&&u,ne.leave&&f,ne.leave&&!ne.closed&&p,ne.leave&&ne.closed&&m,!ne.transition&&C&&d)?.trim()||void 0,...wK(ne)}),ie=0;E===`visible`&&(ie|=MK.Open),E===`hidden`&&(ie|=MK.Closed),C&&E===`hidden`&&(ie|=MK.Opening),!C&&E===`visible`&&(ie|=MK.Closing);let ae=kW();return y.createElement(Dq.Provider,{value:te},y.createElement(PK,{value:ie},ae({ourProps:re,theirProps:h,defaultTag:Aq,features:jq,visible:E===`visible`,name:`Transition.Child`})))}function Nq(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=(0,y.useRef)(null),s=tG(...Sq(e)?[o,t]:t===null?[]:[t]);BK();let c=NK();if(n===void 0&&c!==null&&(n=(c&MK.Open)===MK.Open),n===void 0)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,u]=(0,y.useState)(n?`visible`:`hidden`),d=kq(()=>{n||u(`hidden`)}),[f,p]=(0,y.useState)(!0),m=(0,y.useRef)([n]);yW(()=>{f!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),p(!1))},[m,n]);let h=(0,y.useMemo)(()=>({show:n,appear:r,initial:f}),[n,r,f]);yW(()=>{n?u(`visible`):!Oq(d)&&o.current!==null&&u(`hidden`)},[n,d]);let g={unmount:i},_=xW(()=>{var t;f&&p(!1),(t=e.beforeEnter)==null||t.call(e)}),v=xW(()=>{var t;f&&p(!1),(t=e.beforeLeave)==null||t.call(e)}),b=kW();return y.createElement(Dq.Provider,{value:d},y.createElement(Cq.Provider,{value:h},b({ourProps:{...g,as:y.Fragment,children:y.createElement(Iq,{ref:s,...g,...a,beforeEnter:_,beforeLeave:v})},theirProps:{},defaultTag:y.Fragment,features:jq,visible:l===`visible`,name:`Transition`})))}function Pq(e,t){let n=(0,y.useContext)(Cq)!==null,r=NK()!==null;return y.createElement(y.Fragment,null,!n&&r?y.createElement(Fq,{ref:t,...e}):y.createElement(Iq,{ref:t,...e}))}var Fq=FW(Nq),Iq=FW(Mq),Lq=FW(Pq),Rq=Object.assign(Fq,{Child:Lq,Root:Fq}),zq=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(zq||{}),Bq=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(Bq||{}),Vq={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Hq=(0,y.createContext)(null);Hq.displayName=`DialogContext`;function Uq(e){let t=(0,y.useContext)(Hq);if(t===null){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Uq),t}return t}function Wq(e,t){return EW(t.type,Vq,e,t)}var Gq=FW(function(e,t){let n=(0,y.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,y.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=NK();i===void 0&&p!==null&&(i=(p&MK.Open)===MK.Open);let m=(0,y.useRef)(null),h=tG(m,t),g=dK(m.current),_=+!i,[v,b]=(0,y.useReducer)(Wq,{titleId:null,descriptionId:null,panelRef:(0,y.createRef)()}),x=xW(()=>a(!1)),S=xW(e=>b({type:0,id:e})),C=BK()?_===0:!1,[w,T]=QK(),E={get current(){return v.panelRef.current??m.current}},D=sq(),{resolveContainers:O}=iq({mainTreeNode:D,portals:w,defaultContainers:[E]}),k=p!==null&&(p&MK.Closing)===MK.Closing;VG(l||k?!1:C,{allowed:xW(()=>[m.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:xW(()=>[D?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let A=NG.get(null);yW(()=>{if(C)return A.actions.push(r),()=>A.actions.pop(r)},[A,r,C]);let j=PG(A,(0,y.useCallback)(e=>A.selectors.isTop(e,r),[A,r]));uK(j,O,e=>{e.preventDefault(),x()}),nq(j,g?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),x()}),xK(l||k?!1:C,g,O),HG(C,m,x);let[M,ee]=iG(),N=(0,y.useMemo)(()=>[{dialogState:_,close:x,setTitleId:S,unmount:u},v],[_,x,S,u,v]),te=SW({open:_===0}),P={ref:h,id:r,role:s,tabIndex:-1,"aria-modal":l?void 0:_===0||void 0,"aria-labelledby":v.titleId,"aria-describedby":M,unmount:u},F=!rq(),ne=pq.None;C&&!l&&(ne|=pq.RestoreFocus,ne|=pq.TabLock,c&&(ne|=pq.AutoFocus),F&&(ne|=pq.InitialFocus));let re=kW();return y.createElement(FK,null,y.createElement(UK,{force:!0},y.createElement(tq,null,y.createElement(Hq.Provider,{value:N},y.createElement(eq,{target:m},y.createElement(UK,{force:!1},y.createElement(ee,{slot:te},y.createElement(T,null,y.createElement(gq,{initialFocus:o,initialFocusFallback:m,containers:O,features:ne},y.createElement(dG,{value:x},re({ourProps:P,theirProps:d,slot:te,defaultTag:Kq,features:qq,visible:_===0,name:`Dialog`})))))))))))}),Kq=`div`,qq=DW.RenderStrategy|DW.Static;function Jq(e,t){let{transition:n=!1,open:r,...i}=e,a=NK(),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?y.createElement(oq,null,y.createElement(Rq,{show:r,transition:n,unmount:i.unmount},y.createElement(Gq,{ref:t,...i}))):y.createElement(oq,null,y.createElement(Gq,{ref:t,open:r,...i}))}var Yq=`div`;function Xq(e,t){let n=(0,y.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=Uq(`Dialog.Panel`),l=tG(t,c.panelRef),u=SW({open:o===0}),d={ref:l,id:r,onClick:xW(e=>{e.stopPropagation()})},f=i?Lq:y.Fragment,p=i?{unmount:s}:{},m=kW();return y.createElement(f,{...p},m({ourProps:d,theirProps:a,slot:u,defaultTag:Yq,name:`Dialog.Panel`}))}var Zq=`div`;function Qq(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=Uq(`Dialog.Backdrop`),o=SW({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?Lq:y.Fragment,l=n?{unmount:a}:{},u=kW();return y.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:Zq,name:`Dialog.Backdrop`}))}var $q=`h2`;function eJ(e,t){let n=(0,y.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=Uq(`Dialog.Title`),s=tG(t);(0,y.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=SW({open:a===0}),l={ref:s,id:r};return kW()({ourProps:l,theirProps:i,slot:c,defaultTag:$q,name:`Dialog.Title`})}var tJ=FW(Jq),nJ=FW(Xq);FW(Qq);var rJ=FW(eJ),iJ=Object.assign(tJ,{Panel:nJ,Title:rJ,Description:cG});function aJ({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,R.jsx)(Rq,{appear:!0,show:r,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-popup-overlay`,onClose:n,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-popup-backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-popup-container`,children:(0,R.jsx)(Lq,{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,R.jsx)(nJ,{className:`semiont-popup-panel`,style:s,"data-annotation-ui":!0,"data-wide":i?`true`:`false`,children:(0,R.jsx)(R.Fragment,{children:e})})})})]})})}function oJ(e){return Sr(e)?{stroke:`rgb(250, 204, 21)`,fill:`rgba(250, 204, 21, 0.2)`}:Cr(e)?{stroke:`rgb(59, 130, 246)`,fill:`rgba(59, 130, 246, 0.2)`}:wr(e)?{stroke:`rgb(239, 68, 68)`,fill:`rgba(239, 68, 68, 0.2)`}:Tr(e)?{stroke:`rgb(255, 255, 255)`,fill:`rgba(255, 255, 255, 0.2)`}:Er(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 sJ(e){return Tr(e)?`Comment`:Sr(e)?`Highlight`:wr(e)?`Assessment`:Er(e)?`Tag`:Or(e)?`Resolved Reference`:Cr(e)?`Unresolved Reference`:`Annotation`}function cJ({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,y.useMemo)(()=>Yl(e=>a?.client.beckon.hover(e),c),[a,c]);return(0,R.jsx)(`svg`,{className:`semiont-annotation-overlay`,style:{width:r,height:i},children:e.map(e=>{if(typeof e.target==`string`)return null;let t=_r(e.target.selector);if(!t)return null;let n=si(t.value);if(!n)return null;let r=e.id===o,i=e.id===s,c=oJ(e),p=Cr(e),m=p&&br(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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},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,R.jsxs)(`g`,{children:[(0,R.jsx)(`title`,{children:sJ(e)}),(0,R.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:t=>a?.client.browse.click(e.id,t.currentTarget.getBoundingClientRect()),onMouseEnter:()=>d(e.id),onMouseLeave:f}),h&&(0,R.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,t.currentTarget.getBoundingClientRect())},onMouseEnter:()=>d(e.id),onMouseLeave:f,children:h})]},e.id)}default:return null}})})}function lJ(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 uJ({imageUrl:e,resourceUri:t,existingAnnotations:n=[],drawingMode:r,selectedMotivation:i,session:a,hoveredAnnotationId:o,selectedAnnotationId:s}){let{hoverDelayMs:c}=LF(),l=(0,y.useRef)(null),u=(0,y.useRef)(null),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=new Image;t.onload=()=>{f({width:t.naturalWidth,height:t.naturalHeight})},t.src=e},[e]),(0,y.useEffect)(()=>{let e=()=>{u.current&&m({width:u.current.clientWidth,height:u.current.clientHeight})};e();let t=null;try{t=new ResizeObserver(e),u.current&&t.observe(u.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 S=(0,y.useCallback)(e=>{if(!u.current)return null;let t=u.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},[]),C=(0,y.useCallback)(e=>{if(!r)return;let t=S(e);t&&(g(!0),v(t),x(t))},[r,S]),w=(0,y.useCallback)(e=>{if(!h||!_)return;let t=S(e);t&&x(t)},[h,_,S]),T=(0,y.useCallback)(e=>{if(!h||!_||!r)return;let o=S(e);if(!o||!p||!d)return;if(Math.sqrt((o.x-_.x)**2+(o.y-_.y)**2)<10){if(n.length>0){let e,t=n.find(t=>{if(typeof t.target==`string`)return!1;let n=t.target.selector;if(!n)return!1;let r=(Array.isArray(n)?n:[n]).find(e=>e.type===`SvgSelector`);if(!r||r.type!==`SvgSelector`)return!1;let i=si(r.value);if(!i)return!1;let a=p.width/d.width,s=p.height/d.height;if(i.type===`rect`){let{x:t,y:n,width:r,height:c}=i.data,l=t*a,d=n*s,f=r*a,p=c*s,m=o.x>=l&&o.x<=l+f&&o.y>=d&&o.y<=d+p;return m&&u.current&&(e=ge(u.current.getBoundingClientRect(),l,d,f,p)),m}return!1});if(t){a?.client.browse.click(t.id,e),g(!1),v(null),x(null);return}}g(!1),v(null),x(null);return}let s;switch(r){case`circle`:{let e=Math.sqrt((o.x-_.x)**2+(o.y-_.y)**2);s=oi(_,e);break}case`polygon`:{let e=(_.x+o.x)/2,t=(_.y+o.y)/2,n=Math.abs(o.x-_.x)/2,r=Math.abs(o.y-_.y)/2;s=ai([{x:e,y:t-r},{x:e+n,y:t},{x:e,y:t+r},{x:e-n,y:t}]);break}default:s=ii(_,o)}let c=ci(s,p.width,p.height,d.width,d.height);a&&i&&a.client.mark.request(cr(t),{type:`SvgSelector`,value:c},i),g(!1),v(null),x(null)},[h,_,r,p,d,S,i,n]),E=(0,y.useCallback)(()=>{h&&(g(!1),v(null),x(null))},[h]);return(0,R.jsxs)(`div`,{ref:l,className:`semiont-svg-drawing-canvas`,onMouseDown:C,onMouseMove:w,onMouseUp:T,onMouseLeave:E,"data-drawing-mode":r||`none`,children:[(0,R.jsx)(`img`,{ref:u,src:e,alt:`Annotatable content`,className:`semiont-svg-drawing-canvas__image`,draggable:!1}),p&&d&&(0,R.jsx)(`div`,{className:`semiont-svg-drawing-canvas__overlay-container`,children:(0,R.jsxs)(`div`,{className:`semiont-svg-drawing-canvas__overlay`,style:{width:p.width,height:p.height},children:[(0,R.jsx)(cJ,{annotations:n,imageWidth:d.width,imageHeight:d.height,displayWidth:p.width,displayHeight:p.height,hoverDelayMs:c,...a&&{session:a},...o!==void 0&&{hoveredAnnotationId:o},...s!==void 0&&{selectedAnnotationId:s}}),h&&_&&b&&(()=>{let e=lJ(i||null);return(0,R.jsxs)(`svg`,{className:`semiont-svg-drawing-canvas__preview`,style:{width:p.width,height:p.height},children:[r===`circle`&&(()=>{let t=Math.sqrt((b.x-_.x)**2+(b.y-_.y)**2);return(0,R.jsx)(`circle`,{cx:_.x,cy:_.y,r:t,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`polygon`&&(()=>{let t=(_.x+b.x)/2,n=(_.y+b.y)/2,r=Math.abs(b.x-_.x)/2,i=Math.abs(b.y-_.y)/2,a=[{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(` `);return(0,R.jsx)(`polygon`,{points:a,fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})})(),r===`rectangle`&&(0,R.jsx)(`rect`,{x:Math.min(_.x,b.x),y:Math.min(_.y,b.y),width:Math.abs(b.x-_.x),height:Math.abs(b.y-_.y),fill:e.fill,stroke:e.stroke,strokeWidth:`2`,strokeDasharray:`5,5`})]})})()]})})]})}var dJ=[{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 fJ({isOpen:e,onClose:t}){let n=ah(`KeyboardShortcuts`),r=typeof window<`u`&&navigator.platform.toUpperCase().indexOf(`MAC`)>=0;return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:t,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--large`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__header`,children:(0,R.jsxs)(`div`,{className:`semiont-modal__header-content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title`,children:n(`title`)}),(0,R.jsx)(`button`,{onClick:t,"aria-label":n(`closeDialog`),className:`semiont-modal__close`,children:(0,R.jsx)(`svg`,{className:`semiont-modal__close-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}),(0,R.jsxs)(`div`,{className:`semiont-modal__body`,children:[(0,R.jsx)(`div`,{className:`semiont-shortcuts`,children:dJ.map(e=>(0,R.jsxs)(`div`,{className:`semiont-shortcuts__group`,children:[(0,R.jsx)(`h3`,{className:`semiont-shortcuts__group-title`,children:n(e.titleKey)}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__list`,children:e.shortcuts.map((e,t)=>(0,R.jsxs)(`div`,{className:`semiont-shortcuts__item`,children:[(0,R.jsx)(`span`,{className:`semiont-shortcuts__description`,children:n(e.descriptionKey)}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__keys`,children:e.keys.map((e,t)=>e.includes(`⌘`)&&!r||e.includes(`Ctrl`)&&r?null:(0,R.jsxs)(y.Fragment,{children:[t>0&&!e.includes(`⌘`)&&!e.includes(`Ctrl`)&&(0,R.jsx)(`span`,{className:`semiont-shortcuts__separator`,children:n(`or`)}),(0,R.jsx)(`kbd`,{className:`semiont-shortcuts__key`,children:e})]},t))})]},t))})]},e.titleKey))}),(0,R.jsx)(`div`,{className:`semiont-shortcuts__note`,children:(0,R.jsx)(`p`,{className:`semiont-shortcuts__note-text`,children:n(r?`macNote`:`windowsNote`)})})]}),(0,R.jsx)(`div`,{className:`semiont-modal__footer`,children:(0,R.jsxs)(`div`,{className:`semiont-modal__footer-content`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__hint`,children:n(`footerHint`,{key:`?`}).split(`?`).map((e,t,n)=>(0,R.jsxs)(y.Fragment,{children:[e,t<n.length-1&&(0,R.jsx)(`kbd`,{className:`semiont-modal__hint-key`,children:`?`})]},t))}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-button semiont-button--secondary`,children:n(`close`)})]})})]})})})})]})})}function pJ(){let e=Z(Sm().activeSignals$),t=Z(e?.permissionDeniedAt$)??null,n=Z(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,R.jsx)(Rq,{appear:!0,show:i,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-modal__icon`,children:(0,R.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,R.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,R.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Access Denied`}),(0,R.jsx)(`p`,{className:`semiont-modal__description`,children:a})]}),(0,R.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,R.jsx)(`p`,{style:{color:`var(--semiont-text-secondary)`,marginBottom:`0.5rem`},children:`This could be because:`}),(0,R.jsxs)(`ul`,{style:{listStyle:`disc`,listStylePosition:`inside`,color:`var(--semiont-text-tertiary)`,display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,R.jsx)(`li`,{children:`You don't have the required permissions`}),(0,R.jsx)(`li`,{children:`The resource is restricted to specific users or teams`}),(0,R.jsx)(`li`,{children:`Your account type doesn't include this feature`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--primary semiont-button--flex`,children:`Go Back`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{r(),window.location.href=`/`},className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`})]}),(0,R.jsx)(`div`,{className:`semiont-modal__actions`,style:{marginTop:`0.5rem`,paddingTop:`0.5rem`,borderTop:`1px solid var(--semiont-border-primary)`},children:(0,R.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 mJ(){let e=Z(Sm().activeSignals$),t=Z(e?.sessionExpiredAt$)??null,n=Z(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,R.jsx)(Rq,{appear:!0,show:i,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-modal`,onClose:o,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-modal__container`,children:(0,R.jsx)(`div`,{className:`semiont-modal__wrapper`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-modal__panel semiont-modal__panel--medium`,children:[(0,R.jsx)(`div`,{className:`semiont-modal__icon-wrapper`,children:(0,R.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,R.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,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})})}),(0,R.jsxs)(`div`,{className:`semiont-modal__content`,children:[(0,R.jsx)(rJ,{className:`semiont-modal__title semiont-modal__title--centered`,children:`Session Expired`}),(0,R.jsx)(`p`,{className:`semiont-modal__description`,children:n??`Your session has expired for security reasons. Please sign in again to continue working.`})]}),(0,R.jsxs)(`div`,{className:`semiont-modal__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:o,className:`semiont-button--secondary semiont-button--flex`,children:`Go to Home`}),(0,R.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button--primary semiont-button--flex`,children:`Sign In Again`})]})]})})})})]})})}function hJ(e,t,n,r){if(!t||n<0||r<=n||r>e.length)return null;let i=di(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 gJ(e,t){let n=e.indexOf(t);return n===-1?null:{start:n,end:n+t.length}}var _J=new Set;function vJ(e,t){if(!e)return[{exact:``,start:0,end:0}];let n=t.map(t=>{let n=xr(t.target),r=gr(n),i=n?jr(n):null,a=Yr(e,{...r?{position:{start:r.start,end:r.end}}:{},...i?{quote:{exact:i.exact,...i.prefix===void 0?{}:{prefix:i.prefix},...i.suffix===void 0?{}:{suffix:i.suffix}}}:{}});return a&&a.confidence!==`high`&&yJ(t.id,a.strategy,a.confidence),{annotation:t,start:a?.start??0,end:a?.end??0,...a?.strategy?{strategy:a.strategy}:{},...a?.confidence?{confidence:a.confidence}:{}}}).filter(t=>t.start>=0&&t.end<=e.length&&t.start<t.end).sort((e,t)=>e.start-t.start);if(n.length===0)return[{exact:e,start:0,end:e.length}];let r=[],i=0;for(let{annotation:t,start:a,end:o,strategy:s,confidence:c}of n)a<i||(a>i&&r.push({exact:e.slice(i,a),start:i,end:a}),r.push({exact:e.slice(a,o),annotation:t,start:a,end:o,...s?{strategy:s}:{},...c?{confidence:c}:{}}),i=o);return i<e.length&&r.push({exact:e.slice(i),start:i,end:e.length}),r}function yJ(e,t,n){_J.has(e)||(_J.add(e),console.warn(`[segmentTextWithAnnotations] annotation anchored via degraded strategy`,{annotationId:e,strategy:t,confidence:n}))}function bJ(){let e=ah(`PdfViewer`);return(0,R.jsx)(R.Fragment,{children:e(`viewerLoading`)})}var xJ=(0,y.lazy)(()=>s(()=>import(`./PdfAnnotationCanvas.client-LSH3PZPY-D-7UQNP4.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([4,2,3,1])));function SJ({content:e,annotations:t,session:n,sparkleAnnotationIds:r,hoveredAnnotationId:i,scrollToAnnotationId:a,showLineNumbers:o=!1,hoverDelayMs:s=150,enableWidgets:c=!1,getTargetResourceName:l,generatingReferenceId:u}){let d=vJ(e,t);return(0,R.jsx)(DU,{content:e,segments:d,editable:!1,sparkleAnnotationIds:r,...i!==void 0&&{hoveredAnnotationId:i},...a!==void 0&&{scrollToAnnotationId:a},sourceView:!0,showLineNumbers:o,hoverDelayMs:s,enableWidgets:c,session:n,...l&&{getTargetResourceName:l},...u!==void 0&&{generatingReferenceId:u}})}function CJ({content:e,resourceUri:t,annotations:n,session:r,drawingMode:i,selectedMotivation:a,hoveredAnnotationId:o,hoverDelayMs:s=150}){return e?(0,R.jsx)(uJ,{imageUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:i,selectedMotivation:a,session:r,hoveredAnnotationId:o||null,hoverDelayMs:s}):null}function wJ({content:e,resourceUri:t,annotations:n,session:r,drawingMode:i,selectedMotivation:a,hoveredAnnotationId:o,hoverDelayMs:s=150}){return e?(0,R.jsx)(y.Suspense,{fallback:(0,R.jsx)(`div`,{className:`semiont-annotate-view__loading`,children:(0,R.jsx)(bJ,{})}),children:(0,R.jsx)(xJ,{pdfUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:i,selectedMotivation:a,session:r,hoveredAnnotationId:o||null,hoverDelayMs:s,pageLayout:`scroll`})}):null}var TJ={text:SJ,image:CJ,pdf:wJ};function EJ({resourceUri:e,session:t}){let n=t?.client??null,{token:r}=JF(n,cr(e)),i=bF(n,cr(e),r);return i?(0,R.jsx)(`a`,{href:i,download:!0,className:`semiont-button semiont-button--primary`,children:`Download File`}):(0,R.jsx)(`button`,{type:`button`,disabled:!0,className:`semiont-button semiont-button--primary semiont-button--disabled`,children:`Download File`})}function DJ({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,session:f,sparkleAnnotationIds:p,onModeChange:m,showToolbar:h=!0,renderers:g}){let _=(0,y.useRef)(null),v=bi(t)?.render??`none`,{highlights:b,references:x,assessments:S,comments:C,tags:w}=r,T=[...b,...x,...S,...C,...w],{selectedMotivation:E,selectedClick:D,selectedShape:O,hoveredAnnotationId:k,scrollToAnnotationId:A}=i,j=(0,y.useRef)(a);j.current=a;let M=(0,y.useCallback)(e=>{j.current?.({selectedMotivation:e})},[]),ee=(0,y.useCallback)(e=>{j.current?.({selectedClick:e})},[]),N=(0,y.useCallback)(e=>{j.current?.({selectedShape:e})},[]);XF(f,{"beckon:hover":(0,y.useCallback)(({annotationId:e})=>{j.current?.({hoveredAnnotationId:e})},[]),"beckon:focus":(0,y.useCallback)(({annotationId:e,resourceId:t})=>{t&&t!==n||_.current&&uU(e??null,_.current,{pulse:!0})},[n])}),(0,y.useEffect)(()=>{let t=_.current;if(!t)return;let r=!1,i=e=>{let t=e.target;r=!!t.closest(`[data-annotation-id]`),t.closest(`[data-annotation-ui]`)},a=i=>{let a=i.target;if(a.closest(`.semiont-pdf-annotation-canvas`)||a.closest(`.semiont-svg-drawing-canvas`))return;let o=window.getSelection();if(!o||o.isCollapsed||!o.toString()){r=!1;return}if(r){r=!1;return}r=!1;let s=o.getRangeAt(0),c=o.toString(),l=t.querySelector(`.codemirror-renderer`)?.__cmView,u,d;if(!l||!l.posAtDOM){let t=gJ(e,c);if(!t)return;u=t.start,d=t.end}else u=l.posAtDOM(s.startContainer,s.startOffset),d=u+c.length;if(u>=0&&E){let t=hJ(e,c,u,d);if(!t)return;f?.client.mark.request(cr(n),t,E),o.removeAllRanges()}};return t.addEventListener(`mouseup`,a),t.addEventListener(`mousedown`,i),()=>{t.removeEventListener(`mouseup`,a),t.removeEventListener(`mousedown`,i)}},[E,e,n]);let te={...TJ,...g}[v];return te?(0,R.jsxs)(`div`,{className:`semiont-annotate-view`,"data-mime-type":v,ref:_,children:[h&&(0,R.jsx)(zU,{selectedMotivation:E,selectedClick:D,selectedShape:O,mediaType:t,annotateMode:d,annotators:rT,onModeChange:m,onClickActionChange:ee,onSelectionChange:M,onShapeChange:N}),(0,R.jsx)(`div`,{className:`semiont-annotate-view__content`,children:(0,R.jsx)(te,{content:e,mimeType:t,resourceUri:n,annotations:T,session:f,drawingMode:E?O:null,selectedMotivation:E,hoveredAnnotationId:k,hoverDelayMs:u,sparkleAnnotationIds:p,scrollToAnnotationId:A,showLineNumbers:l,enableWidgets:o,...s&&{getTargetResourceName:s},generatingReferenceId:c})})]}):(0,R.jsx)(`div`,{ref:_,className:`semiont-annotate-view semiont-annotate-view--unsupported`,"data-mime-type":`unsupported`,children:(0,R.jsxs)(`div`,{className:`semiont-annotate-view__empty`,children:[(0,R.jsxs)(`p`,{className:`semiont-annotate-view__empty-message`,children:[`Annotation not supported for `,t]}),(0,R.jsx)(EJ,{resourceUri:n,session:f})]})})}function OJ(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 kJ(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:failed`:return t(`jobEvent`);case`yield:representation-added`:case`yield:representation-removed`:return t(`representationEvent`);default:return e}}function AJ(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`?rT.highlight.iconEmoji||`📝`:e===`linking`?rT.reference.iconEmoji||`📝`:e===`assessing`&&rT.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`:return`⚙️`;case`job:failed`:return`❌`;case`yield:representation-added`:case`yield:representation-removed`:return`📄`;default:return`📝`}}function jJ(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 MJ(e,t=50){let n=e.trim();return n.length>t?n.substring(0,t)+`...`:n}function NJ(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=kr(xr(e.target));if(t)return{exact:MJ(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=kr(t.selector);if(e)return{exact:MJ(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=kr(e.selector);if(t)return{exact:MJ(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=kr(xr(e.target));if(t)return{exact:MJ(t),isQuoted:!0,isTag:!1}}catch{}}return null;case`job:started`:case`job:failed`:case`yield:representation-added`:case`yield:representation-removed`:return null;default:return null}}function PJ(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 FJ(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 IJ({event:e,annotations:t,allEvents:n,isRelated:r,t:i,Link:a,routes:o,onEventRef:s,onEventClick:c,onEventHover:l}){let u=NJ(e,t,n),d=fr(e),f=FJ(e),p=PJ(e),m=(0,y.useRef)(null),h=(0,y.useRef)(l);(0,y.useEffect)(()=>{h.current=l});let g=(0,y.useCallback)(()=>{!d||!h.current||(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{h.current?.(d)},300))},[d]),_=(0,y.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null),h.current&&h.current(null)},[]),v=d?`button`:`div`,b=d?{type:`button`,onClick:()=>c?.(d),"aria-label":i(`viewAnnotation`,{content:u?.exact||kJ(e.type,i)}),className:`semiont-history-event`,"data-related":r?`true`:`false`,"data-interactive":`true`}:{className:`semiont-history-event`,"data-related":r?`true`:`false`};return(0,R.jsxs)(v,{ref:e=>{s&&s(d,e)},...b,children:[(0,R.jsxs)(`div`,{className:`semiont-history-event__content`,children:[(0,R.jsx)(`span`,{className:`semiont-history-event__emoji`,onMouseEnter:g,onMouseLeave:_,children:AJ(e.type,e.payload)}),u?u.isTag?(0,R.jsx)(`span`,{className:`semiont-history-event__tag`,children:u.exact}):u.isQuoted?(0,R.jsxs)(`span`,{className:`semiont-history-event__text semiont-history-event__text--quoted`,children:[`“`,u.exact,`”`]}):(0,R.jsx)(`span`,{className:`semiont-history-event__text`,children:u.exact}):(0,R.jsx)(`span`,{className:`semiont-history-event__text`,children:kJ(e.type,i,e.payload)}),e.userId&&(0,R.jsx)(`span`,{className:`semiont-history-event__user`,children:OJ(e.userId)}),(0,R.jsx)(`span`,{className:`semiont-history-event__timestamp`,children:jJ(e.timestamp,i)})]}),p.length>0&&(0,R.jsx)(`div`,{className:`semiont-history-event__entity-types`,children:p.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--small`,"data-variant":`blue`,children:e},e))}),f&&(0,R.jsxs)(`div`,{className:`semiont-history-event__details`,children:[(0,R.jsxs)(`span`,{className:`semiont-history-event__detail`,children:[i(`user`),`: `,(0,R.jsx)(`span`,{className:`semiont-history-event__detail-value`,children:f.userId?OJ(f.userId):``})]}),f.type===`cloned`&&f.sourceDocId&&(0,R.jsx)(a,{href:o.resourceDetail(f.sourceDocId),className:`semiont-history-event__link`,onClick:e=>e.stopPropagation(),children:i(`viewOriginal`)})]})]})}function LJ({events:e,eventsLoading:t=!1,eventsError:n=null,onRetryEvents:r,annotations:i=[],hoveredAnnotationId:a,onEventHover:o,onEventClick:s,Link:c,routes:l}){let u=ah(`AnnotationHistory`),d=t,f=n,p=(0,y.useRef)(new Map),m=(0,y.useRef)(null),h=e.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,y.useEffect)(()=>{m.current&&h.length>0&&requestAnimationFrame(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)})},[h.length]),(0,y.useEffect)(()=>{if(!a)return;let e=p.current.get(a);e&&m.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))},[a]),f?(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsxs)(`p`,{className:`semiont-history-panel__error`,children:[u(`failed`),r&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:r,className:`semiont-panel__inline-action`,children:u(`retry`)})]})]})]}):d?(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsx)(`div`,{className:`semiont-history-panel__loading`,children:u(`loading`)})]}):h.length===0?null:(0,R.jsxs)(`div`,{className:`semiont-history-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-history-panel__title`,children:u(`history`)}),(0,R.jsx)(`div`,{ref:m,className:`semiont-history-panel__list`,children:h.map(e=>{let t=a?(()=>{let t=fr(e);return t?t===a:!1})():!1;return(0,R.jsx)(IJ,{event:e,annotations:i,allEvents:h,isRelated:t,t:u,Link:c,routes:l,onEventRef:(e,t)=>{t&&e?p.current.set(e,t):!t&&e&&p.current.delete(e)},...s&&{onEventClick:s},...o&&{onEventHover:o}},e.id)})})]})}function RJ(){let e=ah(`PdfViewer`);return(0,R.jsx)(R.Fragment,{children:e(`viewerLoading`)})}var zJ=(0,y.lazy)(()=>s(()=>import(`./PdfAnnotationCanvas.client-LSH3PZPY-D-7UQNP4.js`).then(e=>({default:e.PdfAnnotationCanvas})),__vite__mapDeps([4,2,3,1]))),BJ=(0,y.memo)(function({content:e}){return(0,R.jsx)(Jx,{remarkPlugins:[Qw],children:e})});function VJ({content:e}){return(0,R.jsx)(BJ,{content:e})}function HJ({content:e,resourceUri:t,annotations:n,session:r}){return(0,R.jsx)(uJ,{imageUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:null,selectedMotivation:null,session:r})}function UJ({content:e,resourceUri:t,annotations:n,session:r}){return(0,R.jsx)(y.Suspense,{fallback:(0,R.jsx)(`div`,{className:`semiont-browse-view__loading`,children:(0,R.jsx)(RJ,{})}),children:(0,R.jsx)(zJ,{pdfUrl:e,resourceUri:t,existingAnnotations:n,drawingMode:null,selectedMotivation:null,session:r,pageLayout:`scroll`})})}var WJ={text:VJ,image:HJ,pdf:UJ},GJ=(0,y.memo)(function({content:e,mimeType:t,resourceUri:n,annotations:r,selectedClick:i=`detail`,onModeChange:a,onClickActionChange:o,showToolbar:s=!0,annotateMode:c,hoverDelayMs:l=150,session:u,sparkleAnnotationIds:d,renderers:f,onLinkClick:p,onReferenceHover:m,inline:h=!1}){let g=(0,y.useRef)(null),_=h?` semiont-browse-view--inline`:``,v=bi(t)?.render??`none`,{highlights:b,references:x,assessments:S,comments:C,tags:w}=r,T=(0,y.useMemo)(()=>[...b,...x,...S,...C,...w],[b,x,S,C,w]),E=(0,y.useMemo)(()=>EF(T),[T]);(0,y.useEffect)(()=>{if(!g.current||E.length===0)return;let t=g.current,n=xF(e,t),r=SF(t);return wF(CF(E,n),r),()=>TF(t)},[e,E]),(0,y.useEffect)(()=>{if(!g.current||!u)return;let e=g.current,t=e=>{let t=e.target.closest(`[data-annotation-id]`);if(!t)return;let n=window.getSelection();if(n&&!n.isCollapsed)return;let r=t.getAttribute(`data-annotation-id`);if(r){let e=T.find(e=>e.id===r);e&&u.client.browse.click(e.id,t.getBoundingClientRect())}},n=null,r=null,i=!1,a=e=>{if(!m)return;let t=T.find(t=>t.id===e);if(!t||!Or(t))return;let a=yr(t.body),o=n;!a||!o||(r?.unsubscribe(),r=u.client.browse.resource(cr(a)).subscribe({next:e=>{if(e.status!==`ready`)return;let n=e.value;r?.unsubscribe(),r=null,i=!0,m({annotation:t,referent:n,anchorRect:o.getBoundingClientRect()})},error:()=>{r=null}}))},o=()=>{r?.unsubscribe(),r=null,i&&(i=!1,m?.(null))},{handleMouseEnter:s,handleMouseLeave:c,cleanup:f}=Yl(e=>{u.client.beckon.hover(e),e?a(e):o()},l),p=e=>{let t=e.target.closest(`[data-annotation-id]`),r=t?.getAttribute(`data-annotation-id`);r&&(n=t,s(lr(r)))},h=e=>{e.target.closest(`[data-annotation-id]`)&&c()};return d&&e.querySelectorAll(`[data-annotation-id]`).forEach(e=>{let t=e.getAttribute(`data-annotation-id`);t&&d.has(t)&&e.classList.add(`annotation-sparkle`)}),e.addEventListener(`click`,t),e.addEventListener(`mouseover`,p),e.addEventListener(`mouseout`,h),()=>{e.removeEventListener(`click`,t),e.removeEventListener(`mouseover`,p),e.removeEventListener(`mouseout`,h),f(),r?.unsubscribe()}},[e,T,d,l,u,m]);let D=(0,y.useCallback)((e,t=!1)=>{g.current&&uU(e,g.current,{pulse:t})},[]);XF(u,{"beckon:hover":(0,y.useCallback)(({annotationId:e})=>{D(e)},[D]),"beckon:focus":(0,y.useCallback)(({annotationId:e,resourceId:t})=>{t&&t!==n||D(e??null,!0)},[D,n])});let O=(0,y.useCallback)(e=>{let t=e.target.closest(`a[href]`);if(!t)return;e.preventDefault();let n=t.getAttribute(`href`);n&&p?.({href:n,event:e})},[p]),k={...WJ,...f},A=v===`none`?void 0:k[v];return A?(0,R.jsxs)(`div`,{className:`semiont-browse-view${_}`,"data-mime-type":v,children:[s&&(0,R.jsx)(zU,{selectedMotivation:null,selectedClick:i,parts:[`clickAction`,`mode`],showDeleteButton:!1,annotateMode:c,annotators:rT,onModeChange:a,onClickActionChange:o,compact:h}),(0,R.jsx)(`div`,{ref:g,className:`semiont-browse-view__content`,onClick:O,children:(0,R.jsx)(A,{content:e,mimeType:t,resourceUri:n,annotations:T,session:u})})]}):(0,R.jsx)(`div`,{ref:g,className:`semiont-browse-view semiont-browse-view--unsupported${_}`,"data-mime-type":`unsupported`,children:(0,R.jsxs)(`div`,{className:`semiont-browse-view__empty`,children:[(0,R.jsxs)(`p`,{className:`semiont-browse-view__empty-message`,children:[`Preview not available for `,t]}),(0,R.jsx)(EJ,{resourceUri:n,session:u})]})})});function KJ({resource:e,annotations:t,session:n,onOpenResource:r,onOpenPanel:i,onLinkClick:a,onReferenceHover:o,inline:s=!1,sparkleAnnotationIds:c,generatingReferenceId:l,showLineNumbers:u=!1,hoverDelayMs:d,hoveredAnnotationId:f,annotateMode:p,onAnnotateModeChange:m,clickAction:h,onClickActionChange:g,selectionMotivation:_,onSelectionMotivationChange:v,shape:b,onShapeChange:x,showToolbar:S=!0,browseRenderers:C,annotateRenderers:w}){let T=ah(`ResourceViewer`),E=(0,y.useRef)(null),{highlights:D,references:O,assessments:k,comments:A,tags:j}=t;if(!e[`@id`])throw Error(`Resource has no @id`);let M=e[`@id`],ee=Hr(e)||`text/plain`,[N,te]=(0,y.useState)(!1),P=p??N,F=(0,y.useCallback)(e=>{p===void 0&&te(e),m?.(e)},[p,m]),ne=P?`annotate`:`browse`,[re,ie]=(0,y.useState)(`linking`),ae=_===void 0?re:_,oe=(0,y.useCallback)(e=>{_===void 0&&ie(e),v?.(e)},[_,v]),[se,I]=(0,y.useState)(`detail`),L=h??se,ce=(0,y.useCallback)(e=>{h===void 0&&I(e),g?.(e)},[h,g]),[le,ue]=(0,y.useState)(`rectangle`),de=b??le,fe=(0,y.useCallback)(e=>{b===void 0&&ue(e),x?.(e)},[b,x]),[pe,me]=(0,y.useState)(!1),[he,ge]=(0,y.useState)(null),[_e,ve]=(0,y.useState)(null),ye=f??null,be=()=>typeof window>`u`?{x:0,y:0}:{x:Math.max(0,(window.innerWidth-800)/2),y:Math.max(0,(window.innerHeight-700)/2)},xe=(0,y.useCallback)(e=>{n?.client.mark.delete(M,e)},[n,M]),Se=(0,y.useCallback)((e,t)=>{if(Object.values(rT).find(t=>t.matchesAnnotation(e))?.hasSidePanel&&L!==`deleting`&&L!==`jsonld`&&L!==`follow`)return;let n=Sr(e)||wr(e)||Tr(e)||Cr(e)||Er(e);if(L===`follow`&&Cr(e)){let t=yr(e.body);t&&r?.(t);return}if(L===`jsonld`&&n){ge(e),me(!0);return}if(P&&L===`deleting`&&n){let n=t?{x:t.clientX,y:t.clientY+10}:{x:window.innerWidth/2-150,y:window.innerHeight/2-75};ve({annotation:e,position:n});return}},[P,L,r]);XF(n,{"browse:click":(0,y.useCallback)(({annotationId:e,anchorRect:t})=>{let n=[...D,...O,...k,...A,...j].find(t=>t.id===e);if(n){if(!Object.values(rT).find(e=>e.matchesAnnotation(n))?.hasSidePanel||L!==`detail`){Se(n);return}i?.({panel:`annotations`,scrollToAnnotationId:e,motivation:n.motivation,...t?{anchorRect:t}:{}})}},[D,O,k,A,j,Se,L,i])});let Ce=(0,y.useMemo)(()=>({highlights:D,references:O,assessments:k,comments:A,tags:j}),[D,O,k,A,j]),z={selectedMotivation:ae,selectedClick:L,selectedShape:de,hoveredAnnotationId:ye},we=(0,y.useCallback)(e=>{let t=O.find(t=>yr(t.body)===e);return t?kr(xr(t.target)):void 0},[O]);return(0,R.jsxs)(`div`,{ref:E,className:`semiont-resource-viewer${s?` semiont-resource-viewer--inline`:``}`,children:[ne===`annotate`?(0,R.jsx)(DJ,{content:e.content,mimeType:ee,resourceUri:e[`@id`],annotations:Ce,uiState:z,onUIStateChange:e=>{`selectedMotivation`in e&&oe(e.selectedMotivation??null),`selectedClick`in e&&ce(e.selectedClick),`selectedShape`in e&&fe(e.selectedShape)},enableWidgets:!0,getTargetResourceName:we,...l!==void 0&&{generatingReferenceId:l},showLineNumbers:u,hoverDelayMs:d,annotateMode:P,onModeChange:F,showToolbar:S,session:n,sparkleAnnotationIds:c,...w&&{renderers:w}}):(0,R.jsx)(GJ,{content:e.content,mimeType:ee,resourceUri:e[`@id`],annotations:Ce,selectedClick:L,hoverDelayMs:d,annotateMode:P,onModeChange:F,onClickActionChange:ce,showToolbar:S,session:n,sparkleAnnotationIds:c,onLinkClick:a,onReferenceHover:o,inline:s,...C&&{renderers:C}}),he&&(0,R.jsx)(aJ,{isOpen:pe,onClose:()=>me(!1),position:be(),wide:!0,children:(0,R.jsx)(sW,{annotation:he,onBack:()=>{me(!1),ge(null)}})}),_e&&(()=>{let e=_e.annotation,t=Object.values(rT).find(t=>t.matchesAnnotation(e)),n=kr(xr(e.target)),r=t?.iconEmoji||`📝`;return(0,R.jsx)(aJ,{isOpen:!!_e,onClose:()=>ve(null),position:_e.position,children:(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation`,children:[(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation__header`,children:[(0,R.jsx)(`span`,{className:`semiont-delete-confirmation__icon`,children:r}),(0,R.jsx)(`h3`,{className:`semiont-delete-confirmation__title`,children:T(`deleteConfirmationTitle`)})]}),n&&(0,R.jsx)(`div`,{className:`semiont-delete-confirmation__quote`,children:(0,R.jsxs)(`p`,{className:`semiont-delete-confirmation__text`,children:[`"`,n.length>100?n.substring(0,100)+`...`:n,`"`]})}),(0,R.jsx)(`p`,{className:`semiont-delete-confirmation__message`,children:T(`deleteConfirmationMessage`)}),(0,R.jsxs)(`div`,{className:`semiont-delete-confirmation__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>ve(null),className:`semiont-button semiont-button--secondary`,children:T(`deleteConfirmationCancel`)}),(0,R.jsx)(`button`,{onClick:()=>{xe(_e.annotation.id),ve(null)},className:`semiont-button semiont-button--danger`,children:T(`deleteConfirmationDelete`)})]})]})})})()]})}function qJ(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 YJ(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`TextualBody`&&`value`in e&&typeof e.value==`string`}function XJ(e){return e.body?YJ(e.body)?e.body.value||null:Array.isArray(e.body)&&e.body.length>0&&e.body.find(YJ)?.value||null:null}function ZJ({session:e,assessment:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t),s=XJ(t);return(0,R.jsxs)(`div`,{ref:i,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`assessment`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...a,children:[o&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`assessment`,children:[`"`,o.substring(0,100),o.length>100?`...`:``,`"`]}),s&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__body`,"data-type":`assessment`,children:s}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,JJ(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function QJ(e){return t=>{switch(t.code){case`loading`:return e(`codeLoading`);case`analyzing`:return e(`codeAnalyzing`);case`analyzing-tags`:return e(`codeAnalyzingTags`);case`generating-resource`:return e(`codeGeneratingResource`);case`creating-resource`:return e(`codeCreatingResource`);case`complete-generated`:return t.truncated?e(`codeCompleteGeneratedTruncated`):e(`codeCompleteGenerated`);case`detecting-entities`:return e(`codeDetectingEntities`);case`creating-annotations`:return e(`codeCreatingAnnotations`,{count:t.count});case`creating-tag-annotations`:return e(`codeCreatingTagAnnotations`,{count:t.count});case`complete-created`:return e(`codeCompleteCreated`,{count:t.count,kind:e($J(t.kind))});default:return t}}}function $J(e){return`kind${e.charAt(0).toUpperCase()}${e.slice(1)}`}function eY(e){let t=tY(e);return(n,r,i)=>r===void 0||i===void 0?e(`subject`,{kind:t(n.kind),label:n.value}):e(`subjectWithPosition`,{kind:t(n.kind),label:n.value,done:r+1,total:i})}function tY(e){return t=>{switch(t){case`entity-type`:return e(`subjectKindEntityType`);case`category`:return e(`subjectKindCategory`);default:return t}}}function nY(e){return t=>{switch(t){case`entity-types`:return e(`paramEntityTypes`);case`instructions`:return e(`paramInstructions`);case`tone`:return e(`paramTone`);case`density`:return e(`paramDensity`);default:return t}}}function rY(e,t){return{cancel:e(`cancel`),close:e(`close`),inProgress:e(`inProgress`),message:QJ(e),subject:eY(e),paramLabel:nY(e),...t?.found?{found:t.found}:{}}}function iY({session:e,annotationType:t,isAssisting:n,locale:r,sourceLanguage:i,progress:a}){let o=ah(t===`highlight`?`HighlightPanel`:t===`assessment`?`AssessmentPanel`:`CommentsPanel`),s=ah(`AssistProgress`),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(``),[f,p]=(0,y.useState)(t===`assessment`?4:5),[m,h]=(0,y.useState)(!0),g=(0,y.useCallback)(()=>{let n=t===`highlight`?`highlighting`:t===`assessment`?`assessing`:`commenting`;e?.client.mark.requestAssist(n,{instructions:c.trim()||void 0,tone:(t===`comment`||t===`assessment`)&&u?u:void 0,density:m?f:void 0,language:t===`comment`||t===`assessment`?r:void 0,sourceLanguage:i}),l(``),d(``)},[t,c,u,m,f,r,i,e]),_=(0,y.useCallback)(()=>{e?.client.mark.dismissProgress()},[e]);return(0,R.jsx)(AU,{assistType:t,title:o(t===`highlight`?`annotateHighlights`:t===`assessment`?`annotateAssessments`:`annotateComments`),isAssisting:n,progress:a,progressProps:{onDismiss:_,translations:{cancel:o(`cancel`),inProgress:o(`annotating`),close:s(`close`),message:QJ(s),subject:eY(s),paramLabel:nY(s)}},form:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label`,children:[o(`instructions`),` `,o(`optional`)]}),(0,R.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),className:`semiont-textarea`,rows:3,placeholder:o(`instructionsPlaceholder`),maxLength:500}),(0,R.jsxs)(`div`,{className:`semiont-form-field__char-count`,children:[c.length,`/500`]})]}),(t===`comment`||t===`assessment`)&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label`,children:[o(`toneLabel`),` `,o(`toneOptional`)]}),(0,R.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:``,children:`Default`}),t===`comment`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`option`,{value:`scholarly`,children:o(`toneScholarly`)}),(0,R.jsx)(`option`,{value:`explanatory`,children:o(`toneExplanatory`)}),(0,R.jsx)(`option`,{value:`conversational`,children:o(`toneConversational`)}),(0,R.jsx)(`option`,{value:`technical`,children:o(`toneTechnical`)})]}),t===`assessment`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`option`,{value:`analytical`,children:o(`toneAnalytical`)}),(0,R.jsx)(`option`,{value:`critical`,children:o(`toneCritical`)}),(0,R.jsx)(`option`,{value:`balanced`,children:o(`toneBalanced`)}),(0,R.jsx)(`option`,{value:`constructive`,children:o(`toneConstructive`)})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsxs)(`div`,{className:`semiont-form-field__header`,children:[(0,R.jsxs)(`label`,{className:`semiont-form-field__label semiont-form-field__label--with-checkbox`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked),className:`semiont-checkbox`,"data-variant":t}),(0,R.jsx)(`span`,{children:o(`densityLabel`)})]}),m&&(0,R.jsx)(`span`,{className:`semiont-form-field__info`,children:o(`densityPerWords`,{density:f})})]}),m&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{type:`range`,min:t===`comment`?`2`:`1`,max:t===`comment`?`12`:t===`assessment`?`10`:`15`,value:f,onChange:e=>p(Number(e.target.value)),className:`semiont-slider`}),(0,R.jsxs)(`div`,{className:`semiont-slider__labels`,children:[(0,R.jsx)(`span`,{children:o(`densitySparse`)}),(0,R.jsx)(`span`,{children:o(`densityDense`)})]})]})]}),(0,R.jsxs)(`button`,{onClick:g,className:`semiont-button`,"data-variant":`assist`,"data-type":t,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:o(`annotate`)})]})]})})}function aY({count:e,title:t}){return(0,R.jsx)(`div`,{className:`semiont-panel-header`,children:(0,R.jsxs)(`h2`,{className:`semiont-panel-header__title`,children:[(0,R.jsx)(`span`,{className:`semiont-panel-header__text`,children:t}),(0,R.jsxs)(`span`,{className:`semiont-panel-header__count`,children:[`(`,e,`)`]})]})})}function oY(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 sY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,isAssisting:i=!1,progress:a,locale:o,sourceLanguage:s,annotateMode:c=!0,scrollToAnnotationId:l,onScrollCompleted:u,hoveredAnnotationId:d}){let f=ah(`AssessmentPanel`),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(new Map),b=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),x=(0,y.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!l)return;let e=v.current.get(l);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`),u&&u()}},[l]),(0,y.useEffect)(()=>{if(!d)return;let e=v.current.get(d);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`})}},[d]),(0,y.useEffect)(()=>{if(!r)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),m(``))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[r,e]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`assessment`,count:n.length,title:f(`title`)}),r&&r.motivation===`assessing`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`assessment`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=oY(r.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,R.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`assessmentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[p.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),m(``)},className:`semiont-button semiont-button--secondary`,"data-type":`assessment`,children:f(`cancel`)}),(0,R.jsx)(`button`,{onClick:()=>{if(r){let n=p.trim(),i=n?{type:`TextualBody`,value:n,purpose:`assessing`}:void 0;e?.client.mark.submit({source:t,motivation:`assessing`,selector:r.selector,...i===void 0?{}:{body:i}}),m(``)}},className:`semiont-button semiont-button--primary`,"data-type":`assessment`,children:f(`save`)})]})]})]}),(0,R.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[c&&(0,R.jsx)(iY,{session:e,annotationType:`assessment`,isAssisting:i,locale:o,sourceLanguage:s,progress:a}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noAssessments`)}):b.map(t=>(0,R.jsx)(ZJ,{session:e,assessment:t,isFocused:t.id===h,isHovered:t.id===d,ref:e=>x(t.id,e)},t.id))})]})]})}function cY(e){if(e>=1e6){let t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){let t=e/1e3;return`${Number.isInteger(t)?t:t.toFixed(1)}K`}return String(e)}function lY({state:e,eventCount:t,lastEventTimestamp:n,knowledgeBaseName:r,collaborators:i}){let a=ah(`CollaborationPanel`),o=(i??[]).filter(e=>e.agent[`@type`]===`Software`),s=e===`open`||e===`reconnecting`||e===`initial`||e===`connecting`,c;if(!n)c=a(`noActivity`);else{let e=new Date,t=new Date(n),r=e.getTime()-t.getTime(),i=Math.floor(r/1e3),o=Math.floor(i/60),s=Math.floor(o/60);c=i<10?a(`justNow`):i<60?a(`secondsAgo`,{count:i}):o===1?a(`minuteAgo`):o<60?a(`minutesAgo`,{count:o}):s===1?a(`hourAgo`):s<24?a(`hoursAgo`,{count:s}):t.toLocaleDateString()}return(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__title`,children:a(`title`)}),r&&(0,R.jsx)(`div`,{style:{padding:`0 0.75rem 0.5rem`,fontSize:`0.8rem`,color:`var(--semiont-color-neutral-400)`},children:r}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`connectionStatus`)}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__status`,children:[(0,R.jsxs)(`span`,{className:`semiont-collaboration-panel__indicator`,children:[(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__dot`,"data-connected":s?`true`:`false`}),(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__status-text`,"data-connected":s?`true`:`false`,children:a(s?`live`:`disconnected`)})]}),s&&t>0&&(0,R.jsxs)(`span`,{className:`semiont-collaboration-panel__event-count`,children:[`(`,a(`events`,{count:t}),`)`]})]}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__details`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__label`,children:a(`lastSync`)}),` `,c]}),(0,R.jsx)(`div`,{children:a(s?`realtimeActive`:`reconnecting`)})]})]}),o.length>0&&(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`collaborators`)}),o.map((e,t)=>{let n=e.agent,r=e.limits,i=r?r.maxOutputTokens===r.contextTokens?a(`sharedWindow`,{contextTokens:cY(r.contextTokens)}):a(`ceilings`,{contextTokens:cY(r.contextTokens),maxOutputTokens:cY(r.maxOutputTokens)}):null;return(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__collaborator`,"data-testid":`semiont-collaborator-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__collaborator-id`,children:[n.provider&&(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__collaborator-provider`,children:n.provider}),(0,R.jsx)(`span`,{className:`semiont-collaboration-panel__collaborator-model`,children:n.model??n.name})]}),e.servesJobTypes&&e.servesJobTypes.length>0&&(0,R.jsx)(`div`,{className:`semiont-collaboration-panel__collaborator-jobs`,children:e.servesJobTypes.join(`, `)}),i&&(0,R.jsx)(`div`,{className:`semiont-collaboration-panel__collaborator-limits`,children:i})]},n[`@id`]??`${n.provider}:${n.model}:${t}`)})]}),(0,R.jsxs)(`div`,{className:`semiont-collaboration-panel__section semiont-collaboration-panel__section--bordered`,children:[(0,R.jsx)(`h3`,{className:`semiont-collaboration-panel__heading`,children:a(`sharing`)}),(0,R.jsx)(`p`,{className:`semiont-collaboration-panel__description`,children:a(`collaborationComingSoon`)})]})]})}function uY(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 dY({session:e,comment:t,isFocused:n,isHovered:r=!1,annotateMode:i=!0,ref:a}){let o=ah(`CommentsPanel`),s=IF(e,t.id),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(``),f=(0,y.useRef)(null);(0,y.useImperativeHandle)(a,()=>f.current);let p=Dr(t)||``,m=Ar(t);(0,y.useEffect)(()=>{n&&f.current&&f.current.scrollIntoView({behavior:`smooth`,block:`center`})},[n]);let h=()=>{d(p),l(!0)},g=()=>{l(!1)},_=()=>{l(!1),d(``)};return(0,R.jsxs)(`div`,{ref:f,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`comment`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...s,children:[m&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`comment`,children:[`"`,m.substring(0,100),m.length>100?`...`:``,`"`]}),c?(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__edit`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),className:`semiont-textarea`,rows:3,autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__edit-footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-entry__char-count`,children:[u.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__button-group`,children:[(0,R.jsx)(`button`,{onClick:g,className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:o(`save`)}),(0,R.jsx)(`button`,{onClick:_,className:`semiont-button semiont-button--secondary`,children:o(`cancel`)})]})]})]}):(0,R.jsx)(`div`,{className:`semiont-annotation-entry__body`,children:p}),!c&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__footer`,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,uY(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]}),i&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__actions`,onClick:e=>e.stopPropagation(),children:(0,R.jsx)(`button`,{onClick:h,className:`semiont-text-button`,"data-variant":`comment`,children:o(`edit`)})})]})]})}function fY(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 pY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,annotateMode:i=!0,isAssisting:a=!1,progress:o,locale:s,sourceLanguage:c,scrollToAnnotationId:l,onScrollCompleted:u,hoveredAnnotationId:d}){let f=ah(`CommentsPanel`),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(new Map),b=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),x=(0,y.useCallback)((e,t)=>{t?v.current.set(e,t):v.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!l)return;let e=v.current.get(l);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`),u&&u()}},[l]),(0,y.useEffect)(()=>{if(!d)return;let e=v.current.get(d);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`})}},[d]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{g(e),setTimeout(()=>g(null),3e3)},[])}),(0,y.useEffect)(()=>{if(!r)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),m(``))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[r,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`comment`,count:n.length,title:f(`title`)}),r&&r.motivation===`commenting`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`comment`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=fY(r.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()}),(0,R.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),className:`semiont-textarea`,rows:3,placeholder:f(`commentPlaceholder`),autoFocus:!0,maxLength:2e3}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__footer`,children:[(0,R.jsxs)(`span`,{className:`semiont-annotation-prompt__char-count`,children:[p.length,`/2000`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),m(``)},className:`semiont-button semiont-button--secondary`,"data-type":`comment`,children:f(`cancel`)}),(0,R.jsx)(`button`,{onClick:()=>{p.trim()&&r&&(e?.client.mark.submit({source:t,motivation:`commenting`,selector:r.selector,body:[{type:`TextualBody`,value:p,purpose:`commenting`}]}),m(``))},disabled:!p.trim(),className:`semiont-button semiont-button--primary`,"data-type":`comment`,children:f(`save`)})]})]})]}),(0,R.jsxs)(`div`,{ref:_,className:`semiont-panel__content`,children:[i&&(0,R.jsx)(iY,{session:e,annotationType:`comment`,isAssisting:a,locale:s,sourceLanguage:c,progress:o}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:b.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noComments`)}):b.map(t=>(0,R.jsx)(dY,{session:e,comment:t,isFocused:t.id===h,isHovered:t.id===d,annotateMode:i,ref:e=>x(t.id,e)},t.id))})]})]})}function mY(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 hY({session:e,highlight:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t);return(0,R.jsxs)(`div`,{ref:i,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`highlight`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...a,children:[o&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`highlight`,children:[`"`,o.substring(0,200),o.length>200?`...`:``,`"`]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`By `,typeof t.creator==`string`?t.creator:t.creator?.name||`Unknown`,` • `,mY(t.created||new Date().toISOString())]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function gY({session:e,resourceId:t,annotations:n,pendingAnnotation:r,isAssisting:i=!1,progress:a,annotateMode:o=!0,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l,sourceLanguage:u}){let d=ah(`HighlightPanel`),[f,p]=(0,y.useState)(null),m=(0,y.useRef)(null),h=(0,y.useRef)(new Map),g=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),_=(0,y.useCallback)((e,t)=>{t?h.current.set(e,t):h.current.delete(e)},[]);return(0,y.useEffect)(()=>{if(!s)return;let e=h.current.get(s);if(e&&m.current){let t=e.offsetTop,n=m.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;m.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,y.useEffect)(()=>{if(!l)return;let e=h.current.get(l);if(!e||!m.current)return;let t=m.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]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{p(e),setTimeout(()=>p(null),3e3)},[])}),(0,y.useEffect)(()=>{r&&r.motivation===`highlighting`&&e?.client.mark.submit({source:t,motivation:`highlighting`,selector:r.selector})},[r,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`highlight`,count:n.length,title:d(`title`)}),(0,R.jsxs)(`div`,{ref:m,className:`semiont-panel__content`,children:[o&&(0,R.jsx)(iY,{session:e,annotationType:`highlight`,isAssisting:i,progress:a,sourceLanguage:u}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:g.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:d(`noHighlights`)}):g.map(t=>(0,R.jsx)(hY,{session:e,highlight:t,isFocused:t.id===f,isHovered:t.id===l,ref:e=>_(t.id,e)},t.id))})]})]})}function _Y(e){let t=Z(Sm().activeSession$)?.client,[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!t||!e){a(!1);return}let n=!1;return a(!0),s(null),t.browse.resourceGraph(e).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e:Error(String(e))),a(!1))}),()=>{n=!0}},[t,e]),{graph:n,loading:i,error:o}}function vY({resourceId:e}){let t=(0,y.useRef)(null),n=(0,y.useRef)(null),{showLineNumbers:r}=vm(),{graph:i,loading:a,error:o}=_Y(e),s=i?JSON.stringify(i,null,2):``;return(0,y.useEffect)(()=>{if(!t.current||!s)return;let e=document.documentElement?.classList.contains(`dark`)??!1,i=[UU(),J.editable.of(!1),FE.readOnly.of(!0)];r&&i.push(ZM()),e?i.push(oW):(i.push(dF),i.push(eF(fF)));let a=new J({state:FE.create({doc:s,extensions:i}),parent:t.current});return n.current=a,()=>{a.destroy(),n.current=null}},[s,r]),(0,R.jsxs)(`div`,{className:`semiont-jsonld-panel`,children:[(0,R.jsxs)(`div`,{className:`semiont-jsonld-panel__header`,children:[(0,R.jsx)(`h3`,{className:`semiont-jsonld-panel__title`,children:`JSON-LD`}),(0,R.jsx)(`button`,{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s)}catch(e){console.error(`Failed to copy JSON-LD:`,e)}},className:`semiont-button semiont-button--icon`,title:`Copy to clipboard`,disabled:!i,children:`📋 Copy`})]}),a&&(0,R.jsx)(`p`,{className:`semiont-jsonld-panel__status`,role:`status`,children:`Loading JSON-LD…`}),o&&!a&&(0,R.jsx)(`p`,{className:`semiont-jsonld-panel__status semiont-jsonld-panel__status--error`,role:`alert`,children:`Failed to load JSON-LD.`}),(0,R.jsx)(`div`,{ref:t,className:`semiont-jsonld-panel__editor`})]})}function yY(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 bY(e){return e.motivation===`tagging`}function xY(e){if(!bY(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 SY(e){if(!bY(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 CY({session:e,reference:t,isFocused:n,isHovered:r=!1,onOpenResource:i,annotateMode:a=!0,isGenerating:o=!1,sparkle:s=!1,ref:c}){let l=ah(`ReferencesPanel`),u=e?.client,d=IF(e,t.id),f=Ar(t)||``,p=br(t.body),m=p?yr(t.body):null,h=yY(t),g=xr(t.target),_=vr(g),v=_r(g),y=_?`Fragment annotation`:v?`Image annotation`:`Annotation`,b=t,x=b._resolvedDocumentName,S=b._resolvedDocumentMediaType,C=DF(S),w=()=>{m&&i?.(m)},T=typeof t.target==`object`&&`source`in t.target?t.target.source:``,E=()=>{T&&m&&u&&u.bind.body(cr(T),t.id,[{op:`remove`,item:{type:`SpecificResource`,source:m,purpose:`linking`}}]).catch(e=>{u.bind.reportBodyError({resourceId:T,message:e instanceof Error?e.message:String(e)})})},D=()=>{e?.client.bind.initiate({annotationId:t.id,resourceId:cr(T),defaultTitle:f,entityTypes:h})},O=e=>{e.stopPropagation(),p?w():a&&D()},k=p||a;return(0,R.jsxs)(`div`,{ref:c,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`reference`,"data-focused":n?`true`:`false`,onClick:()=>{e?.client.browse.click(t.id)},...d,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,R.jsxs)(`div`,{className:`semiont-reference-icon-group`,children:[(0,R.jsx)(`button`,{className:`semiont-reference-icon${k?` semiont-reference-icon--clickable`:``}${s?` annotation-sparkle`:``}`,title:l(p?`open`:a?`resolve`:`stub`),onClick:k?O:void 0,"data-generating":!p&&o?`true`:`false`,tabIndex:k?0:-1,children:p?`🔗`:`❓`}),a&&p&&(0,R.jsx)(`button`,{className:`semiont-reference-unlink`,title:l(`unlink`),onClick:e=>{e.stopPropagation(),E()},children:`⛓️‍💥`})]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__content`,children:[f&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`reference`,children:[`"`,f.substring(0,100),f.length>100?`...`:``,`"`]}),!f&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__meta`,children:!g&&x?l(`derived`):y}),x&&(0,R.jsx)(`div`,{className:`semiont-reference-link`,children:(0,R.jsxs)(`span`,{children:[`→ `,C,` `,x]})})]})]}),h.length>0&&(0,R.jsx)(`div`,{className:`semiont-annotation-entry__tags`,children:h.map((e,t)=>(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},t))}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function wY(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 TY({session:e,onOpenResource:t,resourceId:n,annotations:r=[],isAssisting:i,progress:a,annotateMode:o=!0,Link:s,routes:c,allEntityTypes:l,entityTypesError:u=null,generatingReferenceId:d,referencedBy:f=[],referencedByLoading:p=!1,referencedByError:m=null,onRetryReferencedBy:h,pendingAnnotation:g,scrollToAnnotationId:_,onScrollCompleted:v,hoveredAnnotationId:b,sparkleAnnotationIds:x,locale:S,sourceLanguage:C}){let w=ah(`ReferencesPanel`),T=ah(`AssistProgress`),[E,D]=(0,y.useState)([]),[O,k]=(0,y.useState)(null),[A,j]=(0,y.useState)([]),[M,ee]=(0,y.useState)(!1),[N,te]=(0,y.useState)(null),P=(0,y.useRef)(null),F=(0,y.useRef)(new Map),ne=(0,y.useMemo)(()=>[...r].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[r]),re=(0,y.useCallback)((e,t)=>{t?F.current.set(e,t):F.current.delete(e)},[]);(0,y.useEffect)(()=>{if(!_)return;let e=F.current.get(_);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`),v&&v()}else console.warn(`[ReferencesPanel] Element not found for scrollToAnnotationId:`,_)},[_]),(0,y.useEffect)(()=>{if(!b)return;let e=F.current.get(b);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`})}},[b]),XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{te(e),setTimeout(()=>te(null),3e3)},[])});let ie=()=>{k(null),e?.client.mark.requestAssist(`linking`,{entityTypes:E,includeDescriptiveReferences:M,language:S,sourceLanguage:C})},ae=(0,y.useRef)(!1);(0,y.useEffect)(()=>{if(i){ae.current=!1;return}!ae.current&&a?.completedItems&&(ae.current=!0,k(a.completedItems),D([]))},[i,a?.completedItems]);let oe=e=>{j(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,y.useEffect)(()=>{if(!g)return;let t=t=>{t.key===`Escape`&&(e?.client.mark.cancelPending(),j([]))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[g,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`reference`,count:r.length,title:w(`title`)}),g&&g.motivation===`linking`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`reference`,children:[(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(()=>{let e=wY(g.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:w(`fragmentSelected`)})()}),l.length>0&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`p`,{className:`semiont-form-field__label`,children:w(`entityTypesOptional`)}),(0,R.jsx)(`div`,{className:`semiont-tag-selector`,children:l.map(e=>(0,R.jsx)(`button`,{onClick:()=>oe(e),className:`semiont-tag-selector__item`,"data-selected":A.includes(e)?`true`:`false`,children:e},e))})]}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt__actions`,children:[(0,R.jsx)(`button`,{onClick:()=>{e?.client.mark.cancelPending(),j([])},className:`semiont-button semiont-button--secondary`,"data-type":`reference`,children:w(`cancel`)}),(0,R.jsxs)(`button`,{onClick:()=>{if(g){let t=A.join(`,`)||void 0;e?.client.mark.submit({source:n,motivation:`linking`,selector:g.selector,...t?{body:[{type:`TextualBody`,value:t,purpose:`tagging`}]}:{}}),j([])}},className:`semiont-button semiont-button--primary`,"data-type":`reference`,children:[`🔗 `,w(`createReference`)]})]})})]}),(0,R.jsxs)(`div`,{ref:P,className:`semiont-panel__content`,children:[o&&(0,R.jsx)(AU,{assistType:`reference`,title:w(`annotateReferences`),isAssisting:i,progress:a,progressProps:{onCancel:()=>e?.client.job.cancelRequest(`annotation`),onDismiss:()=>e?.client.mark.dismissProgress(),translations:rY(T,{found:e=>w(`found`,{count:e})})},form:(0,R.jsxs)(R.Fragment,{children:[O&&(0,R.jsx)(OU,{entries:O,formatFound:e=>w(`found`,{count:e})}),(0,R.jsxs)(`div`,{className:`semiont-assist-widget__entity-types`,children:[(0,R.jsx)(`p`,{className:`semiont-assist-widget__label`,children:w(`selectEntityTypes`)}),(0,R.jsx)(`div`,{className:`semiont-assist-widget__chips`,children:l.length>0?l.map(e=>(0,R.jsx)(`button`,{onClick:()=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},"aria-pressed":E.includes(e),"aria-label":`${E.includes(e)?w(`deselect`):w(`select`)} ${e}`,className:`semiont-chip semiont-chip--selectable`,"data-selected":E.includes(e),children:e},e)):(0,R.jsx)(`p`,{className:`semiont-assist-widget__no-types`,children:w(u?`entityTypesFailed`:`noEntityTypes`)})})]}),E.length>0&&(0,R.jsx)(`p`,{className:`semiont-assist-widget__count`,children:w(`typesSelected`,{count:E.length})}),(0,R.jsxs)(`div`,{className:`semiont-assist-widget__checkbox-group`,children:[(0,R.jsxs)(`label`,{className:`semiont-assist-widget__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>ee(e.target.checked),className:`semiont-assist-widget__checkbox`}),(0,R.jsx)(`span`,{children:w(`includeDescriptiveReferences`)})]}),(0,R.jsx)(`p`,{className:`semiont-assist-widget__checkbox-hint`,children:w(`descriptiveReferencesTooltip`)})]}),(0,R.jsxs)(`button`,{onClick:ie,disabled:E.length===0,title:w(`annotate`),className:`semiont-button`,"data-variant":`assist`,"data-type":`reference`,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:w(`annotate`)})]})]})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,R.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[w(`outgoingReferences`),` (`,ne.length,`)`]})}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:ne.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty-message`,children:w(`noReferences`)}):ne.map(n=>(0,R.jsx)(CY,{session:e,reference:n,isFocused:n.id===N,isHovered:n.id===b,onOpenResource:t,annotateMode:o,isGenerating:n.id===d,sparkle:x?.has(n.id)??!1,ref:e=>re(n.id,e)},n.id))})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-panel__divider`,children:(0,R.jsxs)(`h3`,{className:`semiont-panel__subtitle`,children:[w(`incomingReferences`),` (`,f.length,`)`,p&&!m&&(0,R.jsxs)(`span`,{className:`semiont-panel__loading-indicator`,children:[`(`,w(`loading`),`)`]})]})}),m?(0,R.jsxs)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:[w(`incomingReferencesFailed`),h&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:h,className:`semiont-panel__inline-action`,children:w(`retry`)})]})]}):f.length>0?(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:f.map(e=>{let t=e.target.source;return(0,R.jsxs)(`div`,{className:`semiont-reference-item semiont-reference-item--incoming`,children:[(0,R.jsxs)(`div`,{className:`semiont-reference-item__header`,children:[(0,R.jsx)(`span`,{className:`semiont-reference-item__title`,children:e.resourceName||w(`untitledResource`)}),(0,R.jsx)(s,{href:c.resourceDetail(t),className:`semiont-reference-item__link`,title:w(`open`),children:`🔗`})]}),(0,R.jsxs)(`span`,{className:`semiont-reference-item__excerpt`,children:[`"`,e.target.selector?.exact||w(`noText`),`"`]})]},e.id)})}):(0,R.jsx)(`p`,{className:`semiont-panel__empty-message semiont-panel__empty-message--small`,children:w(p?`loadingEllipsis`:`noIncomingReferences`)})]})]})]})}function EY({session:e,resourceId:t,documentEntityTypes:n,documentLocale:r,primaryMediaType:i,primaryByteSize:a,storageUri:o,isArchived:s=!1,dateCreated:c,dateModified:l,wasAttributedTo:u,wasDerivedFrom:d,generator:f,onGenerate:p,isGenerating:m=!1,generationProgress:h=null,generationOutcome:g=null,onDismissProgress:_}){let v=ah(`ResourceInfoPanel`),y=ah(`AssistProgress`),b=u?Array.isArray(u)?u:[u]:f?Array.isArray(f)?f:[f]:[];return(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__title`,children:v(`title`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`locale`)}),r?(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__value`,children:ri(r)}):(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__value semiont-resource-info-panel__value--empty`,children:v(`notSpecified`)})]}),(i||a!==void 0)&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`representation`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[i&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`mediaType`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:i})]}),a!==void 0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`byteSize`)}),(0,R.jsxs)(`span`,{className:`semiont-resource-info-panel__value`,children:[a.toLocaleString(),` bytes`]})]}),o&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`storageUri`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:o})]})]})]}),(c||l||b.length>0||d)&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`provenance`)}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__field-group`,children:[c&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`createdAt`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(c).toLocaleString()})]}),l&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`modifiedAt`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:new Date(l).toLocaleString()})]}),b.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`attributedTo`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:b.map(qJ).join(`, `)})]}),d&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__label`,children:v(`derivedFrom`)}),(0,R.jsx)(`span`,{className:`semiont-resource-info-panel__value`,children:(Array.isArray(d)?d:[d]).map((t,n)=>(0,R.jsx)(DY,{session:e,id:t,first:n===0},t))})]})]})]}),n.length>0&&(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__section`,children:[(0,R.jsx)(`h3`,{className:`semiont-resource-info-panel__heading`,children:v(`entityTypeTags`)}),(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__tag-list`,children:n.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:e},e))})]}),p&&(0,R.jsx)(AU,{assistType:`generation`,title:v(`generate`),isAssisting:m,progress:h,progressProps:{onCancel:()=>e?.client.job.cancelRequest(`generation`),..._?{onDismiss:_}:{},...g?{outcome:{label:g.resourceName,onOpen:()=>e?.client.browse.openResource(g.resourceId)},endedMessage:g.truncated?y(`codeCompleteGeneratedTruncated`):y(`codeCompleteGenerated`)}:{},translations:rY(y)},form:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:p,className:`semiont-resource-button semiont-resource-button--secondary`,children:[`✨ `,v(`generate`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`generateDescription`)})]})}),(0,R.jsxs)(`div`,{className:`semiont-resource-info-panel__action-section`,children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.yield.clone(),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`🔗 `,v(`clone`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`cloneDescription`)})]}),(0,R.jsx)(`div`,{className:`semiont-resource-info-panel__action-section`,children:s?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.mark.unarchive(cr(t)),className:`semiont-resource-button semiont-resource-button--secondary`,children:[`📤 `,v(`unarchive`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`unarchiveDescription`)})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{onClick:()=>e?.client.mark.archive(cr(t)),className:`semiont-resource-button semiont-resource-button--archive`,children:[`📦 `,v(`archive`)]}),(0,R.jsx)(`p`,{className:`semiont-resource-info-panel__description`,children:v(`archiveDescription`)})]})})]})}function DY({session:e,id:t,first:n}){let r=Z(e?e.client.browse.resource(cr(t)):null),i=r?Wc(r)?.name:void 0;return(0,R.jsxs)(`button`,{className:`semiont-resource-info-panel__link`,onClick:()=>e?.client.browse.openResource(cr(t)),children:[!n&&`, `,i??t]})}function OY({highlights:e,comments:t,assessments:n,references:r,tags:i}){let a=ah(`StatisticsPanel`),o=r.filter(e=>!br(e.body)).length,s=r.filter(e=>br(e.body)).length,c=new Map;r.forEach(e=>{yY(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,R.jsx)(`div`,{className:`semiont-statistics-panel`,children:(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__content`,children:[(0,R.jsx)(`h2`,{className:`semiont-statistics-panel__title`,children:a(`title`)}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__list`,children:[(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`highlights`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:e.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`comments`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:t.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`assessments`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:n.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`tags`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:i.length})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`references`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__value`,children:r.length}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitems`,children:[(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`stub`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:o})]}),(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__subitem`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__sublabel`,children:a(`resolved`)}),(0,R.jsx)(`span`,{className:`semiont-statistics-panel__subvalue`,children:s})]})]})]}),l.length>0&&(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__entity-types`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__label`,children:a(`entityTypes`)}),(0,R.jsx)(`div`,{className:`semiont-statistics-panel__entity-list`,children:l.map(([e,t])=>(0,R.jsxs)(`div`,{className:`semiont-statistics-panel__entity-item`,children:[(0,R.jsx)(`span`,{className:`semiont-statistics-panel__entity-name`,children:e}),(0,R.jsx)(`span`,{className:`semiont-tag`,"data-variant":`blue`,children:t})]},e))})]})]})]})})}function kY({session:e,tag:t,isFocused:n,isHovered:r=!1,ref:i}){let a=IF(e,t.id),o=Ar(t),s=xY(t),c=SY(t),l=Z((0,y.useMemo)(()=>e?.client.browse.tagSchemas()??null,[e])),u=c&&l&&Uc(l)?l.value.find(e=>e.id===c)??null:null;return(0,R.jsxs)(`div`,{ref:i,onClick:()=>{e?.client.browse.click(t.id)},...a,className:`semiont-annotation-entry${r?` semiont-annotation-pulse`:``}`,"data-type":`tag`,"data-focused":n?`true`:`false`,children:[(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__header`,children:[(0,R.jsx)(`span`,{className:`semiont-tag-badge`,"data-variant":`tag`,children:s}),u&&(0,R.jsx)(`span`,{className:`semiont-annotation-entry__meta`,children:u.name})]}),(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__quote`,"data-type":`tag`,children:[`"`,o.substring(0,150),o.length>150?`...`:``,`"`]}),t.generator&&(0,R.jsxs)(`div`,{className:`semiont-annotation-entry__metadata`,children:[`Via `,Array.isArray(t.generator)?t.generator.map(qJ).join(`, `):qJ(t.generator)]})]})}function AY(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 jY({session:e,resourceId:t,annotations:n,annotateMode:r=!0,isAssisting:i=!1,progress:a,pendingAnnotation:o,scrollToAnnotationId:s,onScrollCompleted:c,hoveredAnnotationId:l,locale:u,sourceLanguage:d}){let f=ah(`TaggingPanel`),p=ah(`AssistProgress`),m=(0,y.useCallback)(()=>{e?.client.mark.dismissProgress()},[e]),h=Z((0,y.useMemo)(()=>e?.client.browse.tagSchemas()??null,[e])),g=h&&Uc(h)?h.value:void 0,_=g??[],v=g!==void 0&&g.length===0,[b,x]=(0,y.useState)(``),[S,C]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{!b&&_.length>0&&x(_[0].id)},[_,b]);let[w,T]=(0,y.useState)(null),E=(0,y.useRef)(null);XF(e,{"browse:click":(0,y.useCallback)(({annotationId:e})=>{T(e),setTimeout(()=>T(null),3e3)},[])});let D=(0,y.useRef)(new Map),O=(0,y.useMemo)(()=>[...n].sort((e,t)=>{let n=gr(xr(e.target)),r=gr(xr(t.target));return!n||!r?0:n.start-r.start}),[n]),k=(0,y.useCallback)((e,t)=>{t?D.current.set(e,t):D.current.delete(e)},[]);(0,y.useEffect)(()=>{if(!s)return;let e=D.current.get(s);if(e&&E.current){let t=e.offsetTop,n=E.current.clientHeight,r=e.offsetHeight,i=t-n/2+r/2;E.current.scrollTo({top:i,behavior:`smooth`}),e.classList.remove(`semiont-annotation-pulse`),e.offsetWidth,e.classList.add(`semiont-annotation-pulse`),c&&c()}},[s]),(0,y.useEffect)(()=>{if(!l)return;let e=D.current.get(l);if(!e||!E.current)return;let t=E.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]);let A=_.find(e=>e.id===b),j=e=>{x(e),C(new Set)},M=e=>{let t=new Set(S);t.has(e)?t.delete(e):t.add(e),C(t)};return(0,y.useEffect)(()=>{if(!o)return;let t=t=>{t.key===`Escape`&&e?.client.mark.cancelPending()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[o,e]),(0,R.jsxs)(`div`,{className:`semiont-panel`,children:[(0,R.jsx)(aY,{annotationType:`tag`,count:n.length,title:f(`title`)}),(0,R.jsxs)(`div`,{ref:E,className:`semiont-panel__content`,children:[o&&o.motivation===`tagging`&&(0,R.jsxs)(`div`,{className:`semiont-annotation-prompt`,"data-type":`tag`,children:[(0,R.jsx)(`h3`,{className:`semiont-annotation-prompt__title`,children:f(`createTagForSelection`)}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__quote`,children:(0,R.jsx)(`p`,{className:`semiont-annotation-prompt__text`,children:(()=>{let e=AY(o.selector);return e?`"${e.substring(0,100)}${e.length>100?`...`:``}"`:f(`fragmentSelected`)})()})}),v&&(0,R.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!v&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,R.jsx)(`select`,{value:b,onChange:e=>j(e.target.value),className:`semiont-select`,children:_.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),A&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategory`)}),(0,R.jsxs)(`select`,{className:`semiont-select`,onChange:n=>{n.target.value&&o&&e?.client.mark.submit({source:t,motivation:`tagging`,selector:o.selector,body:[{type:`TextualBody`,value:n.target.value,purpose:`tagging`},{type:`TextualBody`,value:b,purpose:`classifying`}]})},defaultValue:``,children:[(0,R.jsx)(`option`,{value:``,children:f(`chooseCategory`)}),A.tags.map(e=>(0,R.jsx)(`option`,{value:e.name,children:e.name},e.name))]})]}),(0,R.jsx)(`div`,{className:`semiont-annotation-prompt__footer`,children:(0,R.jsx)(`button`,{onClick:()=>e?.client.mark.cancelPending(),className:`semiont-button semiont-button--secondary`,"data-type":`tag`,children:f(`cancel`)})})]}),r&&(0,R.jsx)(AU,{assistType:`tag`,title:f(`annotateTags`),isAssisting:i,progress:a,progressProps:{onDismiss:m,translations:rY(p)},form:(0,R.jsxs)(R.Fragment,{children:[v&&(0,R.jsx)(`p`,{className:`semiont-form__help`,"data-type":`tag-no-schemas`,children:f(`noSchemas`)}),!v&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectSchema`)}),(0,R.jsx)(`select`,{value:b,onChange:e=>j(e.target.value),className:`semiont-select`,children:_.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))}),A&&(0,R.jsx)(`p`,{className:`semiont-form__help`,children:A.description})]}),A&&(0,R.jsxs)(`div`,{className:`semiont-form-field`,children:[(0,R.jsx)(`label`,{className:`semiont-form-field__label`,children:f(`selectCategories`)}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`,marginBottom:`0.75rem`},children:[(0,R.jsx)(`button`,{onClick:()=>{A&&C(new Set(A.tags.map(e=>e.name)))},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`selectAll`)}),(0,R.jsx)(`button`,{onClick:()=>{C(new Set)},type:`button`,className:`semiont-button--secondary`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.25rem 0.5rem`},children:f(`deselectAll`)})]}),(0,R.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`0.75rem`},children:A.tags.map(e=>(0,R.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,R.jsx)(`input`,{type:`checkbox`,id:`category-${e.name.replace(/\s+/g,`-`)}`,checked:S.has(e.name),onChange:()=>M(e.name),className:`semiont-checkbox`}),(0,R.jsxs)(`label`,{htmlFor:`category-${e.name.replace(/\s+/g,`-`)}`,className:`semiont-form__checkbox-label`,style:{display:`flex`,flexDirection:`column`,gap:`0.25rem`},children:[(0,R.jsx)(`span`,{style:{fontWeight:500},children:e.name}),(0,R.jsx)(`span`,{style:{fontSize:`var(--semiont-text-xs)`,color:`var(--semiont-text-secondary)`},children:e.description})]})]},e.name))}),(0,R.jsx)(`p`,{className:`semiont-form__help`,children:f(`categoriesSelected`,{count:S.size})})]}),(0,R.jsxs)(`button`,{onClick:()=>{S.size>0&&(e?.client.mark.requestAssist(`tagging`,{schemaId:b,categories:Array.from(S),language:u,sourceLanguage:d}),C(new Set))},disabled:S.size===0||i,className:`semiont-button`,"data-variant":`assist`,"data-type":`tag`,children:[(0,R.jsx)(`span`,{className:`semiont-button-icon`,children:`✨`}),(0,R.jsx)(`span`,{children:f(`annotate`)})]})]})}),(0,R.jsx)(`div`,{className:`semiont-panel__list`,children:O.length===0?(0,R.jsx)(`p`,{className:`semiont-panel__empty`,children:f(`noTags`)}):O.map(t=>(0,R.jsx)(kY,{session:e,tag:t,isFocused:t.id===w,isHovered:t.id===l,ref:e=>k(t.id,e)},t.id))})]})]})}var MY=[`statistics`,`reference`,`highlight`,`assessment`,`comment`,`tag`];function NY(e){let t=ah(`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,y.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&&MY.includes(n)?n:e.initialTab||`statistics`});(0,y.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,y.useEffect)(()=>{e.initialTab&&e.initialTabGeneration!==void 0&&a(e.initialTab)},[e.initialTabGeneration]),(0,y.useEffect)(()=>{if(e.pendingAnnotation){let t=iT(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 e.annotationsError?(0,R.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,R.jsxs)(`p`,{className:`semiont-unified-panel__error`,children:[t(`annotationsFailed`),e.onRetryAnnotations&&(0,R.jsxs)(R.Fragment,{children:[` `,(0,R.jsx)(`button`,{type:`button`,onClick:e.onRetryAnnotations,className:`semiont-panel__inline-action`,children:t(`retry`)})]})]})]}):(0,R.jsxs)(`div`,{className:`semiont-unified-panel`,children:[(0,R.jsx)(`h3`,{className:`semiont-unified-panel__title`,children:t(`title`)}),(0,R.jsx)(`div`,{className:`semiont-unified-panel__tabs`,children:MY.map(n=>{if(n===`statistics`)return(0,R.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,R.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:`📊`})},n);let r=e.annotators[n];return r?(0,R.jsx)(`button`,{onClick:()=>o(n),className:s(n),title:t(n),"aria-pressed":i===n,children:(0,R.jsx)(`span`,{className:`semiont-unified-panel__tab-icon`,children:r.iconEmoji})},n):null})}),(0,R.jsx)(`div`,{className:`semiont-unified-panel__content`,children:(()=>{if(i===`statistics`)return(0,R.jsx)(OY,{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={session:e.session,resourceId:e.resourceId,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,R.jsx)(gY,{...s}):i===`reference`?(0,R.jsx)(TY,{session:s.session,onOpenResource:e.onOpenResource,resourceId:s.resourceId,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||[],entityTypesError:e.entityTypesError,generatingReferenceId:e.generatingReferenceId,referencedBy:e.referencedBy,referencedByLoading:e.referencedByLoading,referencedByError:e.referencedByError,onRetryReferencedBy:e.onRetryReferencedBy,sparkleAnnotationIds:e.sparkleAnnotationIds,Link:e.Link,routes:e.routes}):i===`assessment`?(0,R.jsx)(sY,{...s}):i===`comment`?(0,R.jsx)(pY,{...s}):i===`tag`?(0,R.jsx)(jY,{...s}):null})()})]})}function PY({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,y.useState)(!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`footer`,{role:`contentinfo`,className:`semiont-footer`,children:(0,R.jsx)(`div`,{className:`semiont-footer__container`,children:(0,R.jsxs)(`div`,{className:`semiont-footer__content`,children:[(0,R.jsx)(`div`,{className:`semiont-footer__copyright`,children:n(`copyright`,{year:new Date().getFullYear()})}),(0,R.jsxs)(`div`,{className:`semiont-footer__links`,children:[o&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e,{href:t.about?.()||`/about`,className:`semiont-footer__link`,children:n(`about`)}),(0,R.jsx)(e,{href:t.privacy?.()||`/privacy`,className:`semiont-footer__link`,children:n(`privacyPolicy`)}),r&&(0,R.jsx)(`button`,{onClick:()=>c(!0),className:`semiont-footer__link`,children:n(`cookiePreferences`)}),(0,R.jsx)(e,{href:t.terms?.()||`/terms`,className:`semiont-footer__link`,children:n(`termsOfService`)})]}),i&&(0,R.jsxs)(`button`,{onClick:i,className:`semiont-footer__link semiont-footer__link--keyboard`,children:[n(`keyboardShortcuts`),(0,R.jsx)(`kbd`,{className:`semiont-footer__kbd`,children:`?`})]}),(0,R.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,className:`semiont-footer__link`,children:n(`sourceCode`)})]})]})})}),o&&r&&(0,R.jsx)(r,{isOpen:s,onClose:()=>c(!1)})]})}function FY({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,R.jsxs)(`nav`,{className:c,"aria-label":`Main navigation`,children:[(0,R.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,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,R.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,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`hr`,{className:`semiont-navigation-menu__divider`}),(0,R.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 IY({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,y.useState)(!1),p=(0,y.useRef)(null),m=Sm(),h=()=>f(!d),g=()=>f(!1);return(0,y.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&g()};if(d)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,R.jsxs)(`div`,{className:`semiont-simple-nav`,children:[(0,R.jsxs)(`div`,{style:{position:`relative`},ref:i?p:void 0,children:[(0,R.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[i?(0,R.jsx)(`button`,{onClick:h,className:`semiont-nav-section__header-button`,"aria-expanded":d,"aria-haspopup":`true`,type:`button`,children:!a&&(0,R.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e})}):!a&&(0,R.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:e}),(0,R.jsx)(`button`,{onClick:()=>m.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,R.jsx)(u,{}):(0,R.jsx)(l,{})})]}),d&&i&&!a&&(0,R.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:i(g)})]}),!a&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),a&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:t.map(e=>{let t=n===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})})]})}function LY(){var e=[...arguments];return(0,y.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var RY=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function zY(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function BY(e){return`nodeType`in e}function VY(e){return e?zY(e)?e:BY(e)?e.ownerDocument?.defaultView??window:window:window}function HY(e){let{Document:t}=VY(e);return e instanceof t}function UY(e){return!zY(e)&&e instanceof VY(e).HTMLElement}function WY(e){return e instanceof VY(e).SVGElement}function GY(e){return e?zY(e)?e.document:BY(e)?HY(e)?e:UY(e)||WY(e)?e.ownerDocument:document:document:document}var KY=RY?y.useLayoutEffect:y.useEffect;function qY(e){let t=(0,y.useRef)(e);return KY(()=>{t.current=e}),(0,y.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function JY(){let e=(0,y.useRef)(null);return[(0,y.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,y.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function YY(e,t){t===void 0&&(t=[e]);let n=(0,y.useRef)(e);return KY(()=>{n.current!==e&&(n.current=e)},t),n}function XY(e,t){let n=(0,y.useRef)();return(0,y.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ZY(e){let t=qY(e),n=(0,y.useRef)(null);return[n,(0,y.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function QY(e){let t=(0,y.useRef)();return(0,y.useEffect)(()=>{t.current=e},[e]),t.current}var $Y={};function eX(e,t){return(0,y.useMemo)(()=>{if(t)return t;let n=$Y[e]==null?0:$Y[e]+1;return $Y[e]=n,e+`-`+n},[e,t])}function tX(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 nX=tX(1),rX=tX(-1);function iX(e){return`clientX`in e&&`clientY`in e}function aX(e){if(!e)return!1;let{KeyboardEvent:t}=VY(e.target);return t&&e instanceof t}function oX(e){if(!e)return!1;let{TouchEvent:t}=VY(e.target);return t&&e instanceof t}function sX(e){if(oX(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return iX(e)?{x:e.clientX,y:e.clientY}:null}var cX=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[cX.Translate.toString(e),cX.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),lX=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function uX(e){return e.matches(lX)?e:e.querySelector(lX)}var dX={display:`none`};function fX(e){let{id:t,value:n}=e;return y.createElement(`div`,{id:t,style:dX},n)}function pX(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return y.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 mX(){let[e,t]=(0,y.useState)(``);return{announce:(0,y.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var hX=(0,y.createContext)(null);function gX(e){let t=(0,y.useContext)(hX);(0,y.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function _X(){let[e]=(0,y.useState)(()=>new Set),t=(0,y.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,y.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var vX={draggable:`
135
135
  To pick up a draggable item, press the space bar.
136
136
  While dragging, use the arrow keys to move the item.
137
137
  Press space again to drop the item in its new position, or press escape to cancel.
138
138
  `},yX={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 bX(e){let{announcements:t=yX,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=vX}=e,{announce:a,announcement:o}=mX(),s=eX(`DndLiveRegion`),[c,l]=(0,y.useState)(!1);if((0,y.useEffect)(()=>{l(!0)},[]),gX((0,y.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=y.createElement(y.Fragment,null,y.createElement(fX,{id:r,value:i.draggable}),y.createElement(pX,{id:s,announcement:o}));return n?(0,lu.createPortal)(u,n):u}var xX;(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`})(xX||={});function SX(){}function CX(e,t){return(0,y.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function wX(){var e=[...arguments];return(0,y.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var TX=Object.freeze({x:0,y:0});function EX(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function DX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function OX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function kX(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 AX(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function jX(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 MX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=jX(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=EX(jX(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(DX)},NX=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=kX(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=kX(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(DX)};function PX(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 FX=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=PX(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(OX)};function IX(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function LX(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:TX}function RX(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 zX=RX(1);function BX(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]}}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 VX(e,t,n){let r=BX(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 HX={ignoreTransform:!1};function UX(e,t){t===void 0&&(t=HX);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=VY(e).getComputedStyle(e);t&&(n=VX(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 WX(e){return UX(e,{ignoreTransform:!0})}function GX(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function KX(e,t){return t===void 0&&(t=VY(e).getComputedStyle(e)),t.position===`fixed`}function qX(e,t){t===void 0&&(t=VY(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)})}function JX(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(HY(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!UY(i)||WY(i)||n.includes(i))return n;let a=VY(e).getComputedStyle(i);return i!==e&&qX(i,a)&&n.push(i),KX(i,a)?n:r(i.parentNode)}return e?r(e):n}function YX(e){let[t]=JX(e,1);return t??null}function XX(e){return!RY||!e?null:zY(e)?e:BY(e)?HY(e)||e===GY(e).scrollingElement?window:UY(e)?e:null:null}function ZX(e){return zY(e)?e.scrollX:e.scrollLeft}function QX(e){return zY(e)?e.scrollY:e.scrollTop}function $X(e){return{x:ZX(e),y:QX(e)}}var eZ;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(eZ||={});function tZ(e){return!RY||!e?!1:e===document.scrollingElement}function nZ(e){let t={x:0,y:0},n=tZ(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 rZ={x:.2,y:.2};function iZ(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=rZ);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=nZ(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=eZ.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=eZ.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=eZ.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=eZ.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function aZ(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 oZ(e){return e.reduce((e,t)=>nX(e,$X(t)),TX)}function sZ(e){return e.reduce((e,t)=>e+ZX(t),0)}function cZ(e){return e.reduce((e,t)=>e+QX(t),0)}function lZ(e,t){if(t===void 0&&(t=UX),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);YX(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var uZ=[[`x`,[`left`,`right`],sZ],[`y`,[`top`,`bottom`],cZ]],dZ=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=JX(t),r=oZ(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of uZ)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})}},fZ=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 pZ(e){let{EventTarget:t}=VY(e);return e instanceof t?e:GY(e)}function mZ(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}var hZ;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(hZ||={});function gZ(e){e.preventDefault()}function _Z(e){e.stopPropagation()}var vZ;(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`})(vZ||={});var yZ={start:[vZ.Space,vZ.Enter],cancel:[vZ.Esc],end:[vZ.Space,vZ.Enter,vZ.Tab]},bZ=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case vZ.Right:return{...n,x:n.x+25};case vZ.Left:return{...n,x:n.x-25};case vZ.Down:return{...n,y:n.y+25};case vZ.Up:return{...n,y:n.y-25}}},xZ=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 fZ(GY(t)),this.windowListeners=new fZ(VY(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hZ.Resize,this.handleCancel),this.windowListeners.add(hZ.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hZ.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&lZ(n),t(TX)}handleKeyDown(e){if(aX(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=yZ,coordinateGetter:a=bZ,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}:TX;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=rX(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}=nZ(n),p=aZ(n),m={x:Math.min(i===vZ.Right?p.right-p.width/2:p.right,Math.max(i===vZ.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===vZ.Down?p.bottom-p.height/2:p.bottom,Math.max(i===vZ.Down?p.top:p.top+p.height/2,u.y))},h=i===vZ.Right&&!s||i===vZ.Left&&!c,g=i===vZ.Down&&!l||i===vZ.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===vZ.Right&&e<=d.x||i===vZ.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===vZ.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===vZ.Down&&e<=d.y||i===vZ.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===vZ.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,nX(rX(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()}};xZ.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=yZ,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 SZ(e){return!!(e&&`distance`in e)}function CZ(e){return!!(e&&`delay`in e)}var wZ=class{constructor(e,t,n){n===void 0&&(n=pZ(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=GY(i),this.documentListeners=new fZ(this.document),this.listeners=new fZ(n),this.windowListeners=new fZ(VY(i)),this.initialCoordinates=sX(r)??TX,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(hZ.Resize,this.handleCancel),this.windowListeners.add(hZ.DragStart,gZ),this.windowListeners.add(hZ.VisibilityChange,this.handleCancel),this.windowListeners.add(hZ.ContextMenu,gZ),this.documentListeners.add(hZ.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(CZ(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(SZ(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(hZ.Click,_Z,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hZ.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=sX(e)??TX,s=rX(n,o);if(!t&&a){if(SZ(a)){if(a.tolerance!=null&&mZ(s,a.tolerance))return this.handleCancel();if(mZ(s,a.distance))return this.handleStart()}if(CZ(a)&&mZ(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===vZ.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},TZ={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},EZ=class extends wZ{constructor(e){let{event:t}=e,n=GY(t.target);super(e,TZ,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 DZ={move:{name:`mousemove`},end:{name:`mouseup`}},OZ;(function(e){e[e.RightClick=2]=`RightClick`})(OZ||={});var kZ=class extends wZ{constructor(e){super(e,DZ,GY(e.event.target))}};kZ.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==OZ.RightClick&&(r?.({event:n}),!0)}}];var AZ={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},jZ=class extends wZ{constructor(e){super(e,AZ)}static setup(){return window.addEventListener(AZ.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(AZ.move.name,e)};function e(){}}};jZ.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 MZ;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(MZ||={});var NZ;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(NZ||={});function PZ(e){let{acceleration:t,activator:n=MZ.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=NZ.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=IZ({delta:d,disabled:!a}),[m,h]=JY(),g=(0,y.useRef)({x:0,y:0}),_=(0,y.useRef)({x:0,y:0}),v=(0,y.useMemo)(()=>{switch(n){case MZ.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case MZ.DraggableRect:return i}},[n,i,c]),b=(0,y.useRef)(null),x=(0,y.useCallback)(()=>{let e=b.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),S=(0,y.useMemo)(()=>s===NZ.TreeOrder?[...l].reverse():l,[s,l]);(0,y.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of S){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=iZ(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),b.current=e,m(x,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,x,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,S,u,JSON.stringify(f)])}var FZ={x:{[eZ.Backward]:!1,[eZ.Forward]:!1},y:{[eZ.Backward]:!1,[eZ.Forward]:!1}};function IZ(e){let{delta:t,disabled:n}=e,r=QY(t);return XY(e=>{if(n||!r||!e)return FZ;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[eZ.Backward]:e.x[eZ.Backward]||i.x===-1,[eZ.Forward]:e.x[eZ.Forward]||i.x===1},y:{[eZ.Backward]:e.y[eZ.Backward]||i.y===-1,[eZ.Forward]:e.y[eZ.Forward]||i.y===1}}},[n,t,r])}function LZ(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return XY(e=>t==null?null:r??e??null,[r,t])}function RZ(e,t){return(0,y.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 zZ;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(zZ||={});var BZ;(function(e){e.Optimized=`optimized`})(BZ||={});var VZ=new Map;function HZ(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,y.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,y.useRef)(e),d=g(),f=YY(d),p=(0,y.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,y.useRef)(null),h=XY(t=>{if(d&&!n)return VZ;if(!t||t===VZ||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 dZ(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,y.useEffect)(()=>{u.current=e},[e]),(0,y.useEffect)(()=>{d||p()},[n,d]),(0,y.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,y.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case zZ.Always:return!1;case zZ.BeforeDragging:return n;default:return!n}}}function UZ(e,t){return XY(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function WZ(e,t){return UZ(e,t)}function GZ(e){let{callback:t,disabled:n}=e,r=qY(t),i=(0,y.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,y.useEffect)(()=>()=>i?.disconnect(),[i]),i}function KZ(e){let{callback:t,disabled:n}=e,r=qY(t),i=(0,y.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,y.useEffect)(()=>()=>i?.disconnect(),[i]),i}function qZ(e){return new dZ(UX(e),e)}function JZ(e,t,n){t===void 0&&(t=qZ);let[r,i]=(0,y.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=GZ({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=KZ({callback:a});return KY(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function YZ(e){return LX(e,UZ(e))}var XZ=[];function ZZ(e){let t=(0,y.useRef)(e),n=XY(n=>e?n&&n!==XZ&&e&&t.current&&e.parentNode===t.current.parentNode?n:JX(e):XZ,[e]);return(0,y.useEffect)(()=>{t.current=e},[e]),n}function QZ(e){let[t,n]=(0,y.useState)(null),r=(0,y.useRef)(e),i=(0,y.useCallback)(e=>{let t=XX(e.target);t&&n(e=>e?(e.set(t,$X(t)),new Map(e)):null)},[]);return(0,y.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=XX(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,$X(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=>{XX(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,y.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>nX(e,t),TX):oZ(e):TX,[e,t])}function $Z(e,t){t===void 0&&(t=[]);let n=(0,y.useRef)(null);return(0,y.useEffect)(()=>{n.current=null},t),(0,y.useEffect)(()=>{let t=e!==TX;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?rX(e,n.current):TX}function eQ(e){(0,y.useEffect)(()=>{if(!RY)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 tQ(e,t){return(0,y.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function nQ(e){return(0,y.useMemo)(()=>e?GX(e):null,[e])}var rQ=[];function iQ(e,t){t===void 0&&(t=UX);let[n]=e,r=nQ(n?VY(n):null),[i,a]=(0,y.useState)(rQ);function o(){a(()=>e.length?e.map(e=>tZ(e)?r:new dZ(t(e),e)):rQ)}let s=KZ({callback:o});return KY(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function aQ(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return UY(t)?t:e}function oQ(e){let{measure:t}=e,[n,r]=(0,y.useState)(null),i=KZ({callback:(0,y.useCallback)(e=>{for(let{target:n}of e)if(UY(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=ZY((0,y.useCallback)(e=>{let n=aQ(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,y.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var sQ=[{sensor:EZ,options:{}},{sensor:xZ,options:{}}],cQ={current:{}},lQ={draggable:{measure:WX},droppable:{measure:WX,strategy:zZ.WhileDragging,frequency:BZ.Optimized},dragOverlay:{measure:UX}},uQ=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}},dQ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new uQ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:SX},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lQ,measureDroppableContainers:SX,windowRect:null,measuringScheduled:!1},fQ=(0,y.createContext)({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:SX,draggableNodes:new Map,over:null,measureDroppableContainers:SX}),pQ=(0,y.createContext)(dQ);function mQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new uQ}}}function hQ(e,t){switch(t.type){case xX.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xX.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 xX.DragEnd:case xX.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xX.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new uQ(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case xX.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 uQ(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case xX.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new uQ(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function gQ(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,y.useContext)(fQ),a=QY(r),o=QY(n?.id);return(0,y.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!aX(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=uX(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function _Q(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function vQ(e){return(0,y.useMemo)(()=>({draggable:{...lQ.draggable,...e?.draggable},droppable:{...lQ.droppable,...e?.droppable},dragOverlay:{...lQ.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function yQ(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,y.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;KY(()=>{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=LX(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=YX(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var bQ=(0,y.createContext)({...TX,scaleX:1,scaleY:1}),xQ;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(xQ||={});var SQ=(0,y.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=sQ,collisionDetection:o=FX,measuring:s,modifiers:c,...l}=e,[u,d]=(0,y.useReducer)(hQ,void 0,mQ),[f,p]=_X(),[m,h]=(0,y.useState)(xQ.Uninitialized),g=m===xQ.Initialized,{draggable:{active:_,nodes:v,translate:b},droppable:{containers:x}}=u,S=_==null?null:v.get(_),C=(0,y.useRef)({initial:null,translated:null}),w=(0,y.useMemo)(()=>_==null?null:{id:_,data:S?.data??cQ,rect:C},[_,S]),T=(0,y.useRef)(null),[E,D]=(0,y.useState)(null),[O,k]=(0,y.useState)(null),A=YY(l,Object.values(l)),j=eX(`DndDescribedBy`,t),M=(0,y.useMemo)(()=>x.getEnabled(),[x]),ee=vQ(s),{droppableRects:N,measureDroppableContainers:te,measuringScheduled:P}=HZ(M,{dragging:g,dependencies:[b.x,b.y],config:ee.droppable}),F=LZ(v,_),ne=(0,y.useMemo)(()=>O?sX(O):null,[O]),re=Ae(),ie=WZ(F,ee.draggable.measure);yQ({activeNode:_==null?null:v.get(_),config:re.layoutShiftCompensation,initialRect:ie,measure:ee.draggable.measure});let ae=JZ(F,ee.draggable.measure,ie),oe=JZ(F?F.parentElement:null),se=(0,y.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),I=x.getNodeFor(se.current.over?.id),L=oQ({measure:ee.dragOverlay.measure}),ce=L.nodeRef.current??F,le=g?L.rect??ae:null,R=!!(L.nodeRef.current&&L.rect),ue=YZ(R?null:ae),de=nQ(ce?VY(ce):null),fe=ZZ(g?I??F:null),pe=iQ(fe),me=_Q(c,{transform:{x:b.x-ue.x,y:b.y-ue.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:ae,containerNodeRect:oe,draggingNodeRect:le,over:se.current.over,overlayNodeRect:L.rect,scrollableAncestors:fe,scrollableAncestorRects:pe,windowRect:de}),he=ne?nX(ne,b):null,ge=QZ(fe),_e=$Z(ge),ve=$Z(ge,[ae]),ye=nX(me,_e),be=le?zX(le,me):null,xe=w&&be?o({active:w,collisionRect:be,droppableRects:N,droppableContainers:M,pointerCoordinates:he}):null,Se=AX(xe,`id`),[Ce,z]=(0,y.useState)(null),we=IX(R?me:nX(me,ve),Ce?.rect??null,ae),Te=(0,y.useRef)(null),Ee=(0,y.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=v.get(T.current);if(!i)return;let a=e.nativeEvent,o=new n({active:T.current,activeNode:i,event:a,options:r,context:se,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,lu.unstable_batchedUpdates)(()=>{r?.(i),h(xQ.Initializing),d({type:xX.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),D(Te.current),k(a)})},onMove(e){d({type:xX.DragMove,coordinates:e})},onEnd:s(xX.DragEnd),onCancel:s(xX.DragCancel)});Te.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=se.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===xX.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=xX.DragCancel)}T.current=null,(0,lu.unstable_batchedUpdates)(()=>{d({type:e}),h(xQ.Uninitialized),z(null),D(null),k(null),Te.current=null;let t=e===xX.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),De=RZ(a,(0,y.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,Ee(n,t))},[v,Ee]));eQ(a),KY(()=>{ae&&m===xQ.Initializing&&h(xQ.Initialized)},[ae,m]),(0,y.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=se.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:ye.x,y:ye.y},over:i};(0,lu.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[ye.x,ye.y]),(0,y.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=se.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(Se),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,lu.unstable_batchedUpdates)(()=>{z(s),a?.(c),f({type:`onDragOver`,event:c})})},[Se]),KY(()=>{se.current={activatorEvent:O,active:w,activeNode:F,collisionRect:be,collisions:xe,droppableRects:N,draggableNodes:v,draggingNode:ce,draggingNodeRect:le,droppableContainers:x,over:Ce,scrollableAncestors:fe,scrollAdjustedTranslate:ye},C.current={initial:le,translated:be}},[w,F,xe,be,v,ce,le,N,x,Ce,fe,ye]),PZ({...re,delta:b,draggingRect:be,pointerCoordinates:he,scrollableAncestors:fe,scrollableAncestorRects:pe});let Oe=(0,y.useMemo)(()=>({active:w,activeNode:F,activeNodeRect:ae,activatorEvent:O,collisions:xe,containerNodeRect:oe,dragOverlay:L,draggableNodes:v,droppableContainers:x,droppableRects:N,over:Ce,measureDroppableContainers:te,scrollableAncestors:fe,scrollableAncestorRects:pe,measuringConfiguration:ee,measuringScheduled:P,windowRect:de}),[w,F,ae,O,xe,oe,L,v,x,N,Ce,te,fe,pe,ee,P,de]),ke=(0,y.useMemo)(()=>({activatorEvent:O,activators:De,active:w,activeNodeRect:ae,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:v,over:Ce,measureDroppableContainers:te}),[O,De,w,ae,d,j,v,Ce,te]);return y.createElement(hX.Provider,{value:p},y.createElement(fQ.Provider,{value:ke},y.createElement(pQ.Provider,{value:Oe},y.createElement(bQ.Provider,{value:we},i)),y.createElement(gQ,{disabled:n?.restoreFocus===!1})),y.createElement(bX,{...n,hiddenTextDescribedById:j}));function Ae(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),CQ=(0,y.createContext)(null),wQ=`button`,TQ=`Draggable`;function EQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=eX(TQ),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,y.useContext)(fQ),{role:p=wQ,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,y.useContext)(g?bQ:CQ),[v,b]=ZY(),[x,S]=ZY(),C=tQ(o,t),w=YY(n);return KY(()=>(d.set(t,{id:t,key:a,node:v,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,y.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===wQ?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:C,node:v,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:_}}function DQ(){return(0,y.useContext)(pQ)}var OQ=`Droppable`,kQ={timeout:25};function AQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=eX(OQ),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,y.useContext)(fQ),u=(0,y.useRef)({disabled:n}),d=(0,y.useRef)(!1),f=(0,y.useRef)(null),p=(0,y.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...kQ,...i},_=YY(h??r),v=KZ({callback:(0,y.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[b,x]=ZY((0,y.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),S=YY(t);return(0,y.useEffect)(()=>{!v||!b.current||(v.disconnect(),d.current=!1,v.observe(b.current))},[b,v]),(0,y.useEffect)(()=>(s({type:xX.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:xX.UnregisterDroppable,key:a,id:r})),[r]),(0,y.useEffect)(()=>{n!==u.current.disabled&&(s({type:xX.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 jQ(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function MQ(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function NQ(e){return e!==null&&e>=0}function PQ(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 FQ(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var IQ=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=jQ(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}},LQ={scaleX:1,scaleY:1},RQ=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,...LQ}:null}let s=zQ(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...LQ}:r<t&&r>=a?{x:0,y:o.height+s,...LQ}:{x:0,y:0,...LQ}};function zQ(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 BQ=`Sortable`,VQ=y.createContext({activeIndex:-1,containerId:BQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:IQ,disabled:{draggable:!1,droppable:!1}});function HQ(e){let{children:t,id:n,items:r,strategy:i=IQ,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=DQ(),d=eX(BQ,n),f=s.rect!==null,p=(0,y.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,y.useRef)(p),v=!PQ(p,_.current),b=g!==-1&&h===-1||v,x=FQ(a);KY(()=>{v&&m&&u(p)},[v,p,m,u]),(0,y.useEffect)(()=>{_.current=p},[p]);let S=(0,y.useMemo)(()=>({activeIndex:h,containerId:d,disabled:x,disableTransforms:b,items:p,overIndex:g,useDragOverlay:f,sortedRects:MQ(p,c),strategy:i}),[h,d,x.draggable,x.droppable,b,p,g,c,f,i]);return y.createElement(VQ.Provider,{value:S},t)}var UQ=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return jQ(n,r,i).indexOf(t)},WQ=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},GQ={duration:200,easing:`ease`},KQ=`transform`,qQ=cX.Transition.toString({property:KQ,duration:0,easing:`linear`}),JQ={roleDescription:`sortable`};function YQ(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,y.useState)(null),s=(0,y.useRef)(n);return KY(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=UX(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,y.useEffect)(()=>{a&&o(null)},[a]),a}function XQ(e){let{animateLayoutChanges:t=WQ,attributes:n,disabled:r,data:i,getNewIndex:a=UQ,id:o,strategy:s,resizeObserverConfig:c,transition:l=GQ}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,y.useContext)(VQ),b=ZQ(r,p),x=u.indexOf(o),S=(0,y.useMemo)(()=>({sortable:{containerId:d,index:x,items:u},...i}),[d,i,x,u]),C=(0,y.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=AQ({id:o,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:ee,isDragging:N,over:te,setActivatorNodeRef:P,transform:F}=EQ({id:o,data:S,attributes:{...JQ,...n},disabled:b.draggable}),ne=LY(D,M),re=!!O,ie=re&&!m&&NQ(f)&&NQ(g),ae=!_&&N,oe=ie?(ae&&ie?F:null)??(s??v)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:x}):null,se=NQ(f)&&NQ(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):x,I=O?.id,L=(0,y.useRef)({activeId:I,items:u,newIndex:se,containerId:d}),ce=u!==L.current.items,le=t({active:O,containerId:d,isDragging:N,isSorting:re,id:o,index:x,items:u,newIndex:L.current.newIndex,previousItems:L.current.items,previousContainerId:L.current.containerId,transition:l,wasDragging:L.current.activeId!=null}),R=YQ({disabled:!le,index:x,node:T,rect:w});return(0,y.useEffect)(()=>{re&&L.current.newIndex!==se&&(L.current.newIndex=se),d!==L.current.containerId&&(L.current.containerId=d),u!==L.current.items&&(L.current.items=u)},[re,se,d,u]),(0,y.useEffect)(()=>{if(I===L.current.activeId)return;if(I!=null&&L.current.activeId==null){L.current.activeId=I;return}let e=setTimeout(()=>{L.current.activeId=I},50);return()=>clearTimeout(e)},[I]),{active:O,activeIndex:f,attributes:j,data:S,rect:w,index:x,newIndex:se,items:u,isOver:E,isSorting:re,isDragging:N,listeners:ee,node:T,overIndex:g,over:te,setNodeRef:ne,setActivatorNodeRef:P,setDroppableNodeRef:D,setDraggableNodeRef:M,transform:R??oe,transition:ue()};function ue(){if(R||ce&&L.current.newIndex===x)return qQ;if(!(ae&&!aX(k)||!l)&&(re||le))return cX.Transition.toString({...l,property:KQ})}}function ZQ(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function QQ(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 $Q=[vZ.Down,vZ.Right,vZ.Up,vZ.Left],e$=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if($Q.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 vZ.Down:r.top<a.top&&t.push(n);break;case vZ.Up:r.top>a.top&&t.push(n);break;case vZ.Left:r.left>a.left&&t.push(n);break;case vZ.Right:r.left<a.left&&t.push(n)}});let c=NX({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=AX(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=JX(c).some((e,t)=>s[t]!==e),i=t$(e,t),a=n$(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:rX(u,l)}}}};function t$(e,t){return!QQ(e)||!QQ(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function n$(e,t){return!QQ(e)||!QQ(t)||!t$(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function r$({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:m,transition:h,isDragging:g}=XQ({id:e.id}),_=(0,y.useRef)(a);(0,y.useEffect)(()=>{_.current=a});let v={transform:cX.Transform.toString(m),transition:h,opacity:g||u?.5:1},b=DF(e.mediaType),x=g||u,S=e.storageUri?e.storageUri.replace(/^file:\/\//,``):e.name,C=(0,y.useCallback)(t=>{_.current&&t.altKey&&(t.key===`ArrowUp`?(t.preventDefault(),_.current(e.id,`up`)):t.key===`ArrowDown`&&(t.preventDefault(),_.current(e.id,`down`)))},[e.id]);return(0,R.jsxs)(`div`,{ref:p,style:v,...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,R.jsxs)(c,{href:r,className:`semiont-resource-tab__link`,title:S,children:[(0,R.jsx)(`span`,{className:`semiont-resource-tab__icon`,"aria-hidden":`true`,children:b}),!t&&(0,R.jsx)(`span`,{className:`semiont-resource-tab__text`,children:e.name})]}),!t&&(0,R.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,R.jsx)(`svg`,{fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,width:`16`,height:`16`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})}function i$(){let{announce:e}=aI();return{announceReorder:(0,y.useCallback)(t=>{e(t,`assertive`)},[e]),announcePickup:(0,y.useCallback)((t,n,r)=>{e(`Picked up ${t}. Position ${n} of ${r}. Use arrow keys to move, space to drop.`,`assertive`)},[e]),announceDrop:(0,y.useCallback)((t,n,r)=>{e(`Dropped ${t} at position ${n} of ${r}.`,`assertive`)},[e]),announceMove:(0,y.useCallback)((t,n,r,i)=>{e(`Moved ${t} ${n} to position ${r} of ${i}.`,`polite`)},[e]),announceKeyboardReorder:(0,y.useCallback)((t,n,r,i)=>{e(`${t} moved ${n} to position ${r} of ${i}.`,`assertive`)},[e]),announceCannotMove:(0,y.useCallback)(t=>{e(`Cannot move ${t}. Already at the ${t===`up`?`top`:`bottom`} of the list.`,`polite`)},[e])}}function a$({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,m]=(0,y.useState)(!1),h=(0,y.useRef)(null),{announcePickup:g,announceDrop:_,announceKeyboardReorder:v,announceCannotMove:b}=i$(),x=ah(`CollapsibleResourceNavigation`),S=Sm(),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=()=>m(!p),T=()=>m(!1);(0,y.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&T()};if(p)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]);let E=wX(CX(EZ,{activationConstraint:{distance:8}}),CX(xZ,{coordinateGetter:e$})),D=(0,y.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];v(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,R.jsxs)(`div`,{className:`semiont-collapsible-nav ${s}`,children:[(0,R.jsx)(`div`,{id:`drag-instructions`,className:`sr-only`,"aria-live":`polite`,children:C.dragInstructions}),(0,R.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-atomic":`true`,children:`Resources can be reordered using Alt+Up or Alt+Down arrow keys.`}),(0,R.jsxs)(`div`,{className:`semiont-collapsible-nav__container`,children:[(0,R.jsxs)(`div`,{style:{position:`relative`},ref:u?h:void 0,children:[(0,R.jsxs)(`div`,{className:`semiont-nav-section__header`,children:[!n&&u&&(0,R.jsx)(`button`,{onClick:w,className:`semiont-nav-section__header-text`,"aria-expanded":p,"aria-haspopup":`true`,type:`button`,children:C.title}),!n&&!u&&(0,R.jsx)(`span`,{className:`semiont-nav-section__header-text`,children:C.title}),(0,R.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,R.jsx)(f,{}):(0,R.jsx)(d,{})})]}),p&&u&&!n&&(0,R.jsx)(`div`,{className:`semiont-nav-section__dropdown`,children:u(T)})]}),!n&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`semiont-nav-tab__text`,children:e.name})]},e.href)})}),n&&(0,R.jsx)(`nav`,{className:`semiont-nav-tabs`,children:e.map(e=>{let t=r===e.href;return(0,R.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,R.jsx)(e.icon,{className:`semiont-nav-tab__icon`,"aria-hidden":`true`})},e.href)})}),(0,R.jsx)(`div`,{className:`semiont-resource-tabs`,role:`tablist`,"aria-label":`Open resources`,children:n?t.map(e=>{let t=o(e.id);return(0,R.jsx)(r$,{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,R.jsx)(SQ,{sensors:E,collisionDetection:MX,onDragStart:e=>{let{active:n}=e,r=t.find(e=>e.id===n.id);if(r){let e=t.indexOf(r);g(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];_(n.name,i+1,t.length)}}},children:(0,R.jsx)(HQ,{items:t.map(e=>e.id),strategy:RQ,children:t.map((e,a)=>{let s=o(e.id);return(0,R.jsx)(r$,{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 o$({context:e,translations:t}){let n=e.focus.kind===`annotation`?e.focus.sourceResource[`@id`]:e.focus.resource[`@id`],r=e.focus.kind===`annotation`?e.focus.annotation.id:void 0,{connections:i,citedBy:a}=Ri(e.graph,n,r),o=new Map;for(let t of e.graph.edges)t.type===`annotation-of`&&o.set(t.source,t.target);let s=e.graph.nodes.filter(e=>e.type===`annotation`&&e.id!==r&&o.get(e.id)===n),c=e.metadata?.entityTypeFrequencies??{},l=e=>[...e].sort((e,t)=>(c[e]??0)-(c[t]??0)),u=e=>{for(let t of Array.isArray(e)?e:[e])if(t&&typeof t==`object`&&`value`in t&&t.purpose!==`tagging`)return t.value},d=e=>8+e*216,f=e.graph.nodes.find(e=>e.id===n)?.label??(e.focus.kind===`annotation`?e.focus.sourceResource.name:e.focus.resource.name)??n,p=[],m=[],h=a.length>0,g=i.length>0,_=Math.max(1,Math.min(3-!!h-!!g,s.length)),v=+!!h,y=+!!h+_+ +!!g,b={id:n,label:f,kind:`focal`,hover:f,x:d(v),y:8};p.push(b),a.forEach((e,n)=>{let r={id:e.resourceId,label:e.resourceName,kind:`resource`,hover:`${e.resourceName}
139
139
  ${t.citedByLabel}`,x:d(0),y:8+n*52};p.push(r),m.push({key:`cites-${e.resourceId}`,kind:`cites`,hover:`cites`,x1:r.x+180,y1:r.y+17,x2:b.x,y2:b.y+17})}),i.forEach((e,n)=>{let r=l(e.entityTypes),i={id:e.resourceId,label:e.resourceName,kind:`resource`,hover:r.length?`${e.resourceName}
140
140
  ${r.join(`, `)}`:e.resourceName,x:d(v+_),y:8+n*52};p.push(i),m.push({key:`peer-${e.resourceId}`,kind:`peer`,hover:e.bidirectional?`${t.connectionsLabel} \xB7 mutual`:t.connectionsLabel,x1:b.x+180,y1:b.y+17,x2:i.x,y2:i.y+17})}),s.forEach((n,r)=>{let i=n.type===`annotation`?n.annotation:void 0,a=i?kr(xr(i.target)):``,o=i?.motivation??n.label,s=i?u(i.body):void 0,c=l(n.entityTypes??[]),f=!a&&i?yr(i.body):null,h=f?e.graph.nodes.find(e=>e.id===f)?.label:void 0,g=a||(h?`\u2192 ${h}`:void 0)||(f?t.resourceLinkLabel:void 0)||s||n.label,y=Array.from(new Set([g,o,s,c.length?c.join(`, `):void 0].filter(Boolean))).join(`
141
- `),x={id:n.id,label:g,kind:`annotation`,hover:y,x:d(v+r%_),y:8+(1+Math.floor(r/_))*52};p.push(x),m.push({key:`annof-${n.id}`,kind:`annotation-of`,hover:`annotation-of`,x1:b.x+90,y1:b.y+34,x2:x.x+90,y2:x.y})});let x=Math.max(a.length,1+Math.ceil(s.length/_),i.length),S=y*216-20,C=8+x*52+8,w=e=>e.length>22?`${e.slice(0,21)}\u2026`:e,T=i.length>0||a.length>0||s.length>0;return(0,R.jsxs)(`div`,{className:`semiont-gather-pane semiont-gather-pane--graph`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:t.graphPaneTitle}),e.inferredRelationshipSummary&&(0,R.jsx)(`p`,{className:`semiont-gather-pane__summary`,children:e.inferredRelationshipSummary}),!T&&(0,R.jsx)(`p`,{className:`semiont-gather-pane__empty`,children:t.graphEmpty}),T&&(0,R.jsxs)(`svg`,{className:`semiont-graph`,viewBox:`0 0 ${S} ${C}`,style:{maxWidth:`${S}px`},role:`img`,"aria-label":t.graphPaneTitle,children:[m.map(e=>(0,R.jsxs)(`g`,{className:`semiont-graph__edge semiont-graph__edge--${e.kind}`,children:[(0,R.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}),(0,R.jsx)(`title`,{children:e.hover})]},e.key)),p.map(e=>(0,R.jsxs)(`g`,{className:`semiont-graph__node semiont-graph__node--${e.kind}`,"data-node-id":e.id,children:[(0,R.jsx)(`rect`,{x:e.x,y:e.y,width:180,height:34,rx:6}),(0,R.jsx)(`text`,{x:e.x+10,y:e.y+22,children:w(e.label)}),(0,R.jsx)(`title`,{children:e.hover})]},e.id))]})]})}function s$({semanticContext:e,translations:t}){let n=[...e?.similar??[]].sort((e,t)=>t.score-e.score),r=e?.excludedEntityTypes??[];return(0,R.jsxs)(`div`,{className:`semiont-gather-pane semiont-gather-pane--corpus`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:t.corpusPaneTitle}),n.length===0?(0,R.jsx)(`p`,{className:`semiont-gather-pane__empty`,children:t.corpusEmpty}):(0,R.jsx)(`ul`,{className:`semiont-corpus__list`,children:n.map((e,n)=>(0,R.jsxs)(`li`,{className:`semiont-corpus__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-corpus__card-head`,children:[(0,R.jsx)(`span`,{className:`semiont-corpus__source`,children:e.resourceName}),(e.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e)),e.machineRead&&(0,R.jsx)(`span`,{className:`semiont-chip semiont-corpus__trust`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:t.machineRead}),(0,R.jsxs)(`span`,{className:`semiont-corpus__score`,children:[t.score,`: `,e.score.toFixed(2)]})]}),(0,R.jsx)(`p`,{className:`semiont-corpus__snippet`,children:e.text})]},`${e.resourceId}-${n}`))}),r.length>0&&(0,R.jsx)(`p`,{className:`semiont-corpus__receipt`,children:t.excludedReceipt.replace(`{{types}}`,r.join(`, `))})]})}function c$({context:e,contextLoading:t,contextError:n,pending:r,annotate:i,chosenStrategy:a,translations:o}){let[s,c]=(0,y.useState)(!1),l=!t&&!n&&!!e,u=e?.focus.kind===`annotation`?e.focus:null,d=e?.focus.kind===`resource`?e.focus:null,f=u?.annotation.motivation?iT(u.annotation.motivation):void 0,p=f?rT[f].className:void 0,m=(0,y.useRef)(null);(0,y.useEffect)(()=>{m.current&&m.current.scrollIntoView({block:`center`,behavior:`instant`})},[e]);let h=i&&(0,R.jsx)(`div`,{className:`semiont-gather__hint-row`,children:(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,children:[i.translations.userHintLabel,(0,R.jsxs)(`span`,{className:`semiont-gather__hint-effect`,children:[` — `,i.translations.userHintEffect]})]}),(0,R.jsx)(`textarea`,{value:i.userHint,onChange:e=>i.onUserHintChange(e.target.value),placeholder:i.translations.userHintPlaceholder,className:`semiont-search-modal__search-input semiont-gather__hint-textarea`,style:{resize:`vertical`,fontFamily:`inherit`}})]})}),g=i&&(0,R.jsxs)(`div`,{className:`semiont-gather__footer`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__footer-label`,children:i.translations.resolutionStrategyLabel}),(0,R.jsxs)(`div`,{className:`semiont-gather__actions`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:i.onBind,disabled:!l,className:`semiont-button--primary semiont-button--flex`,children:[`🔍 `,i.translations.search,`…`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:i.onGenerate,disabled:!l,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,i.translations.generate,`…`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:i.onCompose,disabled:!l,className:`semiont-button--secondary semiont-button--flex`,children:[`✍️ `,i.translations.compose]})]})]});return(0,R.jsxs)(`div`,{className:`semiont-gather__outer`,children:[t&&r&&(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton`,role:`status`,children:[(0,R.jsx)(`span`,{className:`semiont-sr-only`,children:o.loadingContext}),r.resourceName&&(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-source`,children:[o.sourceContextLabel,` "${r.resourceName}"`]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-header`,children:[(0,R.jsxs)(`span`,{className:`semiont-gather__skeleton-exact`,children:[`"`,r.exact,`"`]}),r.entityTypes.length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:r.entityTypes.map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-panes`,children:[(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-pane`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:o.graphPaneTitle}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-pane`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:o.corpusPaneTitle}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]})]})]}),h,g]}),t&&!r&&(0,R.jsxs)(`div`,{className:`semiont-gather__loading`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`},children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-text`,children:o.loadingContext})]}),!!n&&(0,R.jsx)(`div`,{style:{textAlign:`center`,padding:`1rem 0`,color:`var(--semiont-color-red-600)`},children:o.failedContext}),e&&(0,R.jsxs)(R.Fragment,{children:[u?.selected&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,justifyContent:`space-between`,gap:`0.5rem`,marginBottom:`0.375rem`},children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:0},children:[o.sourceContextLabel,u.sourceResource.name?` "${u.sourceResource.name}"`:``]}),(e.metadata?.entityTypes??[]).length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:(e.metadata?.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__source-box${s?` semiont-gather__source-box--expanded`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,R.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[u.selected.before&&(0,R.jsx)(`span`,{children:u.selected.before}),(0,R.jsx)(`span`,{ref:m,...p?{className:p}:{},children:u.selected.text}),u.selected.after&&(0,R.jsx)(`span`,{children:u.selected.after})]})}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>c(e=>!e),children:s?`▲ less`:`▼ more`})]})]}),d&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,justifyContent:`space-between`,gap:`0.5rem`,marginBottom:`0.375rem`},children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:0},children:[o.sourceContextLabel,d.resource.name?` "${d.resource.name}"`:``]}),(e.metadata?.entityTypes??[]).length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:(e.metadata?.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(d.summary||d.content?.main)&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-box${s?` semiont-gather__source-box--expanded`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,R.jsx)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:d.summary??d.content?.main})}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>c(e=>!e),children:s?`▲ less`:`▼ more`})]}),d.suggestedReferences&&d.suggestedReferences.length>0&&(0,R.jsx)(`ul`,{className:`semiont-gather__suggested`,children:d.suggestedReferences.map(e=>(0,R.jsx)(`li`,{children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__body`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__left`,children:(0,R.jsx)(o$,{context:e,translations:o})}),(0,R.jsx)(`div`,{className:`semiont-gather__right`,children:(0,R.jsx)(s$,{semanticContext:e.semanticContext,translations:o})})]}),u&&h,u&&g,!i&&a&&(0,R.jsxs)(`div`,{className:`semiont-gather__footer semiont-gather__footer--echo`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__footer-label`,children:a.label}),(0,R.jsx)(`span`,{className:`semiont-gather__chosen-strategy`,children:a.value})]})]})]})}function l$({backLabel:e,onBack:t,primary:n}){let r=n?.pending??!1;return(0,R.jsxs)(`div`,{className:`semiont-modal__actions semiont-modal__actions--wizard`,children:[t&&e&&(0,R.jsxs)(`button`,{type:`button`,onClick:t,className:`semiont-button--secondary semiont-wizard-footer__back`,disabled:r,children:[`◀ `,e]}),n&&(0,R.jsx)(`button`,{type:n.type,...n.onClick?{onClick:n.onClick}:{},className:`semiont-button--primary`,disabled:r||(n.disabled??!1),"data-pending":r?`true`:`false`,children:r?n.pendingLabel??n.label:n.label})]})}var u$=100,d$=4e3,f$=e=>bi(e)?.extension??``,p$=(e,t)=>({title:e,storagePath:``,prompt:``,language:t,temperature:.7,maxTokensText:`500`,outputMediaType:`text/markdown`});function m$({context:e,hintEcho:t,config:n,onConfigChange:r,onBack:i,onGenerate:a,defaultFolder:o=``,translations:s,generationAgent:c}){let{title:l,storagePath:u,prompt:d,language:f,temperature:p,maxTokensText:m,outputMediaType:h}=n,g=e=>r({...n,...e}),_=u!==``,v=Ni(o,l,h),b=_?u:v,x=f$(h),S=b!==``&&!b.toLowerCase().endsWith(x.toLowerCase()),C=c?.limits?.maxOutputTokens??d$,w=(e=>Math.min(Math.max(Number.isFinite(e)?e:u$,u$),C))(parseInt(m,10));return(0,y.useEffect)(()=>{let e=parseInt(m,10);Number.isFinite(e)&&e>C&&g({maxTokensText:String(C)})},[C]),(0,R.jsxs)(`form`,{onSubmit:t=>{if(t.preventDefault(),S)return;let n=d.trim();a({title:l,storageUri:`file://${b}`,...n?{prompt:n}:{},language:f,temperature:p,maxTokens:w,outputMediaType:h,context:e})},className:`semiont-form`,children:[t&&(0,R.jsxs)(`p`,{className:`semiont-wizard__hint-echo`,children:[t.label,`: `,t.value]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-title`,className:`semiont-form__label`,children:s.resourceTitle}),(0,R.jsx)(`input`,{id:`wizard-title`,type:`text`,value:l,onChange:e=>g({title:e.target.value}),required:!0,className:`semiont-input`,placeholder:s.resourceTitlePlaceholder})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-storagePath`,className:`semiont-form__label`,children:s.saveLocation}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`wizard-storagePath`,type:`text`,value:b,onChange:e=>g({storagePath:e.target.value}),required:!0,"aria-invalid":S,...S?{"aria-describedby":`wizard-format-mismatch`}:{},className:`semiont-input semiont-input--addon`,placeholder:`generated/my-resource.md`})]}),S&&(0,R.jsx)(`p`,{id:`wizard-format-mismatch`,className:`semiont-form__error`,role:`alert`,children:s.formatExtensionMismatch.replace(`{{extension}}`,x)})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-outputFormat`,className:`semiont-form__label`,children:s.outputFormat}),(0,R.jsx)(`select`,{id:`wizard-outputFormat`,value:h,onChange:e=>g({outputMediaType:e.target.value}),className:`semiont-select`,children:ki.map(e=>(0,R.jsx)(`option`,{value:e,children:bi(e)?.label??e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-prompt`,className:`semiont-form__label`,children:s.additionalInstructions}),(0,R.jsx)(`textarea`,{id:`wizard-prompt`,value:d,onChange:e=>g({prompt:e.target.value}),rows:2,className:`semiont-textarea`,placeholder:s.additionalInstructionsPlaceholder})]}),(0,R.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-language`,className:`semiont-form__label`,children:s.language}),(0,R.jsx)(`select`,{id:`wizard-language`,value:f,onChange:e=>g({language:e.target.value}),className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--slider`,children:[(0,R.jsxs)(`label`,{htmlFor:`wizard-temperature`,className:`semiont-form__label`,children:[s.creativity,` (`,p.toFixed(1),`)`]}),(0,R.jsx)(`input`,{id:`wizard-temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,value:p,onChange:e=>g({temperature:parseFloat(e.target.value)}),className:`semiont-slider`}),(0,R.jsxs)(`div`,{className:`semiont-slider__labels semiont-slider__labels--small`,children:[(0,R.jsx)(`span`,{children:s.creativityFocused}),(0,R.jsx)(`span`,{children:s.creativityCreative})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow semiont-form__field--end`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-maxTokens`,className:`semiont-form__label`,children:s.maxLength}),(0,R.jsx)(`input`,{id:`wizard-maxTokens`,type:`number`,min:u$,max:C,step:`100`,value:m,onChange:e=>{let t=e.target.value;if(t===``){g({maxTokensText:``});return}let n=parseInt(t,10);Number.isFinite(n)&&g({maxTokensText:String(Math.min(n,C))})},className:`semiont-input`})]})]}),(0,R.jsx)(`p`,{className:`semiont-form__help semiont-form__help--row`,children:c?.limits?s.maxLengthCeiling.replace(`{{maxOutputTokens}}`,String(C)).replace(`{{model}}`,c.agent.model??c.agent.name):s.maxLengthHelp}),(0,R.jsx)(l$,{...i&&s.back?{backLabel:s.back,onBack:i}:{},primary:{label:s.generate,type:`submit`,disabled:S}})]})}function h$({config:e,hintEcho:t,onConfigChange:n,isSearching:r=!1,searchError:i=null,onBack:a,onSearch:o,translations:s}){return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),o(e)},className:`semiont-form`,children:[t&&(0,R.jsxs)(`p`,{className:`semiont-wizard__hint-echo`,children:[t.label,`: `,t.value]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-limit`,className:`semiont-form__label`,children:s.maxResults}),(0,R.jsxs)(`select`,{id:`wizard-limit`,value:e.limit,onChange:t=>n({...e,limit:parseInt(t.target.value)}),className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:1,children:`1`}),(0,R.jsx)(`option`,{value:5,children:`5`}),(0,R.jsx)(`option`,{value:10,children:`10`}),(0,R.jsx)(`option`,{value:20,children:`20`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form__label semiont-form__label--inline`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:e.useSemanticScoring,onChange:t=>n({...e,useSemanticScoring:t.target.checked})}),s.semanticScoring]}),(0,R.jsx)(`p`,{className:`semiont-form__help`,children:s.semanticScoringHelp})]}),i&&(0,R.jsxs)(`div`,{role:`alert`,style:{textAlign:`center`,padding:`0.5rem 0`,color:`var(--semiont-color-red-600)`},children:[s.searchFailed,`: `,i]}),(0,R.jsx)(l$,{backLabel:s.back,onBack:a,primary:{label:s.search,pendingLabel:s.searching,pending:r,type:`submit`}})]})}function g$({results:e,onLink:t,onBack:n,translations:r}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`semiont-search-results`,children:e.length===0?(0,R.jsx)(`div`,{className:`semiont-modal__empty-state`,style:{textAlign:`center`,padding:`2rem 0`},children:r.noResults}):e.map(e=>{let n=e[`@id`];return(0,R.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,R.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,R.jsx)(`div`,{style:{fontWeight:500,color:`var(--semiont-text-primary)`},children:e.name}),e.description&&(0,R.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,R.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,R.jsxs)(`span`,{children:[r.score,`: `,e.score]}),e.matchReason&&(0,R.jsx)(`span`,{children:e.matchReason})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(n),className:`semiont-button--primary`,style:{flexShrink:0},children:[`🔗 `,r.link]})]},n)})}),(0,R.jsx)(l$,{backLabel:r.back,onBack:n})]})}function _$({draft:e,onDraftChange:t,defaultFolder:n=``,referenceEntityTypes:r,entityTypeOptions:i,showLineNumbers:a,hoverDelayMs:o,onBack:s,onCompose:c,translations:l}){let u=e.storagePath===``?Ni(n,e.name,`text/markdown`):e.storagePath,[d,f]=(0,y.useState)(!1),p=r.length>0;return(0,R.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!(!e.name.trim()||!u.trim())){f(!0);try{await c({name:e.name,storagePath:`file://${u}`,content:e.content,entityTypes:p?r:e.entityTypes,language:e.language})}catch{}finally{f(!1)}}},className:`semiont-form`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-name`,className:`semiont-form__label`,children:l.resourceTitle}),(0,R.jsx)(`input`,{id:`compose-name`,type:`text`,value:e.name,onChange:e=>t({name:e.target.value}),placeholder:l.resourceTitlePlaceholder,required:!0,className:`semiont-input`,disabled:d})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-storagePath`,className:`semiont-form__label`,children:l.saveLocation}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`compose-storagePath`,type:`text`,value:u,onChange:e=>t({storagePath:e.target.value}),placeholder:`people/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:d})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`div`,{className:`semiont-form__label`,children:l.entityTypes}),p?(0,R.jsx)(`div`,{className:`semiont-form__entity-type-tags`,role:`list`,children:r.map(e=>(0,R.jsx)(`span`,{role:`listitem`,className:`semiont-form__entity-type-tag`,children:e},e))}):(0,R.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,children:i.map(n=>{let r=e.entityTypes.includes(n);return(0,R.jsx)(`button`,{type:`button`,onClick:()=>t({entityTypes:r?e.entityTypes.filter(e=>e!==n):[...e.entityTypes,n]}),className:`semiont-form__entity-type-button`,"data-selected":r,"aria-pressed":r,disabled:d,children:n},n)})})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-language`,className:`semiont-form__label`,children:l.language}),(0,R.jsx)(`select`,{id:`compose-language`,value:e.language,onChange:e=>t({language:e.target.value}),disabled:d,className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:l.contentLabel}),(0,R.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:e.language,children:(0,R.jsx)(DU,{content:e.content,editable:!d,sourceView:!0,showLineNumbers:a,hoverDelayMs:o,onChange:e=>t({content:e})})})]}),(0,R.jsx)(l$,{backLabel:l.back,onBack:s,primary:{label:l.createAndLink,pendingLabel:l.creatingAndLinking,pending:d,type:`submit`}})]})}function v$({prompt:e,discardLabel:t,keepLabel:n,onDiscard:r,onKeepEditing:i}){return(0,R.jsxs)(`div`,{className:`semiont-wizard__discard-prompt`,role:`alert`,children:[(0,R.jsx)(`span`,{className:`semiont-wizard__discard-prompt-text`,children:e}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-button--danger`,onClick:r,children:t}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-button--secondary`,onClick:i,children:n})]})}function y$({isOpen:e,onClose:t,annotationId:n,resourceId:r,defaultTitle:i,defaultFolder:a,entityTypes:o,resourceName:s,locale:c,context:l,contextLoading:u,contextError:d,onGenerateSubmit:f,onLinkResource:p,onComposeSubmit:m,entityTypeOptions:h=[],hoverDelayMs:g=300,translations:_,generationAgent:v}){let b=Z(Sm().activeSession$),[x,S]=(0,y.useState)({step:`gather`}),[C,w]=(0,y.useState)({limit:10,useSemanticScoring:!0}),[T,E]=(0,y.useState)(()=>p$(i,c)),[D,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(null),[j,M]=(0,y.useState)(``),ee=()=>({name:i,storagePath:``,content:``,entityTypes:[],language:c}),[N,te]=(0,y.useState)(ee),[P,F]=(0,y.useState)(!1),{showLineNumbers:ne}=vm(),re=(0,y.useRef)(i);(0,y.useEffect)(()=>{e&&(re.current=i,S({step:`gather`}),w({limit:10,useSemanticScoring:!0}),E(p$(i,c)),O(!1),A(null),M(``),te(ee()),F(!1))},[e]),nI(`match:search-results`,t=>{e&&n&&t.referenceId===n&&(O(!1),S({step:`search-results`,results:t.response}))}),nI(`match:search-failed`,t=>{e&&n&&t.referenceId===n&&(O(!1),A(t.error))});let ie=(0,y.useCallback)(()=>{S({step:`configure-search`})},[]),ae=l?j?{...l,focus:{...l.focus,userHint:j}}:l:null,oe=(0,y.useCallback)(()=>{S({step:`configure-generation`})},[]),se=(0,y.useCallback)(()=>{!l||!n||!r||S({step:`compose`})},[l,n,r]),I=(0,y.useCallback)(async e=>{n&&(await m(n,e),t())},[n,m,t]),L=N.content.trim()!==``||N.storagePath.trim()!==``||N.name!==re.current||T.title!==re.current||T.storagePath.trim()!==``||T.prompt.trim()!==``,ce=(0,y.useCallback)(()=>{if(L){F(!0);return}t()},[L,t]),le=(0,y.useCallback)(()=>{S({step:`gather`})},[]),ue=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=ue.current;e&&(e.scrollTop=e.scrollHeight)},[x.step]);let de=(0,y.useCallback)(e=>{!n||!ae||!r||(O(!0),A(null),b?.client.match.requestSearch({correlationId:hr(),resourceId:r,referenceId:n,context:ae,limit:e.limit,useSemanticScoring:e.useSemanticScoring}))},[n,r,ae,b]),fe=(0,y.useCallback)(e=>{n&&(f(n,e),t())},[n,f,t]),pe=(0,y.useCallback)(e=>{n&&(p(n,e),t())},[n,p,t]),me={loadingContext:_.loadingContext,failedContext:_.failedContext,sourceContextLabel:_.sourceContextLabel,connectionsLabel:_.connectionsLabel,citedByLabel:_.citedByLabel,graphPaneTitle:_.graphPaneTitle,graphEmpty:_.graphEmpty,resourceLinkLabel:_.resourceLinkLabel,corpusPaneTitle:_.corpusPaneTitle,corpusEmpty:_.corpusEmpty,excludedReceipt:_.excludedReceipt,machineRead:_.machineRead,score:_.score};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:ce,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border semiont-search-modal__panel--gather semiont-search-modal__panel--wide`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,R.jsx)(rJ,{className:`semiont-search-modal__title`,children:_.resolveTitle}),(0,R.jsx)(`button`,{onClick:ce,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),P&&(0,R.jsx)(v$,{prompt:_.discardDraftPrompt,discardLabel:_.discardDraft,keepLabel:_.keepEditing,onDiscard:()=>{F(!1),t()},onKeepEditing:()=>F(!1)}),x.step===`gather`&&(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,pending:{exact:i,entityTypes:o,...s?{resourceName:s}:{}},annotate:{userHint:j,onUserHintChange:M,onBind:ie,onGenerate:oe,onCompose:se,translations:{search:_.search,generate:_.generate,compose:_.compose,resolutionStrategyLabel:_.resolutionStrategyLabel,userHintLabel:_.userHintLabel,userHintEffect:_.userHintEffect,userHintPlaceholder:_.userHintPlaceholder}},translations:me}),x.step===`compose`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u270D\uFE0F ${_.compose}`},translations:me}),(0,R.jsx)(_$,{draft:N,onDraftChange:e=>te(t=>({...t,...e})),defaultFolder:a,referenceEntityTypes:o,entityTypeOptions:h,showLineNumbers:ne,hoverDelayMs:g,onBack:le,onCompose:I,translations:{resourceTitle:_.resourceTitle,resourceTitlePlaceholder:_.resourceTitlePlaceholder,saveLocation:_.saveLocation,entityTypes:_.entityTypes,language:_.language,contentLabel:_.contentLabel,back:_.back,createAndLink:_.createAndLink,creatingAndLinking:_.creatingAndLinking}})]}),x.step===`configure-generation`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u2728 ${_.generate}`},translations:me}),(0,R.jsx)(m$,{...v?{generationAgent:v}:{},...j?{hintEcho:{label:_.userHintLabel,value:j}}:{},context:ae??l,config:T,onConfigChange:E,defaultFolder:a,onBack:le,onGenerate:fe,translations:{resourceTitle:_.resourceTitle,resourceTitlePlaceholder:_.resourceTitlePlaceholder,saveLocation:_.saveLocation,additionalInstructions:_.additionalInstructions,additionalInstructionsPlaceholder:_.additionalInstructionsPlaceholder,language:_.language,languageHelp:_.languageHelp,creativity:_.creativity,creativityFocused:_.creativityFocused,creativityCreative:_.creativityCreative,maxLength:_.maxLength,maxLengthHelp:_.maxLengthHelp,maxLengthCeiling:_.maxLengthCeiling,outputFormat:_.outputFormat,formatExtensionMismatch:_.formatExtensionMismatch,back:_.back,generate:_.generate}})]}),x.step===`configure-search`&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u{1F50D} ${_.search}`},translations:me}),(0,R.jsx)(h$,{config:C,...j?{hintEcho:{label:_.userHintLabel,value:j}}:{},onConfigChange:w,isSearching:D,searchError:k,onBack:le,onSearch:de,translations:{maxResults:_.maxResults,semanticScoring:_.semanticScoring,semanticScoringHelp:_.semanticScoringHelp,back:_.back,search:_.search,searching:_.searching,searchFailed:_.searchFailed}})]}),x.step===`search-results`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u{1F50D} ${_.search}`},translations:me}),(0,R.jsx)(g$,{results:x.results,onLink:pe,onBack:le,translations:{noResults:_.noResults,link:_.link,back:_.back,score:_.score}})]})]})})})})]})})}function b$({onGather:e,translations:t,children:n}){let[r,i]=(0,y.useState)(!0),[a,o]=(0,y.useState)(!0),[s,c]=(0,y.useState)(2),[l,u]=(0,y.useState)(10);return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e({includeContent:r,includeSummary:a,depth:s,maxResources:l})},className:`semiont-form`,children:[(0,R.jsx)(`p`,{className:`semiont-form__helper-text`,children:t.intro}),(0,R.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,R.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),t.includeContent]})}),(0,R.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,R.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),t.includeSummary]})}),(0,R.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,R.jsx)(`label`,{htmlFor:`gather-depth`,className:`semiont-form__label`,children:t.depth}),(0,R.jsx)(`input`,{id:`gather-depth`,type:`number`,min:`1`,max:`5`,value:s,onChange:e=>c(parseInt(e.target.value)),className:`semiont-input`})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,R.jsx)(`label`,{htmlFor:`gather-max`,className:`semiont-form__label`,children:t.maxResources}),(0,R.jsx)(`input`,{id:`gather-max`,type:`number`,min:`1`,max:`50`,value:l,onChange:e=>u(parseInt(e.target.value)),className:`semiont-input`})]})]}),n,(0,R.jsx)(l$,{primary:{label:t.gather,type:`submit`}})]})}function x$({isOpen:e,onClose:t,resourceId:n,defaultTitle:r,defaultFolder:i,locale:a,entityTypeOptions:o=[],onGenerateSubmit:s,gatherContext:c,gatherLoading:l,gatherError:u,onGather:d,translations:f,generationAgent:p}){let m=()=>p$(r,a),[h,g]=(0,y.useState)(m),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(!1),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)([]),O=(0,y.useRef)(!1),k=(0,y.useRef)(r);(0,y.useEffect)(()=>{e&&!O.current&&(v(!1),x(null),C(!1),D([]),g(m()),T(!1),k.current=r),O.current=e},[e]);let A=(0,y.useCallback)(e=>{v(!0),x({...e,excludeEntityTypes:E}),C(!1),d({...e,...E.length?{excludeEntityTypes:E}:{}})},[d,E]),j=(0,y.useCallback)(e=>{s(n,e),t()},[s,n,t]),M=h.title!==k.current||h.storagePath.trim()!==``||h.prompt.trim()!==``,ee=(0,y.useCallback)(()=>{if(M){T(!0);return}t()},[M,t]),N=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=N.current;e&&c&&(e.scrollTop=e.scrollHeight)},[c]);let te={loadingContext:f.loadingContext,failedContext:f.failedContext,sourceContextLabel:f.sourceContextLabel,connectionsLabel:f.connectionsLabel,citedByLabel:f.citedByLabel,graphPaneTitle:f.graphPaneTitle,graphEmpty:f.graphEmpty,resourceLinkLabel:f.resourceLinkLabel,corpusPaneTitle:f.corpusPaneTitle,corpusEmpty:f.corpusEmpty,excludedReceipt:f.excludedReceipt,machineRead:f.machineRead,score:f.score};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:ee,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border semiont-search-modal__panel--gather semiont-search-modal__panel--wide`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,R.jsx)(rJ,{className:`semiont-search-modal__title`,children:f.title}),(0,R.jsx)(`button`,{onClick:ee,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),w&&(0,R.jsx)(v$,{prompt:f.discardDraftPrompt,discardLabel:f.discardDraft,keepLabel:f.keepEditing,onDiscard:()=>{T(!1),t()},onKeepEditing:()=>T(!1)}),(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:N,children:[_&&!S&&b&&(0,R.jsxs)(`button`,{type:`button`,className:`semiont-gather-receipt`,title:f.editGather,onClick:()=>C(!0),children:[[`${f.gatherDepth} ${b.depth}`,`${f.gatherMaxResources} ${b.maxResources}`,...b.includeContent?[f.includeContent]:[],...b.includeSummary?[f.includeSummary]:[],...b.excludeEntityTypes.length?[f.excludedReceipt.replace(`{{types}}`,b.excludeEntityTypes.join(`, `))]:[]].join(` · `),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:` ✎`})]}),(0,R.jsx)(`div`,{hidden:_&&!S,children:(0,R.jsx)(b$,{onGather:A,translations:{intro:f.gatherIntro,includeContent:f.includeContent,includeSummary:f.includeSummary,depth:f.gatherDepth,maxResources:f.gatherMaxResources,gather:f.gatherButton},children:o.length>0&&(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:f.recallLabel}),(0,R.jsx)(`div`,{className:`semiont-form__recall-chips`,children:o.map(e=>{let t=!E.includes(e);return(0,R.jsx)(`button`,{type:`button`,className:`semiont-form__recall-chip`,"data-included":t,"aria-pressed":t,onClick:()=>D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),children:e},e)})})]})})}),_&&(0,R.jsx)(c$,{context:c,contextLoading:l,contextError:u,translations:te}),_&&c&&(0,R.jsx)(m$,{...p?{generationAgent:p}:{},context:c,config:h,onConfigChange:g,defaultFolder:i,onGenerate:j,translations:{resourceTitle:f.resourceTitle,resourceTitlePlaceholder:f.resourceTitlePlaceholder,saveLocation:f.saveLocation,additionalInstructions:f.additionalInstructions,additionalInstructionsPlaceholder:f.additionalInstructionsPlaceholder,language:f.language,languageHelp:f.languageHelp,creativity:f.creativity,creativityFocused:f.creativityFocused,creativityCreative:f.creativityCreative,maxLength:f.maxLength,maxLengthHelp:f.maxLengthHelp,maxLengthCeiling:f.maxLengthCeiling,outputFormat:f.outputFormat,formatExtensionMismatch:f.formatExtensionMismatch,generate:f.generate}})]})]})})})})]})})}var S$=Te(nT(),1);function C$(){let{announce:e}=aI();return{announceSearching:(0,y.useCallback)(()=>{e(`Searching...`,`polite`)},[e]),announceSearchResults:(0,y.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,y.useCallback)((t,n)=>{e(`Selected ${n}: ${t}. Press Enter to navigate.`,`polite`)},[e]),announceNavigation:(0,y.useCallback)((t,n)=>{e(`Navigating to ${n}: ${t}`,`assertive`)},[e])}}var w$=300,T$=5;function E$({isOpen:e,onClose:t,onNavigate:n,translations:r={}}){let{announceSearchResults:i,announceSearching:a}=C$(),o=Z(Sm().activeSession$)?.client,s=(0,y.useRef)(o);s.current=o;let[c,l]=(0,y.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,y.useState)(()=>ql(e=>s.current.browse.resources({search:e,limit:T$}).pipe((0,S$.map)(e=>{let t=Wc(e)?.resources;if(t!==void 0)return t.map(e=>{let t=Br(e);return t?{type:`resource`,id:t,name:e.name,content:e.content?.substring(0,150)}:null}).filter(e=>e!==null)})),{debounceMs:w$}));(0,y.useEffect)(()=>()=>d.dispose(),[d]);let f=Z(d.query$)??``,p=Z(d.state$),m=p?.results??[],h=p?.isSearching??!1;(0,y.useEffect)(()=>{e&&(d.setQuery(``),l(0))},[e,d]),(0,y.useEffect)(()=>{l(0)},[m.length]),(0,y.useEffect)(()=>{f.trim()&&(h?a():i(m.length,f))},[h,m.length]);let g=e=>{e.key===`ArrowDown`?(e.preventDefault(),l(e=>(e+1)%Math.max(1,m.length))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>(e-1+Math.max(1,m.length))%Math.max(1,m.length))):e.key===`Enter`&&m[c]&&(e.preventDefault(),_(m[c]))},_=e=>{t(),n(e.type,e.id)};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__input-container`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__search-icon-wrapper`,children:(0,R.jsx)(`svg`,{className:`semiont-search-modal__search-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`input`,{type:`text`,value:f,onChange:e=>d.setQuery(e.target.value),onKeyDown:g,placeholder:u.placeholder,className:`semiont-search-modal__input`,autoFocus:!0}),(0,R.jsx)(`div`,{className:`semiont-search-modal__esc-wrapper`,children:(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.esc})})]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__results`,children:[h&&(0,R.jsx)(`div`,{className:`semiont-search-modal__empty`,children:u.searching}),!h&&f&&m.length===0&&(0,R.jsxs)(`div`,{className:`semiont-search-modal__empty`,children:[u.noResults,` "`,f,`"`]}),!h&&m.length>0&&(0,R.jsx)(`div`,{className:`semiont-search-modal__results-list`,children:m.map((e,t)=>(0,R.jsxs)(`button`,{onClick:()=>_(e),onMouseEnter:()=>l(t),className:`semiont-search-modal__result ${t===c?`semiont-search-modal__result--selected`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__result-icon-wrapper`,children:e.type===`resource`?(0,R.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,R.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,R.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,R.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,R.jsxs)(`div`,{className:`semiont-search-modal__result-content`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__result-header`,children:[(0,R.jsx)(`span`,{className:`semiont-search-modal__result-name`,children:e.name}),e.type===`entity`&&e.entityType&&(0,R.jsx)(`span`,{className:`semiont-search-modal__result-badge`,children:e.entityType})]}),e.content&&(0,R.jsx)(`p`,{className:`semiont-search-modal__result-description`,children:e.content})]}),t===c&&(0,R.jsx)(`div`,{className:`semiont-search-modal__result-action`,children:(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.enter})})]},`${e.type}-${e.id}`))}),!h&&!f&&(0,R.jsxs)(`div`,{className:`semiont-search-modal__help`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__help-text`,children:u.startTyping}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcuts`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`↑↓`}),u.navigate]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:u.enter}),u.select]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`Esc`}),u.close]})]})]})]})]})})})})]})})}function D$(){return(0,R.jsx)(`div`,{className:`semiont-skip-links`,children:(0,R.jsxs)(`div`,{className:`semiont-skip-links-container`,children:[(0,R.jsx)(`a`,{href:`#main-content`,className:`semiont-skip-link semiont-skip-link-first`,children:`Skip to main content`}),(0,R.jsx)(`a`,{href:`#main-navigation`,className:`semiont-skip-link`,children:`Skip to navigation`}),(0,R.jsx)(`a`,{href:`#search`,className:`semiont-skip-link semiont-skip-link-last`,children:`Skip to search`})]})})}function O$({isFullyAuthenticated:e=!1,isAuthenticated:t=!1,hasValidGatewayToken:n=!1}){let r=Z(Sm().activeSession$)?.client,[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null);return(0,y.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,R.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,R.jsxs)(`p`,{className:`semiont-status-message`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`System status: `}),(()=>{if(t&&!n)return`🚀 Frontend Status: Ready • Gateway: Please sign out and sign in again to reconnect`;if(!e)return`🚀 Frontend Status: Ready • Gateway: Authentication required`;if(i)return`\u{1F680} Frontend Status: Ready \u2022 Gateway: ${i.status} (v${i.version})`;if(o)return`🚀 Frontend Status: Ready • Gateway: Connecting...`;if(c){let e=c.message;return e.includes(`401`)||e.includes(`Unauthorized`)?`🚀 Frontend Status: Ready • Gateway: Please sign out and sign in again`:`🚀 Frontend Status: Ready • Gateway: Connection failed`}return`🚀 Frontend Status: Ready • Gateway: Unknown`})()]}),e?c?(0,R.jsxs)(`p`,{className:`semiont-status-hint semiont-status-error-hint`,role:`alert`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Error: `}),`Check that the gateway server is running and accessible`]}):null:(0,R.jsx)(`p`,{className:`semiont-status-hint`,children:`Sign in to view gateway status`})]})}function k$({t:e,className:t=``,size:n=`lg`,showTagline:r=!0,animated:i=!0,compactTagline:a=!1}){return(0,R.jsxs)(`div`,{className:`semiont-branding ${t}`,"data-size":n,"data-animated":i,"data-compact-tagline":a,children:[(0,R.jsx)(`h1`,{className:`semiont-branding-title`,children:(0,R.jsx)(`span`,{className:`semiont-branding-text`,children:`Semiont`})}),r&&(0,R.jsx)(`h2`,{className:`semiont-branding-tagline`,children:e(`tagline`)})]})}function A$({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}=GF();if(o===`floating`&&i)return(0,R.jsxs)(`div`,{className:`semiont-unified-header semiont-unified-header--floating`,"data-variant":`floating`,ref:m,children:[(0,R.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,R.jsx)(k$,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]});let h=(0,R.jsxs)(`div`,{className:`semiont-unified-header__content`,"data-variant":o,children:[i?(0,R.jsxs)(`div`,{className:`semiont-unified-header__branding-wrapper`,ref:m,children:[(0,R.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,R.jsx)(k$,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]}):(0,R.jsx)(`div`,{}),(0,R.jsx)(`div`,{className:`semiont-unified-header__actions`,"data-variant":o})]});return o===`standalone`?(0,R.jsx)(`header`,{className:`semiont-unified-header semiont-unified-header--standalone`,"data-variant":`standalone`,children:(0,R.jsx)(`div`,{className:`semiont-unified-header__container`,children:h})}):h}function j$({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,y.useState)(!1),{width:p,setWidth:m,minWidth:h,maxWidth:g}=zF({defaultWidth:256,minWidth:192,maxWidth:400,storageKey:`semiont-left-sidebar-width`});return(0,y.useEffect)(()=>{o&&localStorage.getItem(s)===`true`&&f(!0)},[o,s]),(0,R.jsxs)(`aside`,{className:`semiont-left-sidebar`,"data-collapsed":d,style:d?void 0:{width:`${p}px`,position:`relative`},children:[!d&&(0,R.jsx)(FU,{onResize:m,minWidth:h,maxWidth:g,position:`right`,ariaLabel:`Resize left sidebar`}),(0,R.jsx)(`div`,{className:`semiont-left-sidebar__header`,"data-collapsed":d,children:(0,R.jsx)(e,{href:a,className:`semiont-left-sidebar__branding-button`,"aria-label":`Go to home page`,children:d?(0,R.jsx)(`div`,{className:`semiont-left-sidebar__logo-collapsed`,children:(0,R.jsx)(`span`,{className:`semiont-left-sidebar__logo-text`,children:`S`})}):(0,R.jsx)(k$,{t:r,size:`sm`,showTagline:!1,animated:!1,className:``})})}),(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:r,currentPath:u})):i})]})}function M$({Link:e,routes:t,t:n,tNav:r,tHome:i,children:a,className:o=``,showAuthLinks:s=!0,CookiePreferences:c,onOpenKeyboardHelp:l}){return(0,R.jsxs)(`div`,{className:`semiont-page-layout`,children:[(0,R.jsx)(D$,{}),(0,R.jsx)(`header`,{role:`banner`,className:`semiont-page-layout__header`,children:(0,R.jsx)(`div`,{className:`semiont-page-layout__header-container`,children:(0,R.jsx)(A$,{Link:e,routes:t,t:r,tHome:i,showAuthLinks:s,brandingLink:`/`,variant:`embedded`})})}),(0,R.jsx)(`main`,{role:`main`,id:`main-content`,tabIndex:-1,className:`semiont-page-layout__main ${o}`,children:a}),(0,R.jsx)(PY,{Link:e,routes:t,t:n,...c&&{CookiePreferences:c},...l&&{onOpenKeyboardHelp:l}})]})}function N$({message:e}){return(0,R.jsx)(`div`,{className:`semiont-loading-state-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-compose`,children:(0,R.jsx)(`p`,{className:`semiont-loading-message`,children:e})})})}function P$(){return(0,R.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-resource`,children:(0,R.jsx)(`p`,{className:`semiont-loading-message`,children:`Loading resource...`})})}function F$({error:e,onRetry:t}){return(0,R.jsxs)(`div`,{className:`semiont-error-state semiont-error-state-resource`,children:[(0,R.jsx)(`p`,{className:`semiont-error-message`,children:e instanceof Error?e.message:`Failed to load resource`}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-button`,"data-variant":`secondary`,children:`Try Again`})]})}function I$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 L$=y.forwardRef(I$);function R$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 z$=y.forwardRef(R$);function B$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 V$=y.forwardRef(B$);function H$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 U$=y.forwardRef(H$);function W$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 G$=y.forwardRef(W$);function K$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 q$=y.forwardRef(K$);function J$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 Y$=y.forwardRef(J$);function X$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 Z$=y.forwardRef(X$);function Q$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 $$=y.forwardRef(Q$);function e1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 t1=y.forwardRef(e1);function n1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 r1=y.forwardRef(n1);function i1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`}))}var a1=y.forwardRef(i1);function o1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 s1=y.forwardRef(o1);function c1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 l1=y.forwardRef(c1);function u1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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`}),y.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.008v.008H6V6Z`}))}var d1=y.forwardRef(u1);function f1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 p1=y.forwardRef(f1);function m1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 h1=y.forwardRef(m1),g1=Te(hm(),1),_1=[`knowledge-base`,`user`,`settings`];function v1(e,t){let n=[],r=new g1.BehaviorSubject(t?.initialPanel??null),i=new g1.BehaviorSubject(null),a=new g1.BehaviorSubject(null),o=0;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=iT(n)??`highlight`;a.next({tab:e,generation:++o})}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 y1({suggestedFeatures:e,theme:t,activePanel:n,translations:r,StatusDisplay:i,ToolbarPanels:a,Toolbar:o}){return(0,R.jsxs)(`div`,{className:`semiont-page${n&&_1.includes(n)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:r.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:r.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,R.jsx)(`h2`,{className:`semiont-admin__section-title`,children:r.systemStatus}),(0,R.jsx)(i,{})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,R.jsx)(`h2`,{className:`semiont-admin__section-title`,children:r.cliOperations}),(0,R.jsx)(`p`,{className:`semiont-admin__section-description`,children:r.cliOperationsDescription}),(0,R.jsx)(`div`,{className:`semiont-admin__features-grid`,children:e.map(e=>(0,R.jsx)(`div`,{className:`semiont-devops-feature`,children:(0,R.jsxs)(`div`,{className:`semiont-devops-feature__header`,children:[(0,R.jsx)(`div`,{className:`semiont-devops-feature__icon-box`,children:(0,R.jsx)(e.icon,{className:`semiont-devops-feature__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-devops-feature__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-devops-feature__title`,children:e.title}),(0,R.jsx)(`p`,{className:`semiont-devops-feature__description`,children:e.description}),(0,R.jsx)(`p`,{className:`semiont-devops-feature__available`,children:e.available})]})]})},e.title))})]}),(0,R.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-content`,children:[(0,R.jsx)(`div`,{className:`semiont-admin__info-box-icon`,children:(0,R.jsx)(U$,{className:`semiont-icon semiont-icon--info`})}),(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-text`,children:[(0,R.jsx)(`h3`,{className:`semiont-admin__info-box-title`,children:r.cliTitle}),(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-description`,children:[(0,R.jsx)(`p`,{children:r.cliDescription}),(0,R.jsx)(`code`,{className:`semiont-admin__info-box-code`,children:`semiont --help`})]})]})]})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(a,{activePanel:n,theme:t}),(0,R.jsx)(o,{context:`simple`,activePanel:n})]})]})}function b1({providers:e,allowedDomains:t,isLoading:n,theme:r,activePanel:i,translations:a,ToolbarPanels:o,Toolbar:s}){return(0,R.jsxs)(`div`,{className:`semiont-page${i&&_1.includes(i)?` semiont-page--panel-open`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-page__content`,children:(0,R.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:a.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:a.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,R.jsx)(l1,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`semiont-admin__card-title`,children:a.oauthProviders}),(0,R.jsx)(`p`,{className:`semiont-admin__card-description`,children:a.oauthProvidersDescription})]})]}),n?(0,R.jsx)(`div`,{className:`semiont-skeleton-group`,children:(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--bar`})}):e.length>0?(0,R.jsx)(`div`,{className:`semiont-provider-list`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`semiont-provider-item`,children:[(0,R.jsxs)(`div`,{className:`semiont-provider-item__info`,children:[(0,R.jsx)(z$,{className:`semiont-provider-item__icon semiont-provider-item__icon--success`}),(0,R.jsx)(`span`,{className:`semiont-provider-item__name`,children:e.name}),e.clientId&&(0,R.jsxs)(`span`,{className:`semiont-provider-item__client-id`,children:[a.clientId,`: `,e.clientId]})]}),(0,R.jsx)(`span`,{className:`semiont-badge semiont-badge--success`,children:a.configured})]},e.name))}):(0,R.jsx)(`div`,{className:`semiont-empty-message`,children:a.noProvidersConfigured})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,R.jsx)(Y$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`semiont-admin__card-title`,children:a.allowedDomains}),(0,R.jsx)(`p`,{className:`semiont-admin__card-description`,children:a.allowedDomainsDescription})]})]}),n?(0,R.jsxs)(`div`,{className:`semiont-skeleton-group`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip`}),(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip semiont-skeleton--chip-lg`})]}):t.length>0?(0,R.jsx)(`div`,{className:`semiont-domain-list`,children:t.map(e=>(0,R.jsxs)(`div`,{className:`semiont-chip semiont-chip--primary`,children:[`@`,e]},e))}):(0,R.jsx)(`div`,{className:`semiont-empty-message`,children:a.noDomainsConfigured})]}),(0,R.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,R.jsxs)(`div`,{className:`semiont-info-box__content`,children:[(0,R.jsx)(Z$,{className:`semiont-info-box__icon`}),(0,R.jsxs)(`div`,{className:`semiont-info-box__text`,children:[(0,R.jsx)(`p`,{className:`semiont-info-box__title`,children:a.configManagementTitle}),(0,R.jsx)(`p`,{className:`semiont-info-box__description`,children:a.configManagementDescription}),(0,R.jsxs)(`ul`,{className:`semiont-info-box__list`,children:[(0,R.jsx)(`li`,{children:a.configLocalDev}),(0,R.jsxs)(`li`,{children:[a.configCloudDeploy,` `,(0,R.jsx)(`code`,{className:`semiont-code-inline`,children:a.configCloudDeployCommand}),` `,a.configCloudDeployEnd]}),(0,R.jsx)(`li`,{children:a.configAWS})]})]})]})})]})}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(o,{activePanel:i,theme:r}),(0,R.jsx)(s,{context:`simple`,activePanel:i})]})]})}function x1({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,R.jsxs)(`tr`,{className:`semiont-table__row`,children:[(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsxs)(`div`,{className:`semiont-user-info`,children:[(0,R.jsx)(h1,{className:`semiont-user-info__avatar`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-user-info__name`,children:e.name||r.noName}),(0,R.jsx)(`div`,{className:`semiont-user-info__email`,children:e.email})]})]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsxs)(`span`,{className:`semiont-table__text--secondary`,children:[`@`,e.domain]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsx)(`span`,{className:i[o],children:r[o]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsx)(`span`,{className:a[s],children:r[s]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:e.lastLogin?new Date(e.lastLogin).toLocaleDateString():r.never}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:new Date(e.created).toLocaleDateString()}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__cell--actions`,children:(0,R.jsxs)(`div`,{className:`semiont-table__actions`,children:[(0,R.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,R.jsx)(l1,{className:`semiont-action-button__icon`})}),(0,R.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,R.jsx)(r1,{className:`semiont-action-button__icon`})}),(0,R.jsx)(`button`,{onClick:()=>n(e.id),className:`semiont-action-button semiont-action-button--danger`,title:r.deleteUser,children:(0,R.jsx)(p1,{className:`semiont-action-button__icon`})})]})})]})}function S1({users:e,userStats:t,isLoadingUsers:n,isLoadingStats:r,onUpdateUser:i,onDeleteUser:a,onAddUser:o,onExportUsers:s,theme:c,activePanel:l,translations:u,ToolbarPanels:d,Toolbar:f,buttonStyles:p}){let[m,h]=(0,y.useState)(``),[g,_]=(0,y.useState)(`all`),[v,b]=(0,y.useState)(`all`),x=e.filter(e=>{let t=(e.name||``).toLowerCase().includes(m.toLowerCase())||e.email.toLowerCase().includes(m.toLowerCase()),n=e.isAdmin?`admin`:`user`,r=e.isActive?`active`:`inactive`;return t&&(g===`all`||n===g)&&(v===`all`||r===v)});return(0,R.jsxs)(`div`,{className:`semiont-page${l&&_1.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-page__content`,children:(0,R.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header-with-action`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:u.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:u.subtitle})]}),(0,R.jsxs)(`button`,{onClick:o,className:p.primary.base,children:[(0,R.jsx)(a1,{className:`semiont-button__icon`}),u.addUser]})]}),(0,R.jsx)(`div`,{className:`semiont-admin__stats-grid`,children:r?[,,,,].fill(0).map((e,t)=>(0,R.jsx)(`div`,{className:`semiont-stat-card semiont-stat-card--loading`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--icon`}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--text`}),(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--number`})]})]})},t)):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(h1,{className:`semiont-stat-card__icon semiont-stat-card__icon--primary`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.totalUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.totalUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-stat-card__status-indicator semiont-stat-card__status-indicator--active`,children:(0,R.jsx)(`div`,{className:`semiont-stat-card__status-dot`})})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.activeUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.activeUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(l1,{className:`semiont-stat-card__icon semiont-stat-card__icon--danger`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.administrators}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.adminUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(q$,{className:`semiont-stat-card__icon semiont-stat-card__icon--warning`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.recentUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.recentSignups?.length??0})]})]})})]})}),(0,R.jsx)(`div`,{className:`semiont-admin__filters-card`,children:(0,R.jsxs)(`div`,{className:`semiont-admin__filters-grid`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`search`,className:`semiont-form__label`,children:u.searchUsers}),(0,R.jsxs)(`div`,{className:`semiont-search-input`,children:[(0,R.jsx)(`div`,{className:`semiont-search-input__icon`,children:(0,R.jsx)(t1,{className:`semiont-icon semiont-icon--small`})}),(0,R.jsx)(`input`,{type:`text`,id:`search`,className:`semiont-search-input__field`,placeholder:u.searchPlaceholder,value:m,onChange:e=>h(e.target.value)})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`role`,className:`semiont-form__label`,children:u.role}),(0,R.jsxs)(`select`,{id:`role`,className:`semiont-select`,value:g,onChange:e=>_(e.target.value),children:[(0,R.jsx)(`option`,{value:`all`,children:u.allRoles}),(0,R.jsx)(`option`,{value:`admin`,children:u.admin}),(0,R.jsx)(`option`,{value:`user`,children:u.user})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`status`,className:`semiont-form__label`,children:u.status}),(0,R.jsxs)(`select`,{id:`status`,className:`semiont-select`,value:v,onChange:e=>b(e.target.value),children:[(0,R.jsx)(`option`,{value:`all`,children:u.allStatus}),(0,R.jsx)(`option`,{value:`active`,children:u.active}),(0,R.jsx)(`option`,{value:`inactive`,children:u.inactive})]})]}),(0,R.jsx)(`div`,{className:`semiont-form__field semiont-form__field--align-end`,children:(0,R.jsx)(`button`,{onClick:s,className:`${p.secondary.base} semiont-button--full-width`,children:u.exportUsers})})]})}),(0,R.jsxs)(`div`,{className:`semiont-admin__table-card`,children:[(0,R.jsx)(`div`,{className:`semiont-table-container`,children:n?(0,R.jsxs)(`div`,{className:`semiont-loading-state`,children:[(0,R.jsx)(`div`,{className:`semiont-spinner`}),(0,R.jsx)(`p`,{className:`semiont-loading-state__text`,children:u.loadingUsers})]}):(0,R.jsxs)(`table`,{className:`semiont-table`,children:[(0,R.jsx)(`thead`,{className:`semiont-table__head`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.userColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.domainColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.roleColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.statusColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.lastLoginColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.joinedColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header semiont-table__header--actions`,children:u.actionsColumn})]})}),(0,R.jsx)(`tbody`,{className:`semiont-table__body`,children:x.map(e=>(0,R.jsx)(x1,{user:e,onUpdate:i,onDelete:a,translations:u},e.id))})]})}),!n&&x.length===0&&(0,R.jsxs)(`div`,{className:`semiont-empty-state`,children:[(0,R.jsx)(h1,{className:`semiont-empty-state__icon`}),(0,R.jsx)(`h3`,{className:`semiont-empty-state__title`,children:u.noUsersFound}),(0,R.jsx)(`p`,{className:`semiont-empty-state__description`,children:u.noUsersFoundDescription})]})]})]})}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(d,{activePanel:l,theme:c}),(0,R.jsx)(f,{context:`simple`,activePanel:l})]})]})}function C1(){return(0,R.jsxs)(`svg`,{className:`semiont-icon semiont-icon--small semiont-icon--inline`,viewBox:`0 0 24 24`,children:[(0,R.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,R.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,R.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,R.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 w1({onSignUp:e,Link:t,translations:n}){let[r,i]=(0,y.useState)(!1);return(0,R.jsx)(`main`,{className:`semiont-auth__main`,role:`main`,children:(0,R.jsx)(`div`,{className:`semiont-auth__container`,children:(0,R.jsxs)(`div`,{className:`semiont-auth__content`,children:[(0,R.jsxs)(`section`,{"aria-labelledby":`signup-heading`,className:`semiont-auth__branding`,children:[(0,R.jsx)(`h1`,{id:`signup-heading`,className:`sr-only`,children:n.pageTitle}),(0,R.jsx)(k$,{t:e=>n[e]||e,size:`xl`,animated:!0,className:`semiont-auth__logo`}),(0,R.jsx)(`p`,{className:`semiont-auth__welcome`,children:n.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-auth__subtitle`,children:n.signUpPrompt})]}),(0,R.jsxs)(`div`,{className:`semiont-auth__forms`,children:[(0,R.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:`${aT.primary.base} semiont-button--full-width`,children:[r?(0,R.jsx)(`div`,{className:`semiont-auth__spinner`}):(0,R.jsx)(C1,{}),r?n.creatingAccount:n.signUpWithGoogle]}),(0,R.jsxs)(`div`,{className:`semiont-auth__info`,children:[n.approvedDomainsInfo,(0,R.jsx)(`br`,{}),n.termsAgreement]})]}),(0,R.jsxs)(`div`,{className:`semiont-auth__links`,children:[(0,R.jsx)(t,{href:`/`,className:aT.secondary.base,children:n.backToHome}),(0,R.jsx)(t,{href:`/auth/signin`,className:aT.primary.base,children:n.alreadyHaveAccount})]})]})})})}function T1(e,t){switch(e){case`Configuration`:return t.errorConfiguration;case`AccessDenied`:return t.errorAccessDenied;case`Verification`:return t.errorVerification;default:return t.errorGeneric}}function E1({errorType:e,Link:t,translations:n}){let r=T1(e,n);return(0,R.jsx)(`div`,{className:`semiont-auth-error-display`,children:(0,R.jsxs)(`div`,{className:`semiont-auth-error-display__container`,children:[(0,R.jsx)(`div`,{children:(0,R.jsx)(`h2`,{className:`semiont-auth-error-display__title`,children:n.pageTitle})}),(0,R.jsx)(`div`,{className:`semiont-auth-error-display__error-box`,children:(0,R.jsx)(`div`,{className:`semiont-auth-error-display__error-message`,children:r})}),(0,R.jsx)(`div`,{className:`semiont-auth-error-display__actions`,children:(0,R.jsx)(t,{href:`/auth/signin`,className:`semiont-auth-error-display__link`,children:n.tryAgain})})]})})}function D1({userName:e,status:t,isProcessing:n,onAccept:r,onDecline:i,translations:a,PageLayout:o,Link:s}){return t===`loading`?(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__loading`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__loading-content`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__spinner`}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__loading-text`,children:a.loading})]})})}):t===`accepted`?(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__accepted`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__accepted-content`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__accepted-icon`,children:(0,R.jsx)(`svg`,{className:`semiont-welcome-page__accepted-checkmark`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`semiont-welcome-page__accepted-title`,children:a.welcomeTitle}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__accepted-subtitle`,children:a.thanksForAccepting})]})]})})}):(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__form-wrapper`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__form`,children:[(0,R.jsxs)(`div`,{className:`semiont-welcome-page__form-header`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__form-icon`,children:(0,R.jsx)(`svg`,{className:`semiont-welcome-page__form-icon-svg`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`h1`,{className:`semiont-welcome-page__form-title`,children:a.welcomeUser.replace(`{firstName}`,e||``)}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__form-subtitle`,children:a.reviewTermsPrompt})]}),(0,R.jsx)(`div`,{className:`semiont-welcome-page__terms-content`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__prose`,children:[(0,R.jsx)(`h3`,{children:a.termsSummaryTitle}),(0,R.jsx)(`p`,{children:a.termsSummaryIntro}),(0,R.jsx)(`h4`,{children:a.acceptableUseTitle}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.acceptableUseResponsible}),(0,R.jsx)(`li`,{children:a.acceptableUseRespect}),(0,R.jsx)(`li`,{children:a.acceptableUseConduct})]}),(0,R.jsx)(`h4`,{children:a.prohibitedContentTitle}),(0,R.jsx)(`p`,{children:a.prohibitedContentIntro}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.prohibitedIllegal}),(0,R.jsx)(`li`,{children:a.prohibitedAdult}),(0,R.jsx)(`li`,{children:a.prohibitedHate}),(0,R.jsx)(`li`,{children:a.prohibitedViolence}),(0,R.jsx)(`li`,{children:a.prohibitedMisinformation}),(0,R.jsx)(`li`,{children:a.prohibitedPrivacy}),(0,R.jsx)(`li`,{children:a.prohibitedCopyright}),(0,R.jsx)(`li`,{children:a.prohibitedMalware}),(0,R.jsx)(`li`,{children:a.prohibitedSpam})]}),(0,R.jsx)(`h4`,{children:a.conductTitle}),(0,R.jsxs)(`p`,{children:[a.conductDescription,` `,(0,R.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,R.jsx)(`h4`,{children:a.responsibilitiesTitle}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.responsibilitiesSecure}),(0,R.jsx)(`li`,{children:a.responsibilitiesReport}),(0,R.jsx)(`li`,{children:a.responsibilitiesAccurate}),(0,R.jsx)(`li`,{children:a.responsibilitiesComply})]}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__warning`,children:a.violationsWarning})]})}),(0,R.jsxs)(`div`,{className:`semiont-welcome-page__actions`,children:[(0,R.jsxs)(`p`,{className:`semiont-welcome-page__legal-links`,children:[a.readFullTerms,` `,(0,R.jsx)(s,{href:`/terms`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.termsOfService}),` `,a.and,` `,(0,R.jsx)(s,{href:`/privacy`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.privacyPolicy})]}),(0,R.jsxs)(`div`,{className:`semiont-welcome-page__buttons`,children:[(0,R.jsx)(`button`,{onClick:i,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--secondary`,children:a.declineAndSignOut}),(0,R.jsx)(`button`,{onClick:r,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--primary`,children:n?a.processing:a.acceptAndContinue})]}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__legal-notice`,children:a.legallyBound})]})]})})})}function O1({entityTypes:e,error:t,newTag:n,onNewTagChange:r,onAddTag:i,isAddingTag:a,theme:o,activePanel:s,translations:c,ToolbarPanels:l,Toolbar:u}){return(0,R.jsxs)(`div`,{className:`semiont-page${s&&_1.includes(s)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:c.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:c.pageDescription})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-entity-tags__header`,children:[(0,R.jsx)(`div`,{className:`semiont-entity-tags__icon-box`,children:(0,R.jsx)(d1,{className:`semiont-entity-tags__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-entity-tags__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-entity-tags__title`,children:c.sectionTitle}),(0,R.jsx)(`p`,{className:`semiont-entity-tags__description`,children:c.sectionDescription})]})]}),(0,R.jsx)(`div`,{className:`semiont-entity-tags__tags-section`,children:(0,R.jsx)(`div`,{className:`semiont-tags`,children:e.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--info semiont-tag--rounded-md`,children:e},e))})}),(0,R.jsxs)(`div`,{className:`semiont-entity-tags__input-group`,children:[(0,R.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},placeholder:c.inputPlaceholder,className:`semiont-entity-tags__input`,disabled:a}),(0,R.jsx)(`button`,{onClick:i,disabled:a||!n.trim(),className:`semiont-button semiont-button--primary`,children:a?c.adding:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(a1,{className:`semiont-icon semiont-icon--small semiont-icon--inline`}),c.addTag]})})]}),t&&(0,R.jsxs)(`div`,{className:`semiont-entity-tags__error`,children:[(0,R.jsx)(G$,{className:`semiont-entity-tags__error-icon`}),t]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(l,{activePanel:s,theme:o}),(0,R.jsx)(u,{context:`simple`,activePanel:s})]})]})}function k1({isLoading:e,theme:t,activePanel:n,translations:r,ToolbarPanels:i,Toolbar:a}){return e?(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:r.loading})}):(0,R.jsxs)(`div`,{className:`semiont-page${n&&_1.includes(n)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:r.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:r.pageDescription})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-recent-docs__header`,children:[(0,R.jsx)(`div`,{className:`semiont-recent-docs__icon-box`,children:(0,R.jsx)(V$,{className:`semiont-recent-docs__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-recent-docs__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-recent-docs__title`,children:r.sectionTitle}),(0,R.jsx)(`p`,{className:`semiont-recent-docs__description`,children:r.sectionDescription})]})]}),(0,R.jsxs)(`div`,{className:`semiont-recent-docs__empty-state`,children:[(0,R.jsx)(`svg`,{className:`semiont-recent-docs__empty-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`p`,{className:`semiont-recent-docs__empty-message`,children:r.noDocuments}),(0,R.jsx)(`p`,{className:`semiont-recent-docs__empty-hint`,children:r.activityWillAppear})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(i,{activePanel:n,theme:t}),(0,R.jsx)(a,{context:`simple`,activePanel:n})]})]})}var A1={legal:s1,scientific:L$,general:$$},j1={legal:`semiont-schema-domain--legal`,scientific:`semiont-schema-domain--scientific`,general:`semiont-schema-domain--general`};function M1({schemas:e,isLoading:t,theme:n,activePanel:r,translations:i,ToolbarPanels:a,Toolbar:o}){return t?(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:i.loading})}):(0,R.jsxs)(`div`,{className:`semiont-page${r&&_1.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:i.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.pageDescription})]}),(0,R.jsx)(`div`,{className:`semiont-card-grid semiont-card-grid--two-columns`,children:e.map(e=>{let t=A1[e.domain]||$$,n=j1[e.domain]||j1.general;return(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-schema__header`,children:[(0,R.jsx)(`div`,{className:`semiont-schema__icon-wrapper ${n}`,children:t&&(0,R.jsx)(t,{className:`semiont-schema__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-schema__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-schema__title`,children:e.name}),(0,R.jsx)(`p`,{className:`semiont-schema__description`,children:e.description}),(0,R.jsx)(`span`,{className:`semiont-schema__badge ${n}`,children:e.domain})]})]}),(0,R.jsxs)(`div`,{className:`semiont-schema__categories`,children:[(0,R.jsx)(`h4`,{className:`semiont-schema__categories-title`,children:i.categories}),e.tags.map(e=>(0,R.jsxs)(`div`,{className:`semiont-schema__category`,children:[(0,R.jsx)(`div`,{className:`semiont-schema__category-name`,children:e.name}),(0,R.jsx)(`div`,{className:`semiont-schema__category-description`,children:e.description}),(0,R.jsxs)(`div`,{className:`semiont-schema__examples`,children:[e.examples.slice(0,2).map((e,t)=>(0,R.jsx)(`span`,{className:`semiont-schema__example`,children:e},t)),e.examples.length>2&&(0,R.jsxs)(`span`,{className:`semiont-schema__example-more`,children:[`+`,e.examples.length-2,` more`]})]})]},e.name))]})]},e.id)})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(a,{activePanel:r,theme:n}),(0,R.jsx)(o,{context:`simple`,activePanel:r})]})]})}function N1(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function P1({progress:e,label:t=`Upload`}){if(!e)return null;if(e.phase===`started`)return(0,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:(0,R.jsxs)(`span`,{children:[t,`: starting…`]})}),(0,R.jsx)(`div`,{className:`semiont-progress semiont-progress--indeterminate`,children:(0,R.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,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:n?(0,R.jsxs)(`span`,{children:[t,`: `,N1(e.bytesUploaded),`…`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{children:[t,`: `,r,`%`]}),(0,R.jsxs)(`span`,{children:[N1(e.bytesUploaded),` / `,N1(e.totalBytes)]})]})}),(0,R.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,R.jsx)(`div`,{className:`semiont-progress__fill`,style:n?void 0:{width:`${r}%`}})})]})}return(0,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:(0,R.jsxs)(`span`,{children:[t,`: uploaded`]})}),(0,R.jsx)(`div`,{className:`semiont-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":100,children:(0,R.jsx)(`div`,{className:`semiont-progress__fill semiont-progress__fill--success`,style:{width:`100%`}})})]})}var F1=Object.values(gi).map(e=>e.extension).join(`,`);function I1(e){if(e.type&&yi(e.type))return e.type;if(e.name.includes(`.`)){let t=Ti(e.name.slice(e.name.lastIndexOf(`.`)));if(t)return t}return`application/octet-stream`}function L1({mode:e,cloneData:t,availableEntityTypes:n,initialLocale:r,theme:i,hoverDelayMs:a,activePanel:o,onSaveResource:s,onCancel:c,uploadProgress:l=null,translations:u,ToolbarPanels:d,Toolbar:f}){let{announceFormSubmitting:p,announceFormSuccess:m,announceFormError:h}=cI(),{showLineNumbers:g}=vm(),[_,v]=(0,y.useState)(``),[b,x]=(0,y.useState)(``),[S,C]=(0,y.useState)([]),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)(`write`),[O,k]=(0,y.useState)(null),[A,j]=(0,y.useState)(`text/markdown`),[M,ee]=(0,y.useState)(null),[N,te]=(0,y.useState)(!1),[P,F]=(0,y.useState)(`text/markdown`),[ne,re]=(0,y.useState)(r),[ie,ae]=(0,y.useState)(``),[oe,se]=(0,y.useState)(``),[I,L]=(0,y.useState)(!0),ce=yi(P)?P:`text/markdown`,le=oe===``?Ni(e===`clone`&&t?Mi(Wr(t.sourceResource)):``,_,ce):oe;(0,y.useEffect)(()=>{e===`clone`&&t&&(v(t.sourceResource.name),x(t.sourceContent))},[e,t]);let ue=e=>{let t=e.target.files?.[0];t&&de(t)},de=e=>{let t=I1(e);if(k(e),j(t),D(`upload`),!_){let t=e.name.replace(/\.[^/.]+$/,``);v(t)}let n=bi(t)?.render;if(n===`image`||n===`pdf`){let t=URL.createObjectURL(e);ee(t)}else{let t=new FileReader;t.onload=e=>{let t=e.target?.result;x(t)},t.readAsText(e)}};(0,y.useEffect)(()=>()=>{M&&URL.revokeObjectURL(M)},[M]);let fe=async t=>{if(t.preventDefault(),_.trim()){T(!0),p();try{let t={mode:e,name:_,storageUri:`file://${le}`,content:b,format:O?A:P,entityTypes:S,language:ne};O&&(t.file=O),ie&&(t.charset=ie),e===`clone`&&(t.archiveOriginal=I),await s(t),m(e===`clone`?`Resource cloned successfully`:`Resource created successfully`)}catch(e){throw h(`Failed to save resource. Please try again.`),e}finally{T(!1)}}},pe=e===`clone`;return(0,R.jsxs)(`div`,{className:`semiont-page${o&&_1.includes(o)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content semiont-page__compose`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:pe?u.titleEditClone:u.title}),pe&&(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:u.subtitleClone})]}),(0,R.jsx)(`div`,{className:`semiont-form`,children:(0,R.jsxs)(`form`,{onSubmit:fe,className:`semiont-form__fields semiont-compose-grid`,children:[(0,R.jsxs)(`div`,{className:`semiont-compose-grid__meta`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`docName`,className:`semiont-form__label`,children:u.resourceName}),(0,R.jsx)(`input`,{id:`docName`,type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:u.resourceNamePlaceholder,className:`semiont-input`,required:!0,disabled:w})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`storagePath`,type:`text`,value:le,onChange:e=>se(e.target.value),placeholder:`docs/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:w})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,R.jsx)(`div`,{className:`semiont-form__label`,children:u.entityTypes}),(0,R.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,"aria-describedby":`entity-types-description`,children:n.map(e=>{let t=S.includes(e);return(0,R.jsx)(`button`,{type:`button`,onClick:()=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`semiont-form__entity-type-button`,"data-selected":t,disabled:w,"aria-pressed":t,"aria-label":`${e} entity type, ${t?`selected`:`not selected`}`,children:e},e)})}),S.length>0&&(0,R.jsxs)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:[S.length,` entity type`,S.length===1?``:`s`,` selected: `,S.join(`, `)]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:u.language}),(0,R.jsx)(`select`,{id:`language-select`,value:ne,onChange:e=>re(e.target.value),disabled:w,className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]})]}),(0,R.jsxs)(`div`,{className:`semiont-compose-grid__content`,children:[!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:u.contentSource}),(0,R.jsxs)(`div`,{className:`semiont-form__content-source-toggle`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>D(`upload`),disabled:w,className:`semiont-form__content-source-button`,"data-active":E===`upload`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,R.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`📎`}),(0,R.jsx)(`span`,{className:`semiont-form__content-source-label`,children:u.uploadFile})]}),(0,R.jsx)(`div`,{className:`semiont-form__content-source-description`,children:u.uploadFileDescription})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>D(`write`),disabled:w,className:`semiont-form__content-source-button`,"data-active":E===`write`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,R.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`✍️`}),(0,R.jsx)(`span`,{className:`semiont-form__content-source-label`,children:u.writeContent})]}),(0,R.jsx)(`div`,{className:`semiont-form__content-source-description`,children:u.writeContentDescription})]})]})]}),!pe&&E===`upload`&&(0,R.jsxs)(`div`,{className:`semiont-form__upload-section`,children:[(0,R.jsx)(`div`,{children:(0,R.jsxs)(`div`,{className:`semiont-form__upload-container`,children:[(0,R.jsx)(`label`,{className:`semiont-form__upload-dropzone`,"data-drag-over":N?`true`:`false`,onDragOver:e=>{e.preventDefault(),te(!0)},onDragLeave:()=>te(!1),onDrop:e=>{e.preventDefault(),te(!1);let t=e.dataTransfer.files?.[0];t&&!w&&de(t)},children:(0,R.jsxs)(`div`,{className:`semiont-form__upload-area`,children:[(0,R.jsx)(`input`,{type:`file`,accept:F1,onChange:ue,className:`semiont-form__upload-input`,disabled:w}),(0,R.jsx)(`p`,{className:`semiont-form__upload-text`,children:O?O.name:u.dropFileOrClick}),(0,R.jsx)(`p`,{className:`semiont-form__upload-hint`,children:u.supportedFormats})]})}),O&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>{k(null),ee(null),j(`text/markdown`)},className:`semiont-button semiont-button--danger semiont-button--small`,disabled:w,children:`Clear`})]})}),O&&(0,R.jsxs)(`div`,{className:`semiont-form__media-type`,children:[(0,R.jsxs)(`span`,{className:`semiont-form__media-type-label`,children:[u.mediaType,`:`]}),(0,R.jsx)(`code`,{className:`semiont-form__media-type-value`,children:A}),(0,R.jsx)(`span`,{className:`semiont-form__media-type-lock`,title:u.autoDetected,children:`🔒`})]}),O&&M&&bi(A)?.render===`image`&&(0,R.jsxs)(`div`,{className:`semiont-form__image-preview`,children:[(0,R.jsx)(`p`,{className:`semiont-form__image-preview-label`,children:`Preview:`}),(0,R.jsx)(`div`,{className:`semiont-form__image-preview-container`,children:(0,R.jsx)(`img`,{src:M,alt:`Upload preview`,className:`semiont-form__image-preview-img`})})]})]}),(pe||E===`write`)&&(0,R.jsxs)(`div`,{className:`semiont-form__write-section`,children:[!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`format-select`,className:`semiont-form__label`,children:u.format}),(0,R.jsx)(`select`,{id:`format-select`,value:P,onChange:e=>F(e.target.value),disabled:w,className:`semiont-select`,children:Oi.map(e=>(0,R.jsxs)(`option`,{value:e,children:[bi(e)?.label??e,` (`,e,`)`]},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:pe?u.resourceContent:u.content}),(0,R.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:ne,children:(0,R.jsx)(DU,{content:b,editable:!w,sourceView:!0,showLineNumbers:g,hoverDelayMs:a,onChange:e=>x(e)})})]}),!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`charset-select`,className:`semiont-form__label`,children:u.encoding}),(0,R.jsxs)(`select`,{id:`charset-select`,value:ie,onChange:e=>ae(e.target.value),disabled:w,className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:``,children:`UTF-8 (default)`}),(0,R.jsx)(`option`,{value:`iso-8859-1`,children:`ISO-8859-1 (Latin-1)`}),(0,R.jsx)(`option`,{value:`windows-1252`,children:`Windows-1252`}),(0,R.jsx)(`option`,{value:`ascii`,children:`ASCII`}),(0,R.jsx)(`option`,{value:`utf-16le`,children:`UTF-16LE`})]})]})]}),pe&&(0,R.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,R.jsx)(`input`,{id:`archiveOriginal`,type:`checkbox`,checked:I,onChange:e=>L(e.target.checked),className:`semiont-checkbox`,disabled:w}),(0,R.jsx)(`label`,{htmlFor:`archiveOriginal`,className:`semiont-form__checkbox-label`,children:u.archiveOriginal})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:c,disabled:w||l!==null,className:aT.tertiary.base,children:u.cancel}),(0,R.jsx)(`button`,{type:`submit`,disabled:w||l!==null||!_.trim(),className:aT.primary.base,children:w?pe?u.saving:u.creating:pe?u.saveClonedResource:u.createResource})]}),(0,R.jsx)(P1,{progress:l})]})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(d,{activePanel:o,theme:i}),(0,R.jsx)(f,{context:`simple`,activePanel:o})]})]})}var R1=y.memo(({resource:e,onOpen:t,tabIndex:n=0,archivedLabel:r,createdLabel:i})=>(0,R.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,R.jsxs)(`div`,{className:`semiont-resource-card__header`,children:[(0,R.jsx)(`h4`,{className:`semiont-resource-card__title`,children:e.name}),e.archived&&(0,R.jsx)(`span`,{className:`semiont-resource-card__badge`,"data-type":`archived`,children:r})]}),(0,R.jsxs)(`div`,{className:`semiont-resource-card__metadata`,children:[(0,R.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,R.jsxs)(`div`,{className:`semiont-tags`,children:[e.entityTypes.slice(0,2).map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:e},e)),e.entityTypes.length>2&&(0,R.jsxs)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:[`+`,e.entityTypes.length-2]})]})]})]}));R1.displayName=`ResourceCard`;function z1({recentDocuments:e,searchDocuments:t,entityTypes:n,isLoadingRecent:r,recentError:i=null,onRetryRecent:a,isSearching:o,searchMatchKind:s,searchQuery:c,onSearchQueryChange:l,selectedEntityType:u,onSelectedEntityTypeChange:d,theme:f,activePanel:p,onNavigateToResource:m,onNavigateToCompose:h,translations:g,ToolbarPanels:_}){let v=c.trim()!==``,b=v?t:e,x=BF(n.length+1,{orientation:`horizontal`}),S=BF(b.length,{orientation:`grid`,cols:2}),C=(0,y.useRef)(m);C.current=m;let w=(0,y.useCallback)(e=>{d(e)},[d]),T=(0,y.useCallback)(e=>{let t=Br(e);t&&C.current(t)},[]);if(i)return(0,R.jsxs)(`div`,{className:`semiont-page__loading`,children:[(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:g.recentFailed}),a&&(0,R.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button`,"data-variant":`secondary`,children:g.retry})]});if(r)return(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:g.loadingKnowledgeBase})});let E=v&&t.length===0&&!o;return(0,R.jsxs)(`div`,{className:`semiont-page${p&&_1.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:g.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:g.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsx)(`div`,{className:`semiont-card__search-form`,children:(0,R.jsxs)(`div`,{className:`semiont-card__search-wrapper`,children:[(0,R.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:g.searchPlaceholder,className:`semiont-card__search-input`,"aria-label":g.searchPlaceholder}),o&&(0,R.jsx)(`span`,{className:`semiont-card__search-status`,"aria-live":`polite`,children:g.searching})]})}),n.length>0&&(0,R.jsxs)(`div`,{className:`semiont-card__filters`,children:[(0,R.jsx)(`h3`,{className:`semiont-card__filters-label`,children:g.filterByEntityType}),(0,R.jsxs)(`div`,{ref:x.containerRef,onKeyDown:x.handleKeyDown,className:`semiont-card__filter-buttons`,role:`group`,"aria-label":`Entity type filters`,children:[(0,R.jsx)(`button`,{onClick:()=>w(``),tabIndex:0,"aria-pressed":u===``,className:`semiont-card__filter-button`,"data-active":u===``,children:g.all}),n.map(e=>(0,R.jsx)(`button`,{onClick:()=>w(e),tabIndex:-1,"aria-pressed":u===e,className:`semiont-card__filter-button`,"data-active":u===e,children:e},e))]})]}),(0,R.jsxs)(`div`,{className:`semiont-card__documents`,children:[(0,R.jsx)(`h3`,{className:`semiont-card__documents-label`,children:v&&t.length>0?g.searchResults(t.length):u?g.documentsTaggedWith(u):g.recentResources}),v&&s===`semantic`&&t.length>0&&(0,R.jsx)(`p`,{className:`semiont-card__documents-note`,"data-testid":`semiont-semantic-match-notice`,"aria-live":`polite`,children:g.semanticFallbackNotice}),E&&(0,R.jsx)(`div`,{className:`semiont-card__warning`,children:(0,R.jsx)(`p`,{className:`semiont-card__warning-text`,children:g.noResultsFound(c)})}),b.length>0?(0,R.jsx)(`div`,{ref:S.containerRef,onKeyDown:S.handleKeyDown,className:`semiont-card-grid`,role:`group`,"aria-label":`Document grid`,children:b.map((e,t)=>(0,R.jsx)(R1,{resource:e,onOpen:T,tabIndex:t===0?0:-1,archivedLabel:g.archived,createdLabel:g.created},Br(e)))}):(0,R.jsxs)(`div`,{className:`semiont-card__empty`,children:[(0,R.jsx)(`p`,{className:`semiont-card__empty-text`,children:g.noResourcesAvailable}),!v&&(0,R.jsx)(`button`,{onClick:h,className:`semiont-card__empty-button`,children:g.composeFirstResource})]})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(_,{activePanel:p,theme:f}),(0,R.jsx)(IU,{context:`simple`,activePanel:p})]})]})}function B1(e,t){let n=Z(Sm().activeSession$),r=(0,y.useRef)(null);(0,y.useEffect)(()=>{!t||!n||r.current!==e&&(r.current=e,n.client.browse.resourceViewed(e))},[e,t,n])}var V1=[`no-text-layer`,`encrypted`,`corrupt`,`too-large`,`empty`];function H1(e){return!Ii(e)||e.declined!==!0||!Pi(e.reason)?null:V1.includes(e.reason)?e.reason:null}function U1(e){let t=ah(`OutcomeToasts`),{showError:n,showSuccess:r,showInfo:i}=Om();rI({"mark:create-error":r=>{r.resourceId===e&&n(t(`createFailed`,{detail:r.message||t(`unknownError`)}))},"mark:delete-error":r=>{r.resourceId===e&&n(t(`deleteFailed`,{detail:r.message||t(`unknownError`)}))},"bind:body-error":r=>{r.resourceId===e&&n(t(`referenceUpdateFailed`,{detail:r.message||t(`unknownError`)}))},"mark:assist-timeout":n=>{n.resourceId===e&&i(t(`assistQuiet`))},"job:complete":n=>{if(n.resourceId!==e)return;if(n.result?.kind===`generation`){r(n.result.resourceName?t(`resourceCreatedNamed`,{name:n.result.resourceName}):t(`resourceCreated`));return}let a=H1(n.result);a?i(t(`decline_${a}`)):r(t(`annotationComplete`))},"job:fail":r=>{r.resourceId===e&&(r.jobType===`generation`?n(t(`generationFailed`,{detail:r.error})):n(r.error||t(`annotationFailed`)))}})}function W1(e,t,n){let r=(0,y.useRef)(e),i=(0,y.useRef)(null),a=(0,y.useRef)(n);(0,y.useEffect)(()=>{a.current=n}),(0,y.useEffect)(()=>{if(e&&e!==r.current&&(r.current=e,i.current=e),!i.current)return;let n=String(i.current.resourceId),o=t.find(e=>e.motivation===`linking`&&String(yr(e.body)??``)===n);o&&(i.current=null,a.current(o.id))},[e,t])}var G1=Te(hm(),1),K1=Te(hm(),1);function q1(e,t){let n=new K1.BehaviorSubject(t),r=new K1.BehaviorSubject(!0),i=new K1.BehaviorSubject(!1),a=new K1.BehaviorSubject(null),o=!1,s=null,c=!1,l=()=>{c||(s?.unsubscribe(),s=e().subscribe(e=>{switch(e.status){case`pending`:o&&!i.getValue()&&i.next(!0);return;case`ready`:a.getValue()!==null&&a.next(null),o=!0,n.next(e.value),r.getValue()&&r.next(!1),i.getValue()&&i.next(!1);return;case`failed`:a.next(e.error),r.getValue()&&r.next(!1),i.getValue()&&i.next(!1);return}}))};return l(),{state:{value$:n.asObservable(),loading$:r.asObservable(),revalidating$:i.asObservable(),error$:a.asObservable(),retry:()=>{c||(a.next(null),o?i.next(!0):r.next(!0),l())}},dispose:()=>{c||(c=!0,s?.unsubscribe(),s=null,n.complete(),r.complete(),i.complete(),a.complete())}}}var J1={open:!1,annotationId:null,resourceId:null,defaultTitle:``,entityTypes:[]};function Y1(e,t,n,r,i){let{client:a}=e,o=Kl(),s=Jl(a),c=tu(a,t),l=Xl(a,t),u=Zl(a,t),d=Ql(a,n);o.add(s),o.add(c),o.add(l),o.add(u),o.add(d);let f=q1(()=>a.browse.annotations(t),[]),p=q1(()=>a.browse.entityTypes(),[]),m=q1(()=>a.browse.events(t),[]),h=q1(()=>a.browse.referencedBy(t),[]);o.add(f.dispose),o.add(p.dispose),o.add(m.dispose),o.add(h.dispose);let g=f.state.value$.pipe((0,G1.map)(qF)),_=new G1.BehaviorSubject(``),v=new G1.BehaviorSubject(!1),y=new G1.BehaviorSubject(null),b=i?.mediaType||`text/plain`,x=Ei(b)!==`decode`;!x&&b&&(v.next(!0),a.browse.resourceRepresentation(t).then(({data:e,contentType:t})=>{_.next(pi(e,t)),v.next(!1)}).catch(()=>{v.next(!1)})),x&&a.auth.mediaToken(t).then(({token:e})=>y.next(e)).catch(()=>{});let S=new G1.BehaviorSubject(J1),C=a.bus.get(`bind:initiate`).subscribe(e=>{S.next({open:!0,annotationId:e.annotationId,resourceId:e.resourceId,defaultTitle:e.defaultTitle,entityTypes:e.entityTypes}),a.bus.get(`gather:requested`).next({correlationId:hr(),annotationId:e.annotationId,resourceId:e.resourceId,options:{contextWindow:2e3}})});return o.add(()=>C.unsubscribe()),{beckon:s,browse:r,mark:c,gather:l,yield:d,annotations:f.state,entityTypes:p.state,events:m.state,referencedBy:h.state,annotationGroups$:g,content$:_.asObservable(),contentLoading$:v.asObservable(),mediaToken$:y.asObservable(),wizard$:S.asObservable(),closeWizard:()=>S.next(J1),dispose:()=>{S.complete(),_.complete(),v.complete(),y.complete(),o.dispose()}}}function X1(){return typeof window>`u`?null:localStorage.getItem(`activeToolbarPanel`)||`knowledge-base`}function Z1(e){typeof window>`u`||(e?localStorage.setItem(`activeToolbarPanel`,e):localStorage.removeItem(`activeToolbarPanel`))}function Q1(){let e=Sm();return AF(()=>v1(e,{initialPanel:X1(),onPanelChange:Z1}))}function $1(e,t){let{context:n,...r}=e;return{...r,...t?{sourceLanguage:t}:{}}}function e0({resource:e,rUri:t,locale:n,Link:r,routes:i,ToolbarPanels:a,refetchDocument:o,streamStatus:s,knowledgeBaseName:c,browseRenderers:l,annotateRenderers:u}){let d=ah(`ReferenceWizard`),f=ah(`ResourceGenerate`),p=Sm(),m=Z(p.activeSession$),h=m?.client,g=RF(),{collaborators:_}=YF(h??null),v=_.find(e=>e.servesJobTypes?.includes(`generation`)),b=(0,y.useCallback)(e=>{g(`/know/resource/${e}`,{resourceId:e})},[g]),x=(0,y.useCallback)(e=>{p.emit(`panel:open`,e)},[p]),{showError:S,showSuccess:C}=Om(),{theme:w}=WF(),{showLineNumbers:T}=vm(),{hoverDelayMs:E}=LF(),{triggerSparkleAnimation:D,clearSparkle:O,sparkleAnnotationIds:k}=fI(),A=Hr(e)||`text/plain`,j=eI(_F(A)),M=j.annotateMode,ee=bi(A)?.render,N=ee===`image`||ee===`pdf`,{content:te,loading:P,error:F}=KF(h??null,t,e,!N);(0,y.useEffect)(()=>{F&&S(`Failed to load resource representation`)},[F,S]);let{token:ne,loading:re}=JF(h??null,t),ie=(N?bF(h,t,ne):void 0)??``,ae=N?ie:te,oe=N?re:P,se=Q1(),I=jF(m??void 0,e=>Y1(e,t,n,se)),L=Z(I?.annotations.value$)??[],ce=Z(I?.annotations.error$)??null,le=Z(I?.annotationGroups$),ue=Z(I?.entityTypes.value$)??[],de=Z(I?.entityTypes.error$)??null,fe=Z(I?.referencedBy.value$)??[],pe=Z(I?.referencedBy.loading$)??!0,me=Z(I?.referencedBy.error$)??null,he=Z(I?.events.value$)??[],ge=Z(I?.events.loading$)??!0,_e=Z(I?.events.error$)??null,ve=Z(I?.beckon.hoveredAnnotationId$)??null,ye=Z(I?.mark.pendingAnnotation$)??null,be=Z(I?.mark.assistingMotivation$)??null,xe=Z(I?.mark.progress$)??null,Se=Z(I?.browse.activePanel$)??null,Ce=Z(I?.browse.scrollToAnnotationId$)??null,z=Z(I?.browse.panelInitialTab$)??null,we=I?.browse.onScrollCompleted,Te=Z(I?.yield.progress$)??null,Ee=Z(I?.yield.isGenerating$)??!1,De=Z(I?.yield.outcome$)??null;W1(De,L,(0,y.useCallback)(e=>{p.emit(`panel:open`,{panel:`annotations`,scrollToAnnotationId:e,motivation:`linking`}),D(e)},[p,D]));let Oe=Z(I?.gather.context$)??null,ke=Z(I?.gather.loading$)??!1,Ae=Z(I?.gather.error$)??null,je=Z(I?.gather.resourceContext$)??null,Me=Z(I?.gather.resourceLoading$)??!1,Ne=Z(I?.gather.resourceError$)??null,Pe=Z(I?.wizard$),Fe=Pe?.open??!1,Ie=Pe?.annotationId??null,Le=Pe?.resourceId??null,Re=Pe?.defaultTitle??``,ze=Pe?.entityTypes??[],[Be,Ve]=(0,y.useState)(!1),He=(0,y.useCallback)(()=>{I?.closeWizard()},[I]),Ue=(0,y.useCallback)((t,n)=>{O(lr(t)),I?.yield.generate(n.context,$1(n,Ur(e)))},[I,O,e]),We=(0,y.useCallback)((t,n)=>{I?.yield.generate(n.context,$1(n,Ur(e)))},[I,e]),Ge=(0,y.useCallback)(async(e,n)=>{if(h)try{await h.bind.body(t,lr(e),[{op:`add`,item:{type:`SpecificResource`,source:n,purpose:`linking`}}]),C(`Reference linked successfully`)}catch(e){S(`Failed to link reference: ${e instanceof Error?e.message:String(e)}`)}},[t,h,C,S]),Ke=(0,y.useCallback)(async(e,n)=>{if(!h)throw Error(`No active session`);try{let r=`text/markdown`,i=new File([new Blob([n.content],{type:r})],n.name+Si(r),{type:r}),a=await new Promise((e,t)=>{h.yield.resource({name:n.name,file:i,format:r,entityTypes:n.entityTypes,language:n.language,storageUri:n.storagePath}).subscribe({next:t=>{t.phase===`finished`&&e(t.resourceId)},error:t})});await h.bind.body(t,lr(e),[{op:`add`,item:{type:`SpecificResource`,source:a,purpose:`linking`}}]),C(`Reference successfully linked to the new resource`)}catch(e){throw S(`Failed to compose resource: ${e instanceof Error?e.message:String(e)}`),e}},[h,t,C,S]);(0,y.useEffect)(()=>{if(e&&t){let n=Hr(e);p.addOpenResource(t,e.name,n||void 0,Wr(e)),p.setLastViewedResource(t)}},[e,t,p]),(0,y.useEffect)(()=>{ye&&p.emit(`panel:open`,{panel:`annotations`})},[ye,p]);let qe=(0,y.useCallback)(async()=>{if(h)try{await h.mark.archive(t),await o()}catch(e){console.error(`Failed to archive document:`,e),S(`Failed to archive document`)}},[h,t,o,S]),Je=(0,y.useCallback)(async()=>{if(h)try{await h.mark.unarchive(t),await o()}catch(e){console.error(`Failed to unarchive document:`,e),S(`Failed to unarchive document`)}},[h,t,o,S]),Ye=(0,y.useCallback)(async()=>{if(h)try{let e=(await h.yield.cloneToken(t)).token;p.emit(`nav:push`,{path:`/know/compose?mode=clone&token=${e}`,reason:`clone`})}catch(e){console.error(`Failed to generate clone token:`,e),S(`Failed to generate clone link`)}},[h,t,S,p]),Xe=(0,y.useCallback)(({annotationId:e})=>{D(e)},[D]),Ze=(0,y.useCallback)(e=>{D(e.payload.annotation.id)},[D]),Qe=(0,y.useCallback)(e=>{e.payload.operations.some(e=>e.op===`add`&&e.item.type===`SpecificResource`&&e.item.purpose===`linking`)&&D(e.payload.annotationId)},[D]),$e=(0,y.useCallback)(({resourceId:e})=>{if(i.resourceDetail){let t=i.resourceDetail(e);p.emit(`nav:push`,{path:t,reason:`reference-link`})}},[i.resourceDetail,p]),et=(0,y.useCallback)(({entityType:e})=>{if(i.know){let t=`${i.know}?entityType=${encodeURIComponent(e)}`;p.emit(`nav:push`,{path:t,reason:`entity-type-filter`})}},[i.know,p]);U1(t),rI({"mark:archive":qe,"mark:unarchive":Je,"yield:clone":Ye,"beckon:sparkle":Xe,"mark:added":Ze,"mark:body-updated":Qe,"browse:resource-open":$e,"browse:entity-type-clicked":et});let{announceResourceLoading:tt,announceResourceLoaded:nt}=sI();(0,y.useEffect)(()=>{oe?tt(e.name):ae&&nt(e.name)},[oe,ae,e.name,tt,nt]),B1(t,!oe&&!!ae);let rt=e.entityTypes||[],it=Vr(e),at=it?.mediaType,ot=it?.byteSize,st={...e,content:ae},ct=(0,y.useCallback)(e=>{e&&m?.client.beckon.sparkle(lr(e))},[m]),lt=(0,y.useCallback)(e=>{e&&I?.beckon.focus(lr(e))},[I]);return(0,R.jsxs)(`div`,{className:`semiont-document-viewer${Se?` semiont-document-viewer--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-document-viewer__main`,children:[(0,R.jsxs)(`div`,{className:`semiont-document-viewer__content`,children:[(0,R.jsx)(`div`,{className:`semiont-document-viewer__header`,children:(0,R.jsx)(`div`,{className:`semiont-document-viewer__header-inner`,children:(0,R.jsx)(`h2`,{className:`semiont-document-viewer__title`,children:e.name})})}),(0,R.jsx)(`div`,{className:`semiont-document-viewer__scrollable-body`,lang:Ur(e)||void 0,children:(0,R.jsx)(jU,{fallback:(e,t)=>(0,R.jsxs)(`div`,{className:`semiont-document-viewer__error`,children:[(0,R.jsx)(`h3`,{className:`semiont-document-viewer__error-title`,children:`Error loading document viewer`}),(0,R.jsx)(`p`,{className:`semiont-document-viewer__error-message`,children:e.message}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-document-viewer__error-button`,children:`Try again`})]}),children:oe?(0,R.jsx)(`div`,{className:`semiont-document-viewer__loading`,children:`Loading document content...`}):(0,R.jsx)(KJ,{resource:st,annotations:le??{highlights:[],comments:[],assessments:[],references:[],tags:[]},session:m??null,onOpenResource:b,onOpenPanel:x,annotateMode:j.annotateMode,onAnnotateModeChange:j.setAnnotateMode,clickAction:j.clickAction,onClickActionChange:j.setClickAction,selectionMotivation:j.selectionMotivation,onSelectionMotivationChange:j.setSelectionMotivation,shape:j.shape,onShapeChange:j.setShape,sparkleAnnotationIds:k,generatingReferenceId:Te?.annotationId??null,showLineNumbers:T,hoverDelayMs:E,hoveredAnnotationId:ve,...l&&{browseRenderers:l},...u&&{annotateRenderers:u}})})})]}),(0,R.jsxs)(`div`,{className:`semiont-document-viewer__sidebar`,children:[(0,R.jsxs)(a,{activePanel:Se,theme:w,width:Se===`jsonld`?`w-[600px]`:Se===`annotations`?`w-[400px]`:`w-64`,children:[M&&e.archived&&(0,R.jsx)(`div`,{className:`semiont-document-viewer__archived-status`,children:(0,R.jsx)(`div`,{className:`semiont-document-viewer__archived-text`,children:`📦 Archived`})}),Se===`annotations`&&!e.archived&&(0,R.jsx)(NY,{session:m??null,onOpenResource:b,annotations:L,annotators:rT,annotateMode:M,assistingMotivation:be,progress:xe,pendingAnnotation:ye,allEntityTypes:ue,annotationsError:ce,onRetryAnnotations:I?.annotations.retry,entityTypesError:de,generatingReferenceId:Te?.annotationId??null,sparkleAnnotationIds:k,referencedBy:fe,referencedByLoading:pe,referencedByError:me,onRetryReferencedBy:I?.referencedBy.retry,resourceId:t,locale:n,sourceLanguage:Ur(e),scrollToAnnotationId:Ce,hoveredAnnotationId:ve,onScrollCompleted:we,initialTab:z?.tab,initialTabGeneration:z?.generation,Link:r,routes:i}),Se===`history`&&(0,R.jsx)(LJ,{events:he,eventsLoading:ge,eventsError:_e,onRetryEvents:I?.events.retry,annotations:L,hoveredAnnotationId:ve,onEventHover:ct,onEventClick:lt,Link:r,routes:i}),Se===`info`&&(0,R.jsx)(EY,{session:m??null,resourceId:t,documentEntityTypes:rt,documentLocale:Ur(e),primaryMediaType:at,primaryByteSize:ot,storageUri:Wr(e),isArchived:e.archived??!1,dateCreated:e.dateCreated,dateModified:e.dateModified,wasAttributedTo:e.wasAttributedTo,wasDerivedFrom:e.wasDerivedFrom,generator:e.generator,onGenerate:()=>Ve(!0),isGenerating:Ee,generationProgress:Te&&!Te.annotationId?Te:null,generationOutcome:De,onDismissProgress:()=>I?.yield.dismissProgress()}),Se===`collaboration`&&(0,R.jsx)(lY,{state:s,eventCount:0,knowledgeBaseName:c,collaborators:_}),Se===`jsonld`&&(0,R.jsx)(vY,{resourceId:t})]}),(0,R.jsx)(IU,{context:`document`,activePanel:Se,isArchived:e.archived??!1})]})]}),(0,R.jsx)(y$,{...v?{generationAgent:v}:{},isOpen:Fe,onClose:He,annotationId:Ie,resourceId:Le,defaultTitle:Re,defaultFolder:Mi(Wr(e)),entityTypes:ze,resourceName:e.name,locale:n,context:Oe,contextLoading:ke,contextError:Ae,onGenerateSubmit:Ue,onLinkResource:Ge,onComposeSubmit:Ke,entityTypeOptions:ue,hoverDelayMs:E,translations:{resolveTitle:d(`resolveTitle`),sourceContextLabel:d(`sourceContextLabel`),connectionsLabel:d(`connectionsLabel`),citedByLabel:d(`citedByLabel`),userHintLabel:d(`userHintLabel`),userHintEffect:d(`userHintEffect`),userHintPlaceholder:d(`userHintPlaceholder`),graphPaneTitle:d(`graphPaneTitle`),graphEmpty:d(`graphEmpty`),resourceLinkLabel:d(`resourceLinkLabel`),corpusPaneTitle:d(`corpusPaneTitle`),corpusEmpty:d(`corpusEmpty`),excludedReceipt:d(`excludedReceipt`),machineRead:d(`machineRead`),loadingContext:d(`loadingContext`),failedContext:d(`failedContext`),search:d(`search`),searching:d(`searching`),generate:d(`generate`),compose:d(`compose`),resolutionStrategyLabel:d(`resolutionStrategyLabel`),back:d(`back`),link:d(`link`),score:d(`score`),noResults:d(`noResults`),resourceTitle:d(`resourceTitle`),resourceTitlePlaceholder:d(`resourceTitlePlaceholder`),saveLocation:d(`saveLocation`),additionalInstructions:d(`additionalInstructions`),additionalInstructionsPlaceholder:d(`additionalInstructionsPlaceholder`),language:d(`language`),languageHelp:d(`languageHelp`),creativity:d(`creativity`),creativityFocused:d(`creativityFocused`),creativityCreative:d(`creativityCreative`),maxLength:d(`maxLength`),maxLengthHelp:d(`maxLengthHelp`),maxLengthCeiling:d(`maxLengthCeiling`),outputFormat:d(`outputFormat`),formatExtensionMismatch:d(`formatExtensionMismatch`),maxResults:d(`maxResults`),semanticScoring:d(`semanticScoring`),semanticScoringHelp:d(`semanticScoringHelp`),searchFailed:d(`searchFailed`),entityTypes:d(`entityTypes`),contentLabel:d(`contentLabel`),createAndLink:d(`createAndLink`),creatingAndLinking:d(`creatingAndLinking`),discardDraftPrompt:d(`discardDraftPrompt`),discardDraft:d(`discardDraft`),keepEditing:d(`keepEditing`)}}),(0,R.jsx)(x$,{...v?{generationAgent:v}:{},isOpen:Be,onClose:()=>Ve(!1),resourceId:t,defaultTitle:e.name,defaultFolder:Mi(Wr(e)),locale:n,entityTypeOptions:ue,onGenerateSubmit:We,gatherContext:je,gatherLoading:Me,gatherError:Ne,onGather:e=>I?.gather.gatherResource(t,e),translations:{title:f(`title`),gatherIntro:f(`gatherIntro`),includeContent:f(`includeContent`),includeSummary:f(`includeSummary`),gatherDepth:f(`gatherDepth`),gatherMaxResources:f(`gatherMaxResources`),gatherButton:f(`gatherButton`),editGather:f(`editGather`),recallLabel:f(`recallLabel`),loadingContext:f(`loadingContext`),failedContext:f(`failedContext`),sourceContextLabel:f(`sourceContextLabel`),connectionsLabel:f(`connectionsLabel`),citedByLabel:f(`citedByLabel`),graphPaneTitle:f(`graphPaneTitle`),graphEmpty:f(`graphEmpty`),resourceLinkLabel:f(`resourceLinkLabel`),corpusPaneTitle:f(`corpusPaneTitle`),corpusEmpty:f(`corpusEmpty`),excludedReceipt:f(`excludedReceipt`),machineRead:f(`machineRead`),score:f(`score`),resourceTitle:f(`resourceTitle`),resourceTitlePlaceholder:f(`resourceTitlePlaceholder`),saveLocation:f(`saveLocation`),additionalInstructions:f(`additionalInstructions`),additionalInstructionsPlaceholder:f(`additionalInstructionsPlaceholder`),language:f(`language`),languageHelp:f(`languageHelp`),creativity:f(`creativity`),creativityFocused:f(`creativityFocused`),creativityCreative:f(`creativityCreative`),maxLength:f(`maxLength`),maxLengthHelp:f(`maxLengthHelp`),maxLengthCeiling:f(`maxLengthCeiling`),outputFormat:f(`outputFormat`),formatExtensionMismatch:f(`formatExtensionMismatch`),generate:f(`generate`),discardDraftPrompt:f(`discardDraftPrompt`),discardDraft:f(`discardDraft`),keepEditing:f(`keepEditing`)}})]})}var t0=Te(hm(),1);function n0(e){let{client:t}=e,n=new t0.BehaviorSubject(!1);return{isLoggingOut$:n.asObservable(),logout:async()=>{n.next(!0);try{await t.auth.logout()}catch{}finally{n.next(!1)}},dispose:()=>{n.complete()}}}var r0=Te(hm(),1);function i0(e,t,n,r){let{client:i}=e,a=Kl(),o=n.mode===`clone`&&!!n.token,s=o?`clone`:`new`,c=new r0.BehaviorSubject(s),l=new r0.BehaviorSubject(!0),u=new r0.BehaviorSubject(null),d=new r0.BehaviorSubject(null),f=q1(()=>i.browse.entityTypes(),[]);return a.add(f.dispose),o?(async()=>{try{let e=await i.yield.fromToken(n.token);if(e&&r){let t=cr(e[`@id`]),{data:n,contentType:r}=await i.browse.resourceRepresentation(t),a=pi(n,r);u.next({sourceResource:e,sourceContent:a})}}catch{}l.next(!1)})():l.next(!1),{browse:t,mode$:c.asObservable(),loading$:l.asObservable(),cloneData$:u.asObservable(),entityTypes:f.state,uploadProgress$:d.asObservable(),save:async e=>{if(e.mode===`clone`)return(await i.yield.createFromToken({token:n.token,name:e.name,content:e.content,archiveOriginal:e.archiveOriginal??!0})).resourceId;let t,r;if(e.file)t=e.file,r=e.format??`application/octet-stream`;else{let n=new Blob([e.content||``],{type:e.format??`application/octet-stream`}),i=Si(e.format??`application/octet-stream`);t=new File([n],e.name+i,{type:e.format??`application/octet-stream`}),r=e.format??`application/octet-stream`}let a=e.charset&&!e.file?`${r}; charset=${e.charset}`:r;return await new Promise((n,r)=>{i.yield.resource({name:e.name,file:t,format:a,entityTypes:e.entityTypes||[],language:e.language,storageUri:e.storageUri}).subscribe({next:e=>{d.next(e),e.phase===`finished`&&n(e.resourceId)},error:e=>{d.next(null),r(e)},complete:()=>d.next(null)})})},dispose:()=>{c.complete(),l.complete(),u.complete(),d.complete(),a.dispose()}}}var a0=Te(hm(),1);function o0(e,t){let{client:n}=e,r=new a0.BehaviorSubject(void 0),i=new a0.BehaviorSubject(null),a=null,o=!1,s=()=>{o||(a?.unsubscribe(),a=n.browse.resource(t).subscribe(e=>{if(e.status===`failed`){i.next(e.error);return}e.status===`ready`&&i.getValue()!==null&&i.next(null),r.next(Wc(e))}))};s();let c=(0,a0.combineLatest)([r,i]).pipe((0,a0.map)(([e,t])=>e===void 0&&t===null),(0,a0.distinctUntilChanged)());return{resource$:r.asObservable(),isLoading$:c,error$:i.asObservable(),invalidate:()=>{o||(i.next(null),n.browse.invalidateResourceDetail(t),s())},dispose:()=>{o||(o=!0,a?.unsubscribe(),a=null,r.complete(),i.complete())}}}var s0=Te(hm(),1);function c0(e,t){let{client:n}=e,r=Kl(),i=new s0.BehaviorSubject([]),a=new s0.BehaviorSubject(null),o=new s0.BehaviorSubject(!0),s=new s0.BehaviorSubject(!0),c=()=>{o.next(!0),n.admin.users().then(e=>{i.next(e.users??[]),o.next(!1)}).catch(()=>o.next(!1))},l=()=>{s.next(!0),n.admin.userStats().then(e=>{a.next(e.stats??null),s.next(!1)}).catch(()=>s.next(!1))};return c(),l(),{browse:t,users$:i.asObservable(),stats$:a.asObservable(),usersLoading$:o.asObservable(),statsLoading$:s.asObservable(),updateUser:async(e,t)=>{await n.admin.updateUser(Gn(e),t),c(),l()},dispose:()=>{i.complete(),a.complete(),o.complete(),s.complete(),r.dispose()}}}var l0=Te(hm(),1);function u0(e,t){let{client:n}=e,r=Kl(),i=new l0.BehaviorSubject([]),a=new l0.BehaviorSubject([]),o=new l0.BehaviorSubject(!0);return n.admin.oauthConfig().then(e=>{let t=e;i.next(t.providers??[]),a.next(t.allowedDomains??[]),o.next(!1)}).catch(()=>o.next(!1)),{browse:t,providers$:i.asObservable(),allowedDomains$:a.asObservable(),isLoading$:o.asObservable(),dispose:()=>{i.complete(),a.complete(),o.complete(),r.dispose()}}}var d0=Te(hm(),1);function f0(e){let{client:t}=e,n=Kl(),r=new d0.BehaviorSubject(null),i=new d0.BehaviorSubject(!1);return t.auth.me().then(e=>r.next(e)).catch(()=>{}),{userData$:r.asObservable(),isProcessing$:i.asObservable(),acceptTerms:async()=>{i.next(!0);try{await t.auth.acceptTerms(),r.next({...r.getValue(),termsAcceptedAt:new Date().toISOString()})}finally{i.next(!1)}},dispose:()=>{r.complete(),i.complete(),n.dispose()}}}var p0=Te(hm(),1),m0=Te(nT(),1),h0=10,g0=20,_0=250;function v0(e,t){let{client:n}=e,r=Kl(),i=new p0.BehaviorSubject(``);r.add(()=>i.complete());let a=new p0.Subject;r.add(()=>a.complete());let o=q1(()=>i.pipe((0,m0.switchMap)(e=>n.browse.resources({limit:h0,archived:!1,...e?{entityType:e}:{}}).pipe((0,m0.map)(e=>e.status===`ready`?{status:`ready`,value:e.value.resources}:e)))),[]);r.add(o.dispose);let s=q1(()=>n.browse.entityTypes(),[]);r.add(s.dispose);let c=a.pipe((0,m0.startWith)(``),(0,m0.debounceTime)(_0),(0,m0.distinctUntilChanged)()),l=(0,p0.combineLatest)([c,i]).pipe((0,m0.switchMap)(([e,t])=>{let r=e.trim();return r?n.browse.resources({search:r,limit:g0,...t?{entityType:t}:{}}).pipe((0,m0.map)(e=>{let t=Wc(e);return{results:t?.resources??[],isSearching:e.status===`pending`,...t?{matchKind:t.matchKind}:{}}}),(0,m0.startWith)({results:[],isSearching:!0})):(0,p0.of)({results:[],isSearching:!1})}),(0,m0.shareReplay)({bufferSize:1,refCount:!0}));return{browse:t,search:{query$:a.pipe((0,m0.startWith)(``)),state$:l,setQuery:e=>a.next(e)},recent:o.state,entityTypes:s.state,selectedEntityType$:i.asObservable(),setSelectedEntityType:e=>i.next(e),dispose:()=>r.dispose()}}var y0=Te(hm(),1);function b0(e,t){let{client:n}=e,r=Kl(),i=new y0.BehaviorSubject(``),a=new y0.BehaviorSubject(``),o=new y0.BehaviorSubject(!1),s=q1(()=>n.browse.entityTypes(),[]);return r.add(s.dispose),{browse:t,entityTypes:s.state,newTag$:i.asObservable(),error$:a.asObservable(),isAdding$:o.asObservable(),setNewTag:e=>i.next(e),addTag:async()=>{let e=i.getValue().trim();if(e){a.next(``),o.next(!0);try{await n.frame.addEntityType(e),i.next(``)}catch(e){a.next(e instanceof Error?e.message:`Failed to add entity type`)}finally{o.next(!1)}}},dispose:()=>{i.complete(),a.complete(),o.complete(),r.dispose()}}}function x0({children:e}){let t=v();return(0,R.jsxs)(NU,{resetKeys:[t.pathname],children:[(0,R.jsx)(mJ,{}),(0,R.jsx)(pJ,{}),e]})}var S0=y.lazy(()=>s(()=>import(`./layout-CFJ1R_4B.js`),__vite__mapDeps([5,2,3,1,6,7]))),C0=y.lazy(()=>s(()=>import(`./page-BQdzLSAm.js`),__vite__mapDeps([8,2,3,1,7]))),w0=y.lazy(()=>s(()=>import(`./page-qNST6B2B.js`),__vite__mapDeps([9,2,3,1,6,7,10,11,12]))),T0=y.lazy(()=>s(()=>import(`./page-C6DNYsX4.js`),__vite__mapDeps([13,2,3,1,6,7,10,11,12]))),E0=y.lazy(()=>s(()=>import(`./page-CUFFFOO5.js`),__vite__mapDeps([14,2,3,1,6,7,10,11,12]))),D0=y.lazy(()=>s(()=>import(`./page-DrsJN1kz.js`),__vite__mapDeps([15,2,3,7,1]))),O0=y.lazy(()=>s(()=>import(`./page-jq9pHwMZ.js`),__vite__mapDeps([16,2,3,1,6,7,10,11,12]))),k0=y.lazy(()=>s(()=>import(`./page-DF2F98fp.js`),__vite__mapDeps([17,2,3,1,6,7,10,11,12]))),A0=y.lazy(()=>s(()=>import(`./page-UJpd-iOP.js`),__vite__mapDeps([18,2,3,1,7]))),j0=y.lazy(()=>s(()=>import(`./layout-F2_0FMvR.js`),__vite__mapDeps([19,2,3,1,6,7,10,11,20,21,12]))),M0=y.lazy(()=>s(()=>import(`./page-3MD_eERg.js`),__vite__mapDeps([22,2,3,1,7]))),N0=y.lazy(()=>s(()=>import(`./page-hlJ8ul_N.js`),__vite__mapDeps([23,3,2,1,20,11,7]))),P0=y.lazy(()=>s(()=>import(`./page-DajyPLX8.js`),__vite__mapDeps([24,2,3,1,20,11,7]))),F0=y.lazy(()=>s(()=>import(`./page-DBTvP7FS.js`),__vite__mapDeps([25,2,3,1,20,11,7,12,26]))),I0=y.lazy(()=>s(()=>import(`./layout-CYYeGb9E.js`),__vite__mapDeps([27,2,3,1,6,7,10,11,21,28,12]))),L0=y.lazy(()=>s(()=>import(`./page-BGEAwvTK.js`),__vite__mapDeps([29,1,2,3,7]))),R0=y.lazy(()=>s(()=>import(`./client-BbUuG4bp.js`),__vite__mapDeps([30,2,3,1,20,11,7]))),z0=y.lazy(()=>s(()=>import(`./client-VGmNWvcK.js`),__vite__mapDeps([31,3,2,1,20,11,7]))),B0=y.lazy(()=>s(()=>import(`./page-BXVIH3ZH.js`),__vite__mapDeps([32,2,3,1,20,11,7,28]))),V0=y.lazy(()=>s(()=>import(`./layout-DF_w0YXA.js`),__vite__mapDeps([33,2,3,1,6,7,10,11,21,12]))),H0=y.lazy(()=>s(()=>import(`./page-CeVHoag3.js`),__vite__mapDeps([34,2,3,1,7]))),U0=y.lazy(()=>s(()=>import(`./page-Dut8Hf_3.js`),__vite__mapDeps([35,3,2,1,20,11,7]))),W0=y.lazy(()=>s(()=>import(`./page-dj5t_vyE.js`),__vite__mapDeps([36,3,2,1,20,11,7]))),G0=y.lazy(()=>s(()=>import(`./page-DeVJFcR4.js`),__vite__mapDeps([37,2,3,1,20,11,7]))),K0=y.lazy(()=>s(()=>import(`./not-found---rVdVl1.js`),__vite__mapDeps([26,3,2,1,7])));function q0({children:e}){let{locale:t}=u(),{i18n:n}=o();return(0,y.useEffect)(()=>{if(!t)return;let e=le(t)?t:`en`;n.language!==e&&n.changeLanguage(e)},[t,n]),!t||!le(t)?(0,R.jsx)(m,{to:`/en`,replace:!0}):(0,R.jsx)(R.Fragment,{children:e})}function J0(){return(0,R.jsx)(x0,{children:(0,R.jsx)(g,{})})}function Y0(){let e=l();return(0,y.useEffect)(()=>{let t=navigator.language.split(`-`)[0]??`en`,n=le(t)?t:`en`;e(`/${n}`,{replace:!0})},[e]),null}function X0(){return(0,R.jsx)(y.Suspense,{fallback:null,children:(0,R.jsxs)(d,{children:[(0,R.jsx)(c,{path:`/`,element:(0,R.jsx)(Y0,{})}),(0,R.jsxs)(c,{path:`/:locale`,element:(0,R.jsx)(q0,{children:(0,R.jsx)(S0,{})}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(C0,{})}),(0,R.jsx)(c,{path:`about`,element:(0,R.jsx)(w0,{})}),(0,R.jsx)(c,{path:`privacy`,element:(0,R.jsx)(T0,{})}),(0,R.jsx)(c,{path:`terms`,element:(0,R.jsx)(E0,{})}),(0,R.jsx)(c,{path:`auth/connect`,element:(0,R.jsx)(D0,{})}),(0,R.jsx)(c,{path:`auth/signup`,element:(0,R.jsx)(O0,{})}),(0,R.jsx)(c,{path:`auth/error`,element:(0,R.jsx)(k0,{})}),(0,R.jsxs)(c,{element:(0,R.jsx)(J0,{}),children:[(0,R.jsx)(c,{path:`auth/welcome`,element:(0,R.jsx)(A0,{})}),(0,R.jsxs)(c,{path:`know`,element:(0,R.jsx)(j0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(M0,{})}),(0,R.jsx)(c,{path:`discover`,element:(0,R.jsx)(N0,{})}),(0,R.jsx)(c,{path:`compose`,element:(0,R.jsx)(P0,{})}),(0,R.jsx)(c,{path:`resource/:id`,element:(0,R.jsx)(F0,{})})]}),(0,R.jsxs)(c,{path:`admin`,element:(0,R.jsx)(I0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(L0,{})}),(0,R.jsx)(c,{path:`users`,element:(0,R.jsx)(R0,{})}),(0,R.jsx)(c,{path:`security`,element:(0,R.jsx)(z0,{})}),(0,R.jsx)(c,{path:`devops`,element:(0,R.jsx)(B0,{})})]}),(0,R.jsxs)(c,{path:`moderate`,element:(0,R.jsx)(V0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(H0,{})}),(0,R.jsx)(c,{path:`recent`,element:(0,R.jsx)(U0,{})}),(0,R.jsx)(c,{path:`entity-tags`,element:(0,R.jsx)(W0,{})}),(0,R.jsx)(c,{path:`tag-schemas`,element:(0,R.jsx)(G0,{})})]})]}),(0,R.jsx)(c,{path:`*`,element:(0,R.jsx)(K0,{})})]}),(0,R.jsx)(c,{path:`*`,element:(0,R.jsx)(m,{to:`/en`,replace:!0})})]})})}de(`/assets/pdf.worker.min-CHFwMXne.mjs`);var Z0={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_OTEL_OTLP_ENDPOINT;Z0&&s(async()=>{let{initObservabilityWeb:e}=await import(`./web-Cjbkk4IZ.js`);return{initObservabilityWeb:e}},[]).then(({initObservabilityWeb:e})=>{e({serviceName:`semiont-browser`,otlpEndpoint:Z0})});var Q0=document.getElementById(`root`);if(!Q0)throw Error(`Root element not found`);b.createRoot(Q0).render((0,R.jsx)(y.StrictMode,{children:(0,R.jsx)(p,{children:(0,R.jsx)(X0,{})})}));export{Q1 as $,Fr as $t,UF as A,Sm as At,n0 as B,lc as Bt,k$ as C,jm as Ct,D$ as D,xm as Dt,IY as E,_m as Et,c0 as F,Uc as Ft,rI as G,Rs as Gt,MF as H,Xs as Ht,i0 as I,Ml as It,PF as J,ys as Jt,LF as K,Ds as Kt,v0 as L,Ic as Lt,D1 as M,Yl as Mt,aT as N,ml as Nt,O$ as O,Dm as Ot,u0 as P,Al as Pt,jF as Q,qo as Qt,b0 as R,Fc as Rt,E$ as S,Rm as St,w1 as T,Zm as Tt,kF as U,Ys as Ut,f0 as V,Zs as Vt,FF as W,Bs as Wt,zF as X,$o as Xt,Z as Y,es as Yt,VF as Z,Qo as Zt,L1 as _,Jm as _t,_1 as a,Ir as an,Pm as at,P$ as b,Km as bt,O1 as c,wt as cn,Nm as ct,j$ as d,ge as dn,Im as dt,Mr as en,WF as et,oI as f,le as fn,Hm as ft,dI as g,Vm as gt,FU as h,Ym as ht,E1 as i,cr as in,qm as it,IU as j,Om as jt,M1 as k,vm as kt,PY as l,me as ln,Wm as lt,k1 as m,Am as mt,b1 as n,Pr as nn,ah as nt,a$ as o,Un as on,Lm as ot,M$ as p,Xm as pt,tI as q,Es as qt,S1 as r,Nr as rn,Um as rt,N$ as s,qn as sn,km as st,y1 as t,xr as tn,ih as tt,fJ as u,he as un,Fm as ut,z1 as v,Mm as vt,LU as w,zm as wt,e0 as x,Bm as xt,F$ as y,Gm as yt,o0 as z,dc as zt};
142
- //# sourceMappingURL=index-aqrUF2g1.js.map
141
+ `),x={id:n.id,label:g,kind:`annotation`,hover:y,x:d(v+r%_),y:8+(1+Math.floor(r/_))*52};p.push(x),m.push({key:`annof-${n.id}`,kind:`annotation-of`,hover:`annotation-of`,x1:b.x+90,y1:b.y+34,x2:x.x+90,y2:x.y})});let x=Math.max(a.length,1+Math.ceil(s.length/_),i.length),S=y*216-20,C=8+x*52+8,w=e=>e.length>22?`${e.slice(0,21)}\u2026`:e,T=i.length>0||a.length>0||s.length>0;return(0,R.jsxs)(`div`,{className:`semiont-gather-pane semiont-gather-pane--graph`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:t.graphPaneTitle}),e.inferredRelationshipSummary&&(0,R.jsx)(`p`,{className:`semiont-gather-pane__summary`,children:e.inferredRelationshipSummary}),!T&&(0,R.jsx)(`p`,{className:`semiont-gather-pane__empty`,children:t.graphEmpty}),T&&(0,R.jsxs)(`svg`,{className:`semiont-graph`,viewBox:`0 0 ${S} ${C}`,style:{maxWidth:`${S}px`},role:`img`,"aria-label":t.graphPaneTitle,children:[m.map(e=>(0,R.jsxs)(`g`,{className:`semiont-graph__edge semiont-graph__edge--${e.kind}`,children:[(0,R.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}),(0,R.jsx)(`title`,{children:e.hover})]},e.key)),p.map(e=>(0,R.jsxs)(`g`,{className:`semiont-graph__node semiont-graph__node--${e.kind}`,"data-node-id":e.id,children:[(0,R.jsx)(`rect`,{x:e.x,y:e.y,width:180,height:34,rx:6}),(0,R.jsx)(`text`,{x:e.x+10,y:e.y+22,children:w(e.label)}),(0,R.jsx)(`title`,{children:e.hover})]},e.id))]})]})}function s$({semanticContext:e,translations:t}){let n=[...e?.similar??[]].sort((e,t)=>t.score-e.score),r=e?.excludedEntityTypes??[];return(0,R.jsxs)(`div`,{className:`semiont-gather-pane semiont-gather-pane--corpus`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:t.corpusPaneTitle}),n.length===0?(0,R.jsx)(`p`,{className:`semiont-gather-pane__empty`,children:t.corpusEmpty}):(0,R.jsx)(`ul`,{className:`semiont-corpus__list`,children:n.map((e,n)=>(0,R.jsxs)(`li`,{className:`semiont-corpus__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-corpus__card-head`,children:[(0,R.jsx)(`span`,{className:`semiont-corpus__source`,children:e.resourceName}),(e.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e)),e.machineRead&&(0,R.jsx)(`span`,{className:`semiont-chip semiont-corpus__trust`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:t.machineRead}),(0,R.jsxs)(`span`,{className:`semiont-corpus__score`,children:[t.score,`: `,e.score.toFixed(2)]})]}),(0,R.jsx)(`p`,{className:`semiont-corpus__snippet`,children:e.text})]},`${e.resourceId}-${n}`))}),r.length>0&&(0,R.jsx)(`p`,{className:`semiont-corpus__receipt`,children:t.excludedReceipt.replace(`{{types}}`,r.join(`, `))})]})}function c$({context:e,contextLoading:t,contextError:n,pending:r,annotate:i,chosenStrategy:a,translations:o}){let[s,c]=(0,y.useState)(!1),l=!t&&!n&&!!e,u=e?.focus.kind===`annotation`?e.focus:null,d=e?.focus.kind===`resource`?e.focus:null,f=u?.annotation.motivation?iT(u.annotation.motivation):void 0,p=f?rT[f].className:void 0,m=(0,y.useRef)(null);(0,y.useEffect)(()=>{m.current&&m.current.scrollIntoView({block:`center`,behavior:`instant`})},[e]);let h=i&&(0,R.jsx)(`div`,{className:`semiont-gather__hint-row`,children:(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,children:[i.translations.userHintLabel,(0,R.jsxs)(`span`,{className:`semiont-gather__hint-effect`,children:[` — `,i.translations.userHintEffect]})]}),(0,R.jsx)(`textarea`,{value:i.userHint,onChange:e=>i.onUserHintChange(e.target.value),placeholder:i.translations.userHintPlaceholder,className:`semiont-search-modal__search-input semiont-gather__hint-textarea`,style:{resize:`vertical`,fontFamily:`inherit`}})]})}),g=i&&(0,R.jsxs)(`div`,{className:`semiont-gather__footer`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__footer-label`,children:i.translations.resolutionStrategyLabel}),(0,R.jsxs)(`div`,{className:`semiont-gather__actions`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:i.onBind,disabled:!l,className:`semiont-button--primary semiont-button--flex`,children:[`🔍 `,i.translations.search,`…`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:i.onGenerate,disabled:!l,className:`semiont-button--primary semiont-button--flex`,children:[`✨ `,i.translations.generate,`…`]}),(0,R.jsxs)(`button`,{type:`button`,onClick:i.onCompose,disabled:!l,className:`semiont-button--secondary semiont-button--flex`,children:[`✍️ `,i.translations.compose]})]})]});return(0,R.jsxs)(`div`,{className:`semiont-gather__outer`,children:[t&&r&&(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton`,role:`status`,children:[(0,R.jsx)(`span`,{className:`semiont-sr-only`,children:o.loadingContext}),r.resourceName&&(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-source`,children:[o.sourceContextLabel,` "${r.resourceName}"`]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-header`,children:[(0,R.jsxs)(`span`,{className:`semiont-gather__skeleton-exact`,children:[`"`,r.exact,`"`]}),r.entityTypes.length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:r.entityTypes.map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-panes`,children:[(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-pane`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:o.graphPaneTitle}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-pane`,children:[(0,R.jsx)(`div`,{className:`semiont-gather-pane__title`,children:o.corpusPaneTitle}),(0,R.jsxs)(`div`,{className:`semiont-gather__skeleton-dots`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]})]})]}),h,g]}),t&&!r&&(0,R.jsxs)(`div`,{className:`semiont-gather__loading`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`},children:[(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-dot`})]}),(0,R.jsx)(`span`,{className:`semiont-gather__loading-text`,children:o.loadingContext})]}),!!n&&(0,R.jsx)(`div`,{style:{textAlign:`center`,padding:`1rem 0`,color:`var(--semiont-color-red-600)`},children:o.failedContext}),e&&(0,R.jsxs)(R.Fragment,{children:[u?.selected&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,justifyContent:`space-between`,gap:`0.5rem`,marginBottom:`0.375rem`},children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:0},children:[o.sourceContextLabel,u.sourceResource.name?` "${u.sourceResource.name}"`:``]}),(e.metadata?.entityTypes??[]).length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:(e.metadata?.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__source-box${s?` semiont-gather__source-box--expanded`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,R.jsxs)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:[u.selected.before&&(0,R.jsx)(`span`,{children:u.selected.before}),(0,R.jsx)(`span`,{ref:m,...p?{className:p}:{},children:u.selected.text}),u.selected.after&&(0,R.jsx)(`span`,{children:u.selected.after})]})}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>c(e=>!e),children:s?`▲ less`:`▼ more`})]})]}),d&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-strip`,children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,justifyContent:`space-between`,gap:`0.5rem`,marginBottom:`0.375rem`},children:[(0,R.jsxs)(`label`,{className:`semiont-form__label`,style:{marginBottom:0},children:[o.sourceContextLabel,d.resource.name?` "${d.resource.name}"`:``]}),(e.metadata?.entityTypes??[]).length>0&&(0,R.jsx)(`span`,{style:{display:`flex`,gap:`0.25rem`,flexWrap:`wrap`},children:(e.metadata?.entityTypes??[]).map(e=>(0,R.jsx)(`span`,{className:`semiont-chip`,style:{fontSize:`var(--semiont-text-xs)`,padding:`0.125rem 0.375rem`,fontWeight:400},children:e},e))})]}),(d.summary||d.content?.main)&&(0,R.jsxs)(`div`,{className:`semiont-gather__source-box${s?` semiont-gather__source-box--expanded`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__source-context`,children:(0,R.jsx)(`div`,{style:{fontSize:`var(--semiont-text-sm)`,whiteSpace:`pre-wrap`,color:`var(--semiont-text-secondary)`},children:d.summary??d.content?.main})}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-gather__expand-btn`,onClick:()=>c(e=>!e),children:s?`▲ less`:`▼ more`})]}),d.suggestedReferences&&d.suggestedReferences.length>0&&(0,R.jsx)(`ul`,{className:`semiont-gather__suggested`,children:d.suggestedReferences.map(e=>(0,R.jsx)(`li`,{children:e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-gather__body`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__left`,children:(0,R.jsx)(o$,{context:e,translations:o})}),(0,R.jsx)(`div`,{className:`semiont-gather__right`,children:(0,R.jsx)(s$,{semanticContext:e.semanticContext,translations:o})})]}),u&&h,u&&g,!i&&a&&(0,R.jsxs)(`div`,{className:`semiont-gather__footer semiont-gather__footer--echo`,children:[(0,R.jsx)(`div`,{className:`semiont-gather__footer-label`,children:a.label}),(0,R.jsx)(`span`,{className:`semiont-gather__chosen-strategy`,children:a.value})]})]})]})}function l$({backLabel:e,onBack:t,primary:n}){let r=n?.pending??!1;return(0,R.jsxs)(`div`,{className:`semiont-modal__actions semiont-modal__actions--wizard`,children:[t&&e&&(0,R.jsxs)(`button`,{type:`button`,onClick:t,className:`semiont-button--secondary semiont-wizard-footer__back`,disabled:r,children:[`◀ `,e]}),n&&(0,R.jsx)(`button`,{type:n.type,...n.onClick?{onClick:n.onClick}:{},className:`semiont-button--primary`,disabled:r||(n.disabled??!1),"data-pending":r?`true`:`false`,children:r?n.pendingLabel??n.label:n.label})]})}var u$=100,d$=4e3,f$=e=>bi(e)?.extension??``,p$=(e,t)=>({title:e,storagePath:``,prompt:``,language:t,temperature:.7,maxTokensText:`500`,outputMediaType:`text/markdown`});function m$({context:e,hintEcho:t,config:n,onConfigChange:r,onBack:i,onGenerate:a,defaultFolder:o=``,translations:s,generationAgent:c}){let{title:l,storagePath:u,prompt:d,language:f,temperature:p,maxTokensText:m,outputMediaType:h}=n,g=e=>r({...n,...e}),_=u!==``,v=Ni(o,l,h),b=_?u:v,x=f$(h),S=b!==``&&!b.toLowerCase().endsWith(x.toLowerCase()),C=c?.limits?.maxOutputTokens??d$,w=(e=>Math.min(Math.max(Number.isFinite(e)?e:u$,u$),C))(parseInt(m,10));return(0,y.useEffect)(()=>{let e=parseInt(m,10);Number.isFinite(e)&&e>C&&g({maxTokensText:String(C)})},[C]),(0,R.jsxs)(`form`,{onSubmit:t=>{if(t.preventDefault(),S)return;let n=d.trim();a({title:l,storageUri:`file://${b}`,...n?{prompt:n}:{},language:f,temperature:p,maxTokens:w,outputMediaType:h,context:e})},className:`semiont-form`,children:[t&&(0,R.jsxs)(`p`,{className:`semiont-wizard__hint-echo`,children:[t.label,`: `,t.value]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-title`,className:`semiont-form__label`,children:s.resourceTitle}),(0,R.jsx)(`input`,{id:`wizard-title`,type:`text`,value:l,onChange:e=>g({title:e.target.value}),required:!0,className:`semiont-input`,placeholder:s.resourceTitlePlaceholder})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-storagePath`,className:`semiont-form__label`,children:s.saveLocation}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`wizard-storagePath`,type:`text`,value:b,onChange:e=>g({storagePath:e.target.value}),required:!0,"aria-invalid":S,...S?{"aria-describedby":`wizard-format-mismatch`}:{},className:`semiont-input semiont-input--addon`,placeholder:`generated/my-resource.md`})]}),S&&(0,R.jsx)(`p`,{id:`wizard-format-mismatch`,className:`semiont-form__error`,role:`alert`,children:s.formatExtensionMismatch.replace(`{{extension}}`,x)})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-outputFormat`,className:`semiont-form__label`,children:s.outputFormat}),(0,R.jsx)(`select`,{id:`wizard-outputFormat`,value:h,onChange:e=>g({outputMediaType:e.target.value}),className:`semiont-select`,children:ki.map(e=>(0,R.jsx)(`option`,{value:e,children:bi(e)?.label??e},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-prompt`,className:`semiont-form__label`,children:s.additionalInstructions}),(0,R.jsx)(`textarea`,{id:`wizard-prompt`,value:d,onChange:e=>g({prompt:e.target.value}),rows:2,className:`semiont-textarea`,placeholder:s.additionalInstructionsPlaceholder})]}),(0,R.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-language`,className:`semiont-form__label`,children:s.language}),(0,R.jsx)(`select`,{id:`wizard-language`,value:f,onChange:e=>g({language:e.target.value}),className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--slider`,children:[(0,R.jsxs)(`label`,{htmlFor:`wizard-temperature`,className:`semiont-form__label`,children:[s.creativity,` (`,p.toFixed(1),`)`]}),(0,R.jsx)(`input`,{id:`wizard-temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,value:p,onChange:e=>g({temperature:parseFloat(e.target.value)}),className:`semiont-slider`}),(0,R.jsxs)(`div`,{className:`semiont-slider__labels semiont-slider__labels--small`,children:[(0,R.jsx)(`span`,{children:s.creativityFocused}),(0,R.jsx)(`span`,{children:s.creativityCreative})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow semiont-form__field--end`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-maxTokens`,className:`semiont-form__label`,children:s.maxLength}),(0,R.jsx)(`input`,{id:`wizard-maxTokens`,type:`number`,min:u$,max:C,step:`100`,value:m,onChange:e=>{let t=e.target.value;if(t===``){g({maxTokensText:``});return}let n=parseInt(t,10);Number.isFinite(n)&&g({maxTokensText:String(Math.min(n,C))})},className:`semiont-input`})]})]}),(0,R.jsx)(`p`,{className:`semiont-form__help semiont-form__help--row`,children:c?.limits?s.maxLengthCeiling.replace(`{{maxOutputTokens}}`,String(C)).replace(`{{model}}`,c.agent.model??c.agent.name):s.maxLengthHelp}),(0,R.jsx)(l$,{...i&&s.back?{backLabel:s.back,onBack:i}:{},primary:{label:s.generate,type:`submit`,disabled:S}})]})}function h$({config:e,hintEcho:t,onConfigChange:n,isSearching:r=!1,searchError:i=null,onBack:a,onSearch:o,translations:s}){return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),o(e)},className:`semiont-form`,children:[t&&(0,R.jsxs)(`p`,{className:`semiont-wizard__hint-echo`,children:[t.label,`: `,t.value]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`wizard-limit`,className:`semiont-form__label`,children:s.maxResults}),(0,R.jsxs)(`select`,{id:`wizard-limit`,value:e.limit,onChange:t=>n({...e,limit:parseInt(t.target.value)}),className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:1,children:`1`}),(0,R.jsx)(`option`,{value:5,children:`5`}),(0,R.jsx)(`option`,{value:10,children:`10`}),(0,R.jsx)(`option`,{value:20,children:`20`})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsxs)(`label`,{className:`semiont-form__label semiont-form__label--inline`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:e.useSemanticScoring,onChange:t=>n({...e,useSemanticScoring:t.target.checked})}),s.semanticScoring]}),(0,R.jsx)(`p`,{className:`semiont-form__help`,children:s.semanticScoringHelp})]}),i&&(0,R.jsxs)(`div`,{role:`alert`,style:{textAlign:`center`,padding:`0.5rem 0`,color:`var(--semiont-color-red-600)`},children:[s.searchFailed,`: `,i]}),(0,R.jsx)(l$,{backLabel:s.back,onBack:a,primary:{label:s.search,pendingLabel:s.searching,pending:r,type:`submit`}})]})}function g$({results:e,onLink:t,onBack:n,translations:r}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`semiont-search-results`,children:e.length===0?(0,R.jsx)(`div`,{className:`semiont-modal__empty-state`,style:{textAlign:`center`,padding:`2rem 0`},children:r.noResults}):e.map(e=>{let n=e[`@id`];return(0,R.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,R.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,R.jsx)(`div`,{style:{fontWeight:500,color:`var(--semiont-text-primary)`},children:e.name}),e.description&&(0,R.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,R.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,R.jsxs)(`span`,{children:[r.score,`: `,e.score]}),e.matchReason&&(0,R.jsx)(`span`,{children:e.matchReason})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(n),className:`semiont-button--primary`,style:{flexShrink:0},children:[`🔗 `,r.link]})]},n)})}),(0,R.jsx)(l$,{backLabel:r.back,onBack:n})]})}function _$({draft:e,onDraftChange:t,defaultFolder:n=``,referenceEntityTypes:r,entityTypeOptions:i,showLineNumbers:a,hoverDelayMs:o,onBack:s,onCompose:c,translations:l}){let u=e.storagePath===``?Ni(n,e.name,`text/markdown`):e.storagePath,[d,f]=(0,y.useState)(!1),p=r.length>0;return(0,R.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!(!e.name.trim()||!u.trim())){f(!0);try{await c({name:e.name,storagePath:`file://${u}`,content:e.content,entityTypes:p?r:e.entityTypes,language:e.language})}catch{}finally{f(!1)}}},className:`semiont-form`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-name`,className:`semiont-form__label`,children:l.resourceTitle}),(0,R.jsx)(`input`,{id:`compose-name`,type:`text`,value:e.name,onChange:e=>t({name:e.target.value}),placeholder:l.resourceTitlePlaceholder,required:!0,className:`semiont-input`,disabled:d})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-storagePath`,className:`semiont-form__label`,children:l.saveLocation}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`compose-storagePath`,type:`text`,value:u,onChange:e=>t({storagePath:e.target.value}),placeholder:`people/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:d})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`div`,{className:`semiont-form__label`,children:l.entityTypes}),p?(0,R.jsx)(`div`,{className:`semiont-form__entity-type-tags`,role:`list`,children:r.map(e=>(0,R.jsx)(`span`,{role:`listitem`,className:`semiont-form__entity-type-tag`,children:e},e))}):(0,R.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,children:i.map(n=>{let r=e.entityTypes.includes(n);return(0,R.jsx)(`button`,{type:`button`,onClick:()=>t({entityTypes:r?e.entityTypes.filter(e=>e!==n):[...e.entityTypes,n]}),className:`semiont-form__entity-type-button`,"data-selected":r,"aria-pressed":r,disabled:d,children:n},n)})})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`compose-language`,className:`semiont-form__label`,children:l.language}),(0,R.jsx)(`select`,{id:`compose-language`,value:e.language,onChange:e=>t({language:e.target.value}),disabled:d,className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:l.contentLabel}),(0,R.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:e.language,children:(0,R.jsx)(DU,{content:e.content,editable:!d,sourceView:!0,showLineNumbers:a,hoverDelayMs:o,onChange:e=>t({content:e})})})]}),(0,R.jsx)(l$,{backLabel:l.back,onBack:s,primary:{label:l.createAndLink,pendingLabel:l.creatingAndLinking,pending:d,type:`submit`}})]})}function v$({prompt:e,discardLabel:t,keepLabel:n,onDiscard:r,onKeepEditing:i}){return(0,R.jsxs)(`div`,{className:`semiont-wizard__discard-prompt`,role:`alert`,children:[(0,R.jsx)(`span`,{className:`semiont-wizard__discard-prompt-text`,children:e}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-button--danger`,onClick:r,children:t}),(0,R.jsx)(`button`,{type:`button`,className:`semiont-button--secondary`,onClick:i,children:n})]})}function y$({isOpen:e,onClose:t,annotationId:n,resourceId:r,defaultTitle:i,defaultFolder:a,entityTypes:o,resourceName:s,locale:c,context:l,contextLoading:u,contextError:d,onGenerateSubmit:f,onLinkResource:p,onComposeSubmit:m,entityTypeOptions:h=[],hoverDelayMs:g=300,translations:_,generationAgent:v}){let b=Z(Sm().activeSession$),[x,S]=(0,y.useState)({step:`gather`}),[C,w]=(0,y.useState)({limit:10,useSemanticScoring:!0}),[T,E]=(0,y.useState)(()=>p$(i,c)),[D,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(null),[j,M]=(0,y.useState)(``),ee=()=>({name:i,storagePath:``,content:``,entityTypes:[],language:c}),[N,te]=(0,y.useState)(ee),[P,F]=(0,y.useState)(!1),{showLineNumbers:ne}=vm(),re=(0,y.useRef)(i);(0,y.useEffect)(()=>{e&&(re.current=i,S({step:`gather`}),w({limit:10,useSemanticScoring:!0}),E(p$(i,c)),O(!1),A(null),M(``),te(ee()),F(!1))},[e]),nI(`match:search-results`,t=>{e&&n&&t.referenceId===n&&(O(!1),S({step:`search-results`,results:t.response}))}),nI(`match:search-failed`,t=>{e&&n&&t.referenceId===n&&(O(!1),A(t.error))});let ie=(0,y.useCallback)(()=>{S({step:`configure-search`})},[]),ae=l?j?{...l,focus:{...l.focus,userHint:j}}:l:null,oe=(0,y.useCallback)(()=>{S({step:`configure-generation`})},[]),se=(0,y.useCallback)(()=>{!l||!n||!r||S({step:`compose`})},[l,n,r]),I=(0,y.useCallback)(async e=>{n&&(await m(n,e),t())},[n,m,t]),L=N.content.trim()!==``||N.storagePath.trim()!==``||N.name!==re.current||T.title!==re.current||T.storagePath.trim()!==``||T.prompt.trim()!==``,ce=(0,y.useCallback)(()=>{if(L){F(!0);return}t()},[L,t]),le=(0,y.useCallback)(()=>{S({step:`gather`})},[]),ue=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=ue.current;e&&(e.scrollTop=e.scrollHeight)},[x.step]);let de=(0,y.useCallback)(e=>{!n||!ae||!r||(O(!0),A(null),b?.client.match.requestSearch({correlationId:hr(),resourceId:r,referenceId:n,context:ae,limit:e.limit,useSemanticScoring:e.useSemanticScoring}))},[n,r,ae,b]),fe=(0,y.useCallback)(e=>{n&&(f(n,e),t())},[n,f,t]),pe=(0,y.useCallback)(e=>{n&&(p(n,e),t())},[n,p,t]),me={loadingContext:_.loadingContext,failedContext:_.failedContext,sourceContextLabel:_.sourceContextLabel,connectionsLabel:_.connectionsLabel,citedByLabel:_.citedByLabel,graphPaneTitle:_.graphPaneTitle,graphEmpty:_.graphEmpty,resourceLinkLabel:_.resourceLinkLabel,corpusPaneTitle:_.corpusPaneTitle,corpusEmpty:_.corpusEmpty,excludedReceipt:_.excludedReceipt,machineRead:_.machineRead,score:_.score};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:ce,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border semiont-search-modal__panel--gather semiont-search-modal__panel--wide`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,R.jsx)(rJ,{className:`semiont-search-modal__title`,children:_.resolveTitle}),(0,R.jsx)(`button`,{onClick:ce,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),P&&(0,R.jsx)(v$,{prompt:_.discardDraftPrompt,discardLabel:_.discardDraft,keepLabel:_.keepEditing,onDiscard:()=>{F(!1),t()},onKeepEditing:()=>F(!1)}),x.step===`gather`&&(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,pending:{exact:i,entityTypes:o,...s?{resourceName:s}:{}},annotate:{userHint:j,onUserHintChange:M,onBind:ie,onGenerate:oe,onCompose:se,translations:{search:_.search,generate:_.generate,compose:_.compose,resolutionStrategyLabel:_.resolutionStrategyLabel,userHintLabel:_.userHintLabel,userHintEffect:_.userHintEffect,userHintPlaceholder:_.userHintPlaceholder}},translations:me}),x.step===`compose`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u270D\uFE0F ${_.compose}`},translations:me}),(0,R.jsx)(_$,{draft:N,onDraftChange:e=>te(t=>({...t,...e})),defaultFolder:a,referenceEntityTypes:o,entityTypeOptions:h,showLineNumbers:ne,hoverDelayMs:g,onBack:le,onCompose:I,translations:{resourceTitle:_.resourceTitle,resourceTitlePlaceholder:_.resourceTitlePlaceholder,saveLocation:_.saveLocation,entityTypes:_.entityTypes,language:_.language,contentLabel:_.contentLabel,back:_.back,createAndLink:_.createAndLink,creatingAndLinking:_.creatingAndLinking}})]}),x.step===`configure-generation`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u2728 ${_.generate}`},translations:me}),(0,R.jsx)(m$,{...v?{generationAgent:v}:{},...j?{hintEcho:{label:_.userHintLabel,value:j}}:{},context:ae??l,config:T,onConfigChange:E,defaultFolder:a,onBack:le,onGenerate:fe,translations:{resourceTitle:_.resourceTitle,resourceTitlePlaceholder:_.resourceTitlePlaceholder,saveLocation:_.saveLocation,additionalInstructions:_.additionalInstructions,additionalInstructionsPlaceholder:_.additionalInstructionsPlaceholder,language:_.language,languageHelp:_.languageHelp,creativity:_.creativity,creativityFocused:_.creativityFocused,creativityCreative:_.creativityCreative,maxLength:_.maxLength,maxLengthHelp:_.maxLengthHelp,maxLengthCeiling:_.maxLengthCeiling,outputFormat:_.outputFormat,formatExtensionMismatch:_.formatExtensionMismatch,back:_.back,generate:_.generate}})]}),x.step===`configure-search`&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u{1F50D} ${_.search}`},translations:me}),(0,R.jsx)(h$,{config:C,...j?{hintEcho:{label:_.userHintLabel,value:j}}:{},onConfigChange:w,isSearching:D,searchError:k,onBack:le,onSearch:de,translations:{maxResults:_.maxResults,semanticScoring:_.semanticScoring,semanticScoringHelp:_.semanticScoringHelp,back:_.back,search:_.search,searching:_.searching,searchFailed:_.searchFailed}})]}),x.step===`search-results`&&l&&(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:ue,children:[(0,R.jsx)(c$,{context:l,contextLoading:u,contextError:d,chosenStrategy:{label:_.resolutionStrategyLabel,value:`\u{1F50D} ${_.search}`},translations:me}),(0,R.jsx)(g$,{results:x.results,onLink:pe,onBack:le,translations:{noResults:_.noResults,link:_.link,back:_.back,score:_.score}})]})]})})})})]})})}function b$({onGather:e,translations:t,children:n}){let[r,i]=(0,y.useState)(!0),[a,o]=(0,y.useState)(!0),[s,c]=(0,y.useState)(2),[l,u]=(0,y.useState)(10);return(0,R.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e({includeContent:r,includeSummary:a,depth:s,maxResources:l})},className:`semiont-form`,children:[(0,R.jsx)(`p`,{className:`semiont-form__helper-text`,children:t.intro}),(0,R.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,R.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),t.includeContent]})}),(0,R.jsx)(`div`,{className:`semiont-form__checkbox-field`,children:(0,R.jsxs)(`label`,{className:`semiont-form__checkbox-label`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),t.includeSummary]})}),(0,R.jsxs)(`div`,{className:`semiont-form__inline-row`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,R.jsx)(`label`,{htmlFor:`gather-depth`,className:`semiont-form__label`,children:t.depth}),(0,R.jsx)(`input`,{id:`gather-depth`,type:`number`,min:`1`,max:`5`,value:s,onChange:e=>c(parseInt(e.target.value)),className:`semiont-input`})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__field--inline semiont-form__field--narrow`,children:[(0,R.jsx)(`label`,{htmlFor:`gather-max`,className:`semiont-form__label`,children:t.maxResources}),(0,R.jsx)(`input`,{id:`gather-max`,type:`number`,min:`1`,max:`50`,value:l,onChange:e=>u(parseInt(e.target.value)),className:`semiont-input`})]})]}),n,(0,R.jsx)(l$,{primary:{label:t.gather,type:`submit`}})]})}function x$({isOpen:e,onClose:t,resourceId:n,defaultTitle:r,defaultFolder:i,locale:a,entityTypeOptions:o=[],onGenerateSubmit:s,gatherContext:c,gatherLoading:l,gatherError:u,onGather:d,translations:f,generationAgent:p}){let m=()=>p$(r,a),[h,g]=(0,y.useState)(m),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(!1),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)([]),O=(0,y.useRef)(!1),k=(0,y.useRef)(r);(0,y.useEffect)(()=>{e&&!O.current&&(v(!1),x(null),C(!1),D([]),g(m()),T(!1),k.current=r),O.current=e},[e]);let A=(0,y.useCallback)(e=>{v(!0),x({...e,excludeEntityTypes:E}),C(!1),d({...e,...E.length?{excludeEntityTypes:E}:{}})},[d,E]),j=(0,y.useCallback)(e=>{s(n,e),t()},[s,n,t]),M=h.title!==k.current||h.storagePath.trim()!==``||h.prompt.trim()!==``,ee=(0,y.useCallback)(()=>{if(M){T(!0);return}t()},[M,t]),N=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=N.current;e&&c&&(e.scrollTop=e.scrollHeight)},[c]);let te={loadingContext:f.loadingContext,failedContext:f.failedContext,sourceContextLabel:f.sourceContextLabel,connectionsLabel:f.connectionsLabel,citedByLabel:f.citedByLabel,graphPaneTitle:f.graphPaneTitle,graphEmpty:f.graphEmpty,resourceLinkLabel:f.resourceLinkLabel,corpusPaneTitle:f.corpusPaneTitle,corpusEmpty:f.corpusEmpty,excludedReceipt:f.excludedReceipt,machineRead:f.machineRead,score:f.score};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:ee,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering semiont-search-modal__centering--center`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel semiont-search-modal__panel--with-border semiont-search-modal__panel--gather semiont-search-modal__panel--wide`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__header`,children:[(0,R.jsx)(rJ,{className:`semiont-search-modal__title`,children:f.title}),(0,R.jsx)(`button`,{onClick:ee,className:`semiont-search-modal__close-button`,"aria-label":`Close`,children:`✕`})]}),w&&(0,R.jsx)(v$,{prompt:f.discardDraftPrompt,discardLabel:f.discardDraft,keepLabel:f.keepEditing,onDiscard:()=>{T(!1),t()},onKeepEditing:()=>T(!1)}),(0,R.jsxs)(`div`,{className:`semiont-wizard__step-scroll`,ref:N,children:[_&&!S&&b&&(0,R.jsxs)(`button`,{type:`button`,className:`semiont-gather-receipt`,title:f.editGather,onClick:()=>C(!0),children:[[`${f.gatherDepth} ${b.depth}`,`${f.gatherMaxResources} ${b.maxResources}`,...b.includeContent?[f.includeContent]:[],...b.includeSummary?[f.includeSummary]:[],...b.excludeEntityTypes.length?[f.excludedReceipt.replace(`{{types}}`,b.excludeEntityTypes.join(`, `))]:[]].join(` · `),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:` ✎`})]}),(0,R.jsx)(`div`,{hidden:_&&!S,children:(0,R.jsx)(b$,{onGather:A,translations:{intro:f.gatherIntro,includeContent:f.includeContent,includeSummary:f.includeSummary,depth:f.gatherDepth,maxResources:f.gatherMaxResources,gather:f.gatherButton},children:o.length>0&&(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:f.recallLabel}),(0,R.jsx)(`div`,{className:`semiont-form__recall-chips`,children:o.map(e=>{let t=!E.includes(e);return(0,R.jsx)(`button`,{type:`button`,className:`semiont-form__recall-chip`,"data-included":t,"aria-pressed":t,onClick:()=>D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),children:e},e)})})]})})}),_&&(0,R.jsx)(c$,{context:c,contextLoading:l,contextError:u,translations:te}),_&&c&&(0,R.jsx)(m$,{...p?{generationAgent:p}:{},context:c,config:h,onConfigChange:g,defaultFolder:i,onGenerate:j,translations:{resourceTitle:f.resourceTitle,resourceTitlePlaceholder:f.resourceTitlePlaceholder,saveLocation:f.saveLocation,additionalInstructions:f.additionalInstructions,additionalInstructionsPlaceholder:f.additionalInstructionsPlaceholder,language:f.language,languageHelp:f.languageHelp,creativity:f.creativity,creativityFocused:f.creativityFocused,creativityCreative:f.creativityCreative,maxLength:f.maxLength,maxLengthHelp:f.maxLengthHelp,maxLengthCeiling:f.maxLengthCeiling,outputFormat:f.outputFormat,formatExtensionMismatch:f.formatExtensionMismatch,generate:f.generate}})]})]})})})})]})})}var S$=Te(nT(),1);function C$(){let{announce:e}=aI();return{announceSearching:(0,y.useCallback)(()=>{e(`Searching...`,`polite`)},[e]),announceSearchResults:(0,y.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,y.useCallback)((t,n)=>{e(`Selected ${n}: ${t}. Press Enter to navigate.`,`polite`)},[e]),announceNavigation:(0,y.useCallback)((t,n)=>{e(`Navigating to ${n}: ${t}`,`assertive`)},[e])}}var w$=300,T$=5;function E$({isOpen:e,onClose:t,onNavigate:n,translations:r={}}){let{announceSearchResults:i,announceSearching:a}=C$(),o=Z(Sm().activeSession$)?.client,s=(0,y.useRef)(o);s.current=o;let[c,l]=(0,y.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,y.useState)(()=>ql(e=>s.current.browse.resources({search:e,limit:T$}).pipe((0,S$.map)(e=>{let t=Wc(e)?.resources;if(t!==void 0)return t.map(e=>{let t=Br(e);return t?{type:`resource`,id:t,name:e.name,content:e.content?.substring(0,150)}:null}).filter(e=>e!==null)})),{debounceMs:w$}));(0,y.useEffect)(()=>()=>d.dispose(),[d]);let f=Z(d.query$)??``,p=Z(d.state$),m=p?.results??[],h=p?.isSearching??!1;(0,y.useEffect)(()=>{e&&(d.setQuery(``),l(0))},[e,d]),(0,y.useEffect)(()=>{l(0)},[m.length]),(0,y.useEffect)(()=>{f.trim()&&(h?a():i(m.length,f))},[h,m.length]);let g=e=>{e.key===`ArrowDown`?(e.preventDefault(),l(e=>(e+1)%Math.max(1,m.length))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>(e-1+Math.max(1,m.length))%Math.max(1,m.length))):e.key===`Enter`&&m[c]&&(e.preventDefault(),_(m[c]))},_=e=>{t(),n(e.type,e.id)};return(0,R.jsx)(Rq,{appear:!0,show:e,children:(0,R.jsxs)(iJ,{as:`div`,className:`semiont-search-modal`,onClose:t,children:[(0,R.jsx)(Lq,{enter:`ease-out duration-200`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-150`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__backdrop`})}),(0,R.jsx)(`div`,{className:`semiont-search-modal__wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-search-modal__centering`,children:(0,R.jsx)(Lq,{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,R.jsxs)(nJ,{className:`semiont-search-modal__panel`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__input-container`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__search-icon-wrapper`,children:(0,R.jsx)(`svg`,{className:`semiont-search-modal__search-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`input`,{type:`text`,value:f,onChange:e=>d.setQuery(e.target.value),onKeyDown:g,placeholder:u.placeholder,className:`semiont-search-modal__input`,autoFocus:!0}),(0,R.jsx)(`div`,{className:`semiont-search-modal__esc-wrapper`,children:(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.esc})})]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__results`,children:[h&&(0,R.jsx)(`div`,{className:`semiont-search-modal__empty`,children:u.searching}),!h&&f&&m.length===0&&(0,R.jsxs)(`div`,{className:`semiont-search-modal__empty`,children:[u.noResults,` "`,f,`"`]}),!h&&m.length>0&&(0,R.jsx)(`div`,{className:`semiont-search-modal__results-list`,children:m.map((e,t)=>(0,R.jsxs)(`button`,{onClick:()=>_(e),onMouseEnter:()=>l(t),className:`semiont-search-modal__result ${t===c?`semiont-search-modal__result--selected`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__result-icon-wrapper`,children:e.type===`resource`?(0,R.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,R.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,R.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,R.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,R.jsxs)(`div`,{className:`semiont-search-modal__result-content`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__result-header`,children:[(0,R.jsx)(`span`,{className:`semiont-search-modal__result-name`,children:e.name}),e.type===`entity`&&e.entityType&&(0,R.jsx)(`span`,{className:`semiont-search-modal__result-badge`,children:e.entityType})]}),e.content&&(0,R.jsx)(`p`,{className:`semiont-search-modal__result-description`,children:e.content})]}),t===c&&(0,R.jsx)(`div`,{className:`semiont-search-modal__result-action`,children:(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd`,children:u.enter})})]},`${e.type}-${e.id}`))}),!h&&!f&&(0,R.jsxs)(`div`,{className:`semiont-search-modal__help`,children:[(0,R.jsx)(`div`,{className:`semiont-search-modal__help-text`,children:u.startTyping}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcuts`,children:[(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`↑↓`}),u.navigate]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:u.enter}),u.select]}),(0,R.jsxs)(`div`,{className:`semiont-search-modal__shortcut`,children:[(0,R.jsx)(`kbd`,{className:`semiont-search-modal__kbd semiont-search-modal__kbd--small`,children:`Esc`}),u.close]})]})]})]})]})})})})]})})}function D$(){return(0,R.jsx)(`div`,{className:`semiont-skip-links`,children:(0,R.jsxs)(`div`,{className:`semiont-skip-links-container`,children:[(0,R.jsx)(`a`,{href:`#main-content`,className:`semiont-skip-link semiont-skip-link-first`,children:`Skip to main content`}),(0,R.jsx)(`a`,{href:`#main-navigation`,className:`semiont-skip-link`,children:`Skip to navigation`}),(0,R.jsx)(`a`,{href:`#search`,className:`semiont-skip-link semiont-skip-link-last`,children:`Skip to search`})]})})}function O$({isFullyAuthenticated:e=!1,isAuthenticated:t=!1,hasValidGatewayToken:n=!1}){let r=Z(Sm().activeSession$)?.client,[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null);return(0,y.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,R.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,R.jsxs)(`p`,{className:`semiont-status-message`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`System status: `}),(()=>{if(t&&!n)return`🚀 Frontend Status: Ready • Gateway: Please sign out and sign in again to reconnect`;if(!e)return`🚀 Frontend Status: Ready • Gateway: Authentication required`;if(i)return`\u{1F680} Frontend Status: Ready \u2022 Gateway: ${i.status} (v${i.version})`;if(o)return`🚀 Frontend Status: Ready • Gateway: Connecting...`;if(c){let e=c.message;return e.includes(`401`)||e.includes(`Unauthorized`)?`🚀 Frontend Status: Ready • Gateway: Please sign out and sign in again`:`🚀 Frontend Status: Ready • Gateway: Connection failed`}return`🚀 Frontend Status: Ready • Gateway: Unknown`})()]}),e?c?(0,R.jsxs)(`p`,{className:`semiont-status-hint semiont-status-error-hint`,role:`alert`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Error: `}),`Check that the gateway server is running and accessible`]}):null:(0,R.jsx)(`p`,{className:`semiont-status-hint`,children:`Sign in to view gateway status`})]})}function k$({t:e,className:t=``,size:n=`lg`,showTagline:r=!0,animated:i=!0,compactTagline:a=!1}){return(0,R.jsxs)(`div`,{className:`semiont-branding ${t}`,"data-size":n,"data-animated":i,"data-compact-tagline":a,children:[(0,R.jsx)(`h1`,{className:`semiont-branding-title`,children:(0,R.jsx)(`span`,{className:`semiont-branding-text`,children:`Semiont`})}),r&&(0,R.jsx)(`h2`,{className:`semiont-branding-tagline`,children:e(`tagline`)})]})}function A$({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}=GF();if(o===`floating`&&i)return(0,R.jsxs)(`div`,{className:`semiont-unified-header semiont-unified-header--floating`,"data-variant":`floating`,ref:m,children:[(0,R.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,R.jsx)(k$,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]});let h=(0,R.jsxs)(`div`,{className:`semiont-unified-header__content`,"data-variant":o,children:[i?(0,R.jsxs)(`div`,{className:`semiont-unified-header__branding-wrapper`,ref:m,children:[(0,R.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,R.jsx)(k$,{t:r,size:`sm`,showTagline:!0,animated:!1,compactTagline:!0,className:`semiont-unified-header__branding`})}),d&&s&&(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:p,currentPath:u})})]}):(0,R.jsx)(`div`,{}),(0,R.jsx)(`div`,{className:`semiont-unified-header__actions`,"data-variant":o})]});return o===`standalone`?(0,R.jsx)(`header`,{className:`semiont-unified-header semiont-unified-header--standalone`,"data-variant":`standalone`,children:(0,R.jsx)(`div`,{className:`semiont-unified-header__container`,children:h})}):h}function j$({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,y.useState)(!1),{width:p,setWidth:m,minWidth:h,maxWidth:g}=zF({defaultWidth:256,minWidth:192,maxWidth:400,storageKey:`semiont-left-sidebar-width`});return(0,y.useEffect)(()=>{o&&localStorage.getItem(s)===`true`&&f(!0)},[o,s]),(0,R.jsxs)(`aside`,{className:`semiont-left-sidebar`,"data-collapsed":d,style:d?void 0:{width:`${p}px`,position:`relative`},children:[!d&&(0,R.jsx)(FU,{onResize:m,minWidth:h,maxWidth:g,position:`right`,ariaLabel:`Resize left sidebar`}),(0,R.jsx)(`div`,{className:`semiont-left-sidebar__header`,"data-collapsed":d,children:(0,R.jsx)(e,{href:a,className:`semiont-left-sidebar__branding-button`,"aria-label":`Go to home page`,children:d?(0,R.jsx)(`div`,{className:`semiont-left-sidebar__logo-collapsed`,children:(0,R.jsx)(`span`,{className:`semiont-left-sidebar__logo-text`,children:`S`})}):(0,R.jsx)(k$,{t:r,size:`sm`,showTagline:!1,animated:!1,className:``})})}),(0,R.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,R.jsx)(FY,{Link:e,routes:t,t:n,isAdmin:c,isModerator:l,brandingLink:a,onItemClick:r,currentPath:u})):i})]})}function M$({Link:e,routes:t,t:n,tNav:r,tHome:i,children:a,className:o=``,showAuthLinks:s=!0,CookiePreferences:c,onOpenKeyboardHelp:l}){return(0,R.jsxs)(`div`,{className:`semiont-page-layout`,children:[(0,R.jsx)(D$,{}),(0,R.jsx)(`header`,{role:`banner`,className:`semiont-page-layout__header`,children:(0,R.jsx)(`div`,{className:`semiont-page-layout__header-container`,children:(0,R.jsx)(A$,{Link:e,routes:t,t:r,tHome:i,showAuthLinks:s,brandingLink:`/`,variant:`embedded`})})}),(0,R.jsx)(`main`,{role:`main`,id:`main-content`,tabIndex:-1,className:`semiont-page-layout__main ${o}`,children:a}),(0,R.jsx)(PY,{Link:e,routes:t,t:n,...c&&{CookiePreferences:c},...l&&{onOpenKeyboardHelp:l}})]})}function N$({message:e}){return(0,R.jsx)(`div`,{className:`semiont-loading-state-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-compose`,children:(0,R.jsx)(`p`,{className:`semiont-loading-message`,children:e})})})}function P$(){return(0,R.jsx)(`div`,{className:`semiont-loading-state semiont-loading-state-resource`,children:(0,R.jsx)(`p`,{className:`semiont-loading-message`,children:`Loading resource...`})})}function F$({error:e,onRetry:t}){return(0,R.jsxs)(`div`,{className:`semiont-error-state semiont-error-state-resource`,children:[(0,R.jsx)(`p`,{className:`semiont-error-message`,children:e instanceof Error?e.message:`Failed to load resource`}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-button`,"data-variant":`secondary`,children:`Try Again`})]})}function I$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 L$=y.forwardRef(I$);function R$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 z$=y.forwardRef(R$);function B$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 V$=y.forwardRef(B$);function H$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 U$=y.forwardRef(H$);function W$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 G$=y.forwardRef(W$);function K$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 q$=y.forwardRef(K$);function J$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 Y$=y.forwardRef(J$);function X$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 Z$=y.forwardRef(X$);function Q$({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 $$=y.forwardRef(Q$);function e1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 t1=y.forwardRef(e1);function n1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 r1=y.forwardRef(n1);function i1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.5v15m7.5-7.5h-15`}))}var a1=y.forwardRef(i1);function o1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 s1=y.forwardRef(o1);function c1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 l1=y.forwardRef(c1);function u1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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`}),y.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.008v.008H6V6Z`}))}var d1=y.forwardRef(u1);function f1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 p1=y.forwardRef(f1);function m1({title:e,titleId:t,...n},r){return y.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?y.createElement(`title`,{id:t},e):null,y.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 h1=y.forwardRef(m1),g1=Te(hm(),1),_1=[`knowledge-base`,`user`,`settings`];function v1(e,t){let n=[],r=new g1.BehaviorSubject(t?.initialPanel??null),i=new g1.BehaviorSubject(null),a=new g1.BehaviorSubject(null),o=0;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=iT(n)??`highlight`;a.next({tab:e,generation:++o})}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 y1({suggestedFeatures:e,theme:t,activePanel:n,translations:r,StatusDisplay:i,ToolbarPanels:a,Toolbar:o}){return(0,R.jsxs)(`div`,{className:`semiont-page${n&&_1.includes(n)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:r.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:r.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,R.jsx)(`h2`,{className:`semiont-admin__section-title`,children:r.systemStatus}),(0,R.jsx)(i,{})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__section`,children:[(0,R.jsx)(`h2`,{className:`semiont-admin__section-title`,children:r.cliOperations}),(0,R.jsx)(`p`,{className:`semiont-admin__section-description`,children:r.cliOperationsDescription}),(0,R.jsx)(`div`,{className:`semiont-admin__features-grid`,children:e.map(e=>(0,R.jsx)(`div`,{className:`semiont-devops-feature`,children:(0,R.jsxs)(`div`,{className:`semiont-devops-feature__header`,children:[(0,R.jsx)(`div`,{className:`semiont-devops-feature__icon-box`,children:(0,R.jsx)(e.icon,{className:`semiont-devops-feature__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-devops-feature__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-devops-feature__title`,children:e.title}),(0,R.jsx)(`p`,{className:`semiont-devops-feature__description`,children:e.description}),(0,R.jsx)(`p`,{className:`semiont-devops-feature__available`,children:e.available})]})]})},e.title))})]}),(0,R.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-content`,children:[(0,R.jsx)(`div`,{className:`semiont-admin__info-box-icon`,children:(0,R.jsx)(U$,{className:`semiont-icon semiont-icon--info`})}),(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-text`,children:[(0,R.jsx)(`h3`,{className:`semiont-admin__info-box-title`,children:r.cliTitle}),(0,R.jsxs)(`div`,{className:`semiont-admin__info-box-description`,children:[(0,R.jsx)(`p`,{children:r.cliDescription}),(0,R.jsx)(`code`,{className:`semiont-admin__info-box-code`,children:`semiont --help`})]})]})]})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(a,{activePanel:n,theme:t}),(0,R.jsx)(o,{context:`simple`,activePanel:n})]})]})}function b1({providers:e,allowedDomains:t,isLoading:n,theme:r,activePanel:i,translations:a,ToolbarPanels:o,Toolbar:s}){return(0,R.jsxs)(`div`,{className:`semiont-page${i&&_1.includes(i)?` semiont-page--panel-open`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-page__content`,children:(0,R.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:a.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:a.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,R.jsx)(l1,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`semiont-admin__card-title`,children:a.oauthProviders}),(0,R.jsx)(`p`,{className:`semiont-admin__card-description`,children:a.oauthProvidersDescription})]})]}),n?(0,R.jsx)(`div`,{className:`semiont-skeleton-group`,children:(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--bar`})}):e.length>0?(0,R.jsx)(`div`,{className:`semiont-provider-list`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`semiont-provider-item`,children:[(0,R.jsxs)(`div`,{className:`semiont-provider-item__info`,children:[(0,R.jsx)(z$,{className:`semiont-provider-item__icon semiont-provider-item__icon--success`}),(0,R.jsx)(`span`,{className:`semiont-provider-item__name`,children:e.name}),e.clientId&&(0,R.jsxs)(`span`,{className:`semiont-provider-item__client-id`,children:[a.clientId,`: `,e.clientId]})]}),(0,R.jsx)(`span`,{className:`semiont-badge semiont-badge--success`,children:a.configured})]},e.name))}):(0,R.jsx)(`div`,{className:`semiont-empty-message`,children:a.noProvidersConfigured})]}),(0,R.jsxs)(`div`,{className:`semiont-admin__card`,children:[(0,R.jsxs)(`div`,{className:`semiont-admin__card-header`,children:[(0,R.jsx)(Y$,{className:`semiont-admin__card-icon semiont-admin__card-icon--primary`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`semiont-admin__card-title`,children:a.allowedDomains}),(0,R.jsx)(`p`,{className:`semiont-admin__card-description`,children:a.allowedDomainsDescription})]})]}),n?(0,R.jsxs)(`div`,{className:`semiont-skeleton-group`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip`}),(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--chip semiont-skeleton--chip-lg`})]}):t.length>0?(0,R.jsx)(`div`,{className:`semiont-domain-list`,children:t.map(e=>(0,R.jsxs)(`div`,{className:`semiont-chip semiont-chip--primary`,children:[`@`,e]},e))}):(0,R.jsx)(`div`,{className:`semiont-empty-message`,children:a.noDomainsConfigured})]}),(0,R.jsx)(`div`,{className:`semiont-admin__info-box`,children:(0,R.jsxs)(`div`,{className:`semiont-info-box__content`,children:[(0,R.jsx)(Z$,{className:`semiont-info-box__icon`}),(0,R.jsxs)(`div`,{className:`semiont-info-box__text`,children:[(0,R.jsx)(`p`,{className:`semiont-info-box__title`,children:a.configManagementTitle}),(0,R.jsx)(`p`,{className:`semiont-info-box__description`,children:a.configManagementDescription}),(0,R.jsxs)(`ul`,{className:`semiont-info-box__list`,children:[(0,R.jsx)(`li`,{children:a.configLocalDev}),(0,R.jsxs)(`li`,{children:[a.configCloudDeploy,` `,(0,R.jsx)(`code`,{className:`semiont-code-inline`,children:a.configCloudDeployCommand}),` `,a.configCloudDeployEnd]}),(0,R.jsx)(`li`,{children:a.configAWS})]})]})]})})]})}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(o,{activePanel:i,theme:r}),(0,R.jsx)(s,{context:`simple`,activePanel:i})]})]})}function x1({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,R.jsxs)(`tr`,{className:`semiont-table__row`,children:[(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsxs)(`div`,{className:`semiont-user-info`,children:[(0,R.jsx)(h1,{className:`semiont-user-info__avatar`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`semiont-user-info__name`,children:e.name||r.noName}),(0,R.jsx)(`div`,{className:`semiont-user-info__email`,children:e.email})]})]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsxs)(`span`,{className:`semiont-table__text--secondary`,children:[`@`,e.domain]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsx)(`span`,{className:i[o],children:r[o]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell`,children:(0,R.jsx)(`span`,{className:a[s],children:r[s]})}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:e.lastLogin?new Date(e.lastLogin).toLocaleDateString():r.never}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__text--secondary`,children:new Date(e.created).toLocaleDateString()}),(0,R.jsx)(`td`,{className:`semiont-table__cell semiont-table__cell--actions`,children:(0,R.jsxs)(`div`,{className:`semiont-table__actions`,children:[(0,R.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,R.jsx)(l1,{className:`semiont-action-button__icon`})}),(0,R.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,R.jsx)(r1,{className:`semiont-action-button__icon`})}),(0,R.jsx)(`button`,{onClick:()=>n(e.id),className:`semiont-action-button semiont-action-button--danger`,title:r.deleteUser,children:(0,R.jsx)(p1,{className:`semiont-action-button__icon`})})]})})]})}function S1({users:e,userStats:t,isLoadingUsers:n,isLoadingStats:r,onUpdateUser:i,onDeleteUser:a,onAddUser:o,onExportUsers:s,theme:c,activePanel:l,translations:u,ToolbarPanels:d,Toolbar:f,buttonStyles:p}){let[m,h]=(0,y.useState)(``),[g,_]=(0,y.useState)(`all`),[v,b]=(0,y.useState)(`all`),x=e.filter(e=>{let t=(e.name||``).toLowerCase().includes(m.toLowerCase())||e.email.toLowerCase().includes(m.toLowerCase()),n=e.isAdmin?`admin`:`user`,r=e.isActive?`active`:`inactive`;return t&&(g===`all`||n===g)&&(v===`all`||r===v)});return(0,R.jsxs)(`div`,{className:`semiont-page${l&&_1.includes(l)?` semiont-page--panel-open`:``}`,children:[(0,R.jsx)(`div`,{className:`semiont-page__content`,children:(0,R.jsxs)(`div`,{className:`semiont-page__sections`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header-with-action`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:u.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:u.subtitle})]}),(0,R.jsxs)(`button`,{onClick:o,className:p.primary.base,children:[(0,R.jsx)(a1,{className:`semiont-button__icon`}),u.addUser]})]}),(0,R.jsx)(`div`,{className:`semiont-admin__stats-grid`,children:r?[,,,,].fill(0).map((e,t)=>(0,R.jsx)(`div`,{className:`semiont-stat-card semiont-stat-card--loading`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--icon`}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--text`}),(0,R.jsx)(`div`,{className:`semiont-skeleton semiont-skeleton--number`})]})]})},t)):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(h1,{className:`semiont-stat-card__icon semiont-stat-card__icon--primary`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.totalUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.totalUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(`div`,{className:`semiont-stat-card__status-indicator semiont-stat-card__status-indicator--active`,children:(0,R.jsx)(`div`,{className:`semiont-stat-card__status-dot`})})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.activeUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.activeUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(l1,{className:`semiont-stat-card__icon semiont-stat-card__icon--danger`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.administrators}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.adminUsers??0})]})]})}),(0,R.jsx)(`div`,{className:`semiont-stat-card`,children:(0,R.jsxs)(`div`,{className:`semiont-stat-card__content`,children:[(0,R.jsx)(`div`,{className:`semiont-stat-card__icon-wrapper`,children:(0,R.jsx)(q$,{className:`semiont-stat-card__icon semiont-stat-card__icon--warning`})}),(0,R.jsxs)(`div`,{className:`semiont-stat-card__text`,children:[(0,R.jsx)(`p`,{className:`semiont-stat-card__label`,children:u.recentUsers}),(0,R.jsx)(`p`,{className:`semiont-stat-card__value`,children:t?.recentSignups?.length??0})]})]})})]})}),(0,R.jsx)(`div`,{className:`semiont-admin__filters-card`,children:(0,R.jsxs)(`div`,{className:`semiont-admin__filters-grid`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`search`,className:`semiont-form__label`,children:u.searchUsers}),(0,R.jsxs)(`div`,{className:`semiont-search-input`,children:[(0,R.jsx)(`div`,{className:`semiont-search-input__icon`,children:(0,R.jsx)(t1,{className:`semiont-icon semiont-icon--small`})}),(0,R.jsx)(`input`,{type:`text`,id:`search`,className:`semiont-search-input__field`,placeholder:u.searchPlaceholder,value:m,onChange:e=>h(e.target.value)})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`role`,className:`semiont-form__label`,children:u.role}),(0,R.jsxs)(`select`,{id:`role`,className:`semiont-select`,value:g,onChange:e=>_(e.target.value),children:[(0,R.jsx)(`option`,{value:`all`,children:u.allRoles}),(0,R.jsx)(`option`,{value:`admin`,children:u.admin}),(0,R.jsx)(`option`,{value:`user`,children:u.user})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`status`,className:`semiont-form__label`,children:u.status}),(0,R.jsxs)(`select`,{id:`status`,className:`semiont-select`,value:v,onChange:e=>b(e.target.value),children:[(0,R.jsx)(`option`,{value:`all`,children:u.allStatus}),(0,R.jsx)(`option`,{value:`active`,children:u.active}),(0,R.jsx)(`option`,{value:`inactive`,children:u.inactive})]})]}),(0,R.jsx)(`div`,{className:`semiont-form__field semiont-form__field--align-end`,children:(0,R.jsx)(`button`,{onClick:s,className:`${p.secondary.base} semiont-button--full-width`,children:u.exportUsers})})]})}),(0,R.jsxs)(`div`,{className:`semiont-admin__table-card`,children:[(0,R.jsx)(`div`,{className:`semiont-table-container`,children:n?(0,R.jsxs)(`div`,{className:`semiont-loading-state`,children:[(0,R.jsx)(`div`,{className:`semiont-spinner`}),(0,R.jsx)(`p`,{className:`semiont-loading-state__text`,children:u.loadingUsers})]}):(0,R.jsxs)(`table`,{className:`semiont-table`,children:[(0,R.jsx)(`thead`,{className:`semiont-table__head`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.userColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.domainColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.roleColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.statusColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.lastLoginColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header`,children:u.joinedColumn}),(0,R.jsx)(`th`,{className:`semiont-table__header semiont-table__header--actions`,children:u.actionsColumn})]})}),(0,R.jsx)(`tbody`,{className:`semiont-table__body`,children:x.map(e=>(0,R.jsx)(x1,{user:e,onUpdate:i,onDelete:a,translations:u},e.id))})]})}),!n&&x.length===0&&(0,R.jsxs)(`div`,{className:`semiont-empty-state`,children:[(0,R.jsx)(h1,{className:`semiont-empty-state__icon`}),(0,R.jsx)(`h3`,{className:`semiont-empty-state__title`,children:u.noUsersFound}),(0,R.jsx)(`p`,{className:`semiont-empty-state__description`,children:u.noUsersFoundDescription})]})]})]})}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(d,{activePanel:l,theme:c}),(0,R.jsx)(f,{context:`simple`,activePanel:l})]})]})}function C1(){return(0,R.jsxs)(`svg`,{className:`semiont-icon semiont-icon--small semiont-icon--inline`,viewBox:`0 0 24 24`,children:[(0,R.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,R.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,R.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,R.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 w1({onSignUp:e,Link:t,translations:n}){let[r,i]=(0,y.useState)(!1);return(0,R.jsx)(`main`,{className:`semiont-auth__main`,role:`main`,children:(0,R.jsx)(`div`,{className:`semiont-auth__container`,children:(0,R.jsxs)(`div`,{className:`semiont-auth__content`,children:[(0,R.jsxs)(`section`,{"aria-labelledby":`signup-heading`,className:`semiont-auth__branding`,children:[(0,R.jsx)(`h1`,{id:`signup-heading`,className:`sr-only`,children:n.pageTitle}),(0,R.jsx)(k$,{t:e=>n[e]||e,size:`xl`,animated:!0,className:`semiont-auth__logo`}),(0,R.jsx)(`p`,{className:`semiont-auth__welcome`,children:n.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-auth__subtitle`,children:n.signUpPrompt})]}),(0,R.jsxs)(`div`,{className:`semiont-auth__forms`,children:[(0,R.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:`${aT.primary.base} semiont-button--full-width`,children:[r?(0,R.jsx)(`div`,{className:`semiont-auth__spinner`}):(0,R.jsx)(C1,{}),r?n.creatingAccount:n.signUpWithGoogle]}),(0,R.jsxs)(`div`,{className:`semiont-auth__info`,children:[n.approvedDomainsInfo,(0,R.jsx)(`br`,{}),n.termsAgreement]})]}),(0,R.jsxs)(`div`,{className:`semiont-auth__links`,children:[(0,R.jsx)(t,{href:`/`,className:aT.secondary.base,children:n.backToHome}),(0,R.jsx)(t,{href:`/auth/signin`,className:aT.primary.base,children:n.alreadyHaveAccount})]})]})})})}function T1(e,t){switch(e){case`Configuration`:return t.errorConfiguration;case`AccessDenied`:return t.errorAccessDenied;case`Verification`:return t.errorVerification;default:return t.errorGeneric}}function E1({errorType:e,Link:t,translations:n}){let r=T1(e,n);return(0,R.jsx)(`div`,{className:`semiont-auth-error-display`,children:(0,R.jsxs)(`div`,{className:`semiont-auth-error-display__container`,children:[(0,R.jsx)(`div`,{children:(0,R.jsx)(`h2`,{className:`semiont-auth-error-display__title`,children:n.pageTitle})}),(0,R.jsx)(`div`,{className:`semiont-auth-error-display__error-box`,children:(0,R.jsx)(`div`,{className:`semiont-auth-error-display__error-message`,children:r})}),(0,R.jsx)(`div`,{className:`semiont-auth-error-display__actions`,children:(0,R.jsx)(t,{href:`/auth/signin`,className:`semiont-auth-error-display__link`,children:n.tryAgain})})]})})}function D1({userName:e,status:t,isProcessing:n,onAccept:r,onDecline:i,translations:a,PageLayout:o,Link:s}){return t===`loading`?(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__loading`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__loading-content`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__spinner`}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__loading-text`,children:a.loading})]})})}):t===`accepted`?(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__accepted`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__accepted-content`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__accepted-icon`,children:(0,R.jsx)(`svg`,{className:`semiont-welcome-page__accepted-checkmark`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`semiont-welcome-page__accepted-title`,children:a.welcomeTitle}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__accepted-subtitle`,children:a.thanksForAccepting})]})]})})}):(0,R.jsx)(o,{className:`semiont-welcome-page__layout`,children:(0,R.jsx)(`div`,{className:`semiont-welcome-page__form-wrapper`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__form`,children:[(0,R.jsxs)(`div`,{className:`semiont-welcome-page__form-header`,children:[(0,R.jsx)(`div`,{className:`semiont-welcome-page__form-icon`,children:(0,R.jsx)(`svg`,{className:`semiont-welcome-page__form-icon-svg`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`h1`,{className:`semiont-welcome-page__form-title`,children:a.welcomeUser.replace(`{firstName}`,e||``)}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__form-subtitle`,children:a.reviewTermsPrompt})]}),(0,R.jsx)(`div`,{className:`semiont-welcome-page__terms-content`,children:(0,R.jsxs)(`div`,{className:`semiont-welcome-page__prose`,children:[(0,R.jsx)(`h3`,{children:a.termsSummaryTitle}),(0,R.jsx)(`p`,{children:a.termsSummaryIntro}),(0,R.jsx)(`h4`,{children:a.acceptableUseTitle}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.acceptableUseResponsible}),(0,R.jsx)(`li`,{children:a.acceptableUseRespect}),(0,R.jsx)(`li`,{children:a.acceptableUseConduct})]}),(0,R.jsx)(`h4`,{children:a.prohibitedContentTitle}),(0,R.jsx)(`p`,{children:a.prohibitedContentIntro}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.prohibitedIllegal}),(0,R.jsx)(`li`,{children:a.prohibitedAdult}),(0,R.jsx)(`li`,{children:a.prohibitedHate}),(0,R.jsx)(`li`,{children:a.prohibitedViolence}),(0,R.jsx)(`li`,{children:a.prohibitedMisinformation}),(0,R.jsx)(`li`,{children:a.prohibitedPrivacy}),(0,R.jsx)(`li`,{children:a.prohibitedCopyright}),(0,R.jsx)(`li`,{children:a.prohibitedMalware}),(0,R.jsx)(`li`,{children:a.prohibitedSpam})]}),(0,R.jsx)(`h4`,{children:a.conductTitle}),(0,R.jsxs)(`p`,{children:[a.conductDescription,` `,(0,R.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,R.jsx)(`h4`,{children:a.responsibilitiesTitle}),(0,R.jsxs)(`ul`,{children:[(0,R.jsx)(`li`,{children:a.responsibilitiesSecure}),(0,R.jsx)(`li`,{children:a.responsibilitiesReport}),(0,R.jsx)(`li`,{children:a.responsibilitiesAccurate}),(0,R.jsx)(`li`,{children:a.responsibilitiesComply})]}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__warning`,children:a.violationsWarning})]})}),(0,R.jsxs)(`div`,{className:`semiont-welcome-page__actions`,children:[(0,R.jsxs)(`p`,{className:`semiont-welcome-page__legal-links`,children:[a.readFullTerms,` `,(0,R.jsx)(s,{href:`/terms`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.termsOfService}),` `,a.and,` `,(0,R.jsx)(s,{href:`/privacy`,target:`_blank`,className:`semiont-welcome-page__link`,children:a.privacyPolicy})]}),(0,R.jsxs)(`div`,{className:`semiont-welcome-page__buttons`,children:[(0,R.jsx)(`button`,{onClick:i,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--secondary`,children:a.declineAndSignOut}),(0,R.jsx)(`button`,{onClick:r,disabled:n,className:`semiont-welcome-page__button semiont-welcome-page__button--primary`,children:n?a.processing:a.acceptAndContinue})]}),(0,R.jsx)(`p`,{className:`semiont-welcome-page__legal-notice`,children:a.legallyBound})]})]})})})}function O1({entityTypes:e,error:t,newTag:n,onNewTagChange:r,onAddTag:i,isAddingTag:a,theme:o,activePanel:s,translations:c,ToolbarPanels:l,Toolbar:u}){return(0,R.jsxs)(`div`,{className:`semiont-page${s&&_1.includes(s)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:c.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:c.pageDescription})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-entity-tags__header`,children:[(0,R.jsx)(`div`,{className:`semiont-entity-tags__icon-box`,children:(0,R.jsx)(d1,{className:`semiont-entity-tags__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-entity-tags__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-entity-tags__title`,children:c.sectionTitle}),(0,R.jsx)(`p`,{className:`semiont-entity-tags__description`,children:c.sectionDescription})]})]}),(0,R.jsx)(`div`,{className:`semiont-entity-tags__tags-section`,children:(0,R.jsx)(`div`,{className:`semiont-tags`,children:e.map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--info semiont-tag--rounded-md`,children:e},e))})}),(0,R.jsxs)(`div`,{className:`semiont-entity-tags__input-group`,children:[(0,R.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()},placeholder:c.inputPlaceholder,className:`semiont-entity-tags__input`,disabled:a}),(0,R.jsx)(`button`,{onClick:i,disabled:a||!n.trim(),className:`semiont-button semiont-button--primary`,children:a?c.adding:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(a1,{className:`semiont-icon semiont-icon--small semiont-icon--inline`}),c.addTag]})})]}),t&&(0,R.jsxs)(`div`,{className:`semiont-entity-tags__error`,children:[(0,R.jsx)(G$,{className:`semiont-entity-tags__error-icon`}),t]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(l,{activePanel:s,theme:o}),(0,R.jsx)(u,{context:`simple`,activePanel:s})]})]})}function k1({isLoading:e,theme:t,activePanel:n,translations:r,ToolbarPanels:i,Toolbar:a}){return e?(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:r.loading})}):(0,R.jsxs)(`div`,{className:`semiont-page${n&&_1.includes(n)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:r.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:r.pageDescription})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-recent-docs__header`,children:[(0,R.jsx)(`div`,{className:`semiont-recent-docs__icon-box`,children:(0,R.jsx)(V$,{className:`semiont-recent-docs__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-recent-docs__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-recent-docs__title`,children:r.sectionTitle}),(0,R.jsx)(`p`,{className:`semiont-recent-docs__description`,children:r.sectionDescription})]})]}),(0,R.jsxs)(`div`,{className:`semiont-recent-docs__empty-state`,children:[(0,R.jsx)(`svg`,{className:`semiont-recent-docs__empty-icon`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,R.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,R.jsx)(`p`,{className:`semiont-recent-docs__empty-message`,children:r.noDocuments}),(0,R.jsx)(`p`,{className:`semiont-recent-docs__empty-hint`,children:r.activityWillAppear})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(i,{activePanel:n,theme:t}),(0,R.jsx)(a,{context:`simple`,activePanel:n})]})]})}var A1={legal:s1,scientific:L$,general:$$},j1={legal:`semiont-schema-domain--legal`,scientific:`semiont-schema-domain--scientific`,general:`semiont-schema-domain--general`};function M1({schemas:e,isLoading:t,theme:n,activePanel:r,translations:i,ToolbarPanels:a,Toolbar:o}){return t?(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:i.loading})}):(0,R.jsxs)(`div`,{className:`semiont-page${r&&_1.includes(r)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:i.pageTitle}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:i.pageDescription})]}),(0,R.jsx)(`div`,{className:`semiont-card-grid semiont-card-grid--two-columns`,children:e.map(e=>{let t=A1[e.domain]||$$,n=j1[e.domain]||j1.general;return(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsxs)(`div`,{className:`semiont-schema__header`,children:[(0,R.jsx)(`div`,{className:`semiont-schema__icon-wrapper ${n}`,children:t&&(0,R.jsx)(t,{className:`semiont-schema__icon`})}),(0,R.jsxs)(`div`,{className:`semiont-schema__content`,children:[(0,R.jsx)(`h3`,{className:`semiont-schema__title`,children:e.name}),(0,R.jsx)(`p`,{className:`semiont-schema__description`,children:e.description}),(0,R.jsx)(`span`,{className:`semiont-schema__badge ${n}`,children:e.domain})]})]}),(0,R.jsxs)(`div`,{className:`semiont-schema__categories`,children:[(0,R.jsx)(`h4`,{className:`semiont-schema__categories-title`,children:i.categories}),e.tags.map(e=>(0,R.jsxs)(`div`,{className:`semiont-schema__category`,children:[(0,R.jsx)(`div`,{className:`semiont-schema__category-name`,children:e.name}),(0,R.jsx)(`div`,{className:`semiont-schema__category-description`,children:e.description}),(0,R.jsxs)(`div`,{className:`semiont-schema__examples`,children:[e.examples.slice(0,2).map((e,t)=>(0,R.jsx)(`span`,{className:`semiont-schema__example`,children:e},t)),e.examples.length>2&&(0,R.jsxs)(`span`,{className:`semiont-schema__example-more`,children:[`+`,e.examples.length-2,` more`]})]})]},e.name))]})]},e.id)})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(a,{activePanel:r,theme:n}),(0,R.jsx)(o,{context:`simple`,activePanel:r})]})]})}function N1(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function P1({progress:e,label:t=`Upload`}){if(!e)return null;if(e.phase===`started`)return(0,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:(0,R.jsxs)(`span`,{children:[t,`: starting…`]})}),(0,R.jsx)(`div`,{className:`semiont-progress semiont-progress--indeterminate`,children:(0,R.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,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:n?(0,R.jsxs)(`span`,{children:[t,`: `,N1(e.bytesUploaded),`…`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{children:[t,`: `,r,`%`]}),(0,R.jsxs)(`span`,{children:[N1(e.bytesUploaded),` / `,N1(e.totalBytes)]})]})}),(0,R.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,R.jsx)(`div`,{className:`semiont-progress__fill`,style:n?void 0:{width:`${r}%`}})})]})}return(0,R.jsxs)(`div`,{className:`semiont-progress-wrapper`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(`div`,{className:`semiont-progress__label`,children:(0,R.jsxs)(`span`,{children:[t,`: uploaded`]})}),(0,R.jsx)(`div`,{className:`semiont-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":100,children:(0,R.jsx)(`div`,{className:`semiont-progress__fill semiont-progress__fill--success`,style:{width:`100%`}})})]})}var F1=Object.values(gi).map(e=>e.extension).join(`,`);function I1(e){if(e.type&&yi(e.type))return e.type;if(e.name.includes(`.`)){let t=Ti(e.name.slice(e.name.lastIndexOf(`.`)));if(t)return t}return`application/octet-stream`}function L1({mode:e,cloneData:t,availableEntityTypes:n,initialLocale:r,theme:i,hoverDelayMs:a,activePanel:o,onSaveResource:s,onCancel:c,uploadProgress:l=null,translations:u,ToolbarPanels:d,Toolbar:f}){let{announceFormSubmitting:p,announceFormSuccess:m,announceFormError:h}=cI(),{showLineNumbers:g}=vm(),[_,v]=(0,y.useState)(``),[b,x]=(0,y.useState)(``),[S,C]=(0,y.useState)([]),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)(`write`),[O,k]=(0,y.useState)(null),[A,j]=(0,y.useState)(`text/markdown`),[M,ee]=(0,y.useState)(null),[N,te]=(0,y.useState)(!1),[P,F]=(0,y.useState)(`text/markdown`),[ne,re]=(0,y.useState)(r),[ie,ae]=(0,y.useState)(``),[oe,se]=(0,y.useState)(``),[I,L]=(0,y.useState)(!0),ce=yi(P)?P:`text/markdown`,le=oe===``?Ni(e===`clone`&&t?Mi(Wr(t.sourceResource)):``,_,ce):oe;(0,y.useEffect)(()=>{e===`clone`&&t&&(v(t.sourceResource.name),x(t.sourceContent))},[e,t]);let ue=e=>{let t=e.target.files?.[0];t&&de(t)},de=e=>{let t=I1(e);if(k(e),j(t),D(`upload`),!_){let t=e.name.replace(/\.[^/.]+$/,``);v(t)}let n=bi(t)?.render;if(n===`image`||n===`pdf`){let t=URL.createObjectURL(e);ee(t)}else{let t=new FileReader;t.onload=e=>{let t=e.target?.result;x(t)},t.readAsText(e)}};(0,y.useEffect)(()=>()=>{M&&URL.revokeObjectURL(M)},[M]);let fe=async t=>{if(t.preventDefault(),_.trim()){T(!0),p();try{let t={mode:e,name:_,storageUri:`file://${le}`,content:b,format:O?A:P,entityTypes:S,language:ne};O&&(t.file=O),ie&&(t.charset=ie),e===`clone`&&(t.archiveOriginal=I),await s(t),m(e===`clone`?`Resource cloned successfully`:`Resource created successfully`)}catch(e){throw h(`Failed to save resource. Please try again.`),e}finally{T(!1)}}},pe=e===`clone`;return(0,R.jsxs)(`div`,{className:`semiont-page${o&&_1.includes(o)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content semiont-page__compose`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:pe?u.titleEditClone:u.title}),pe&&(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:u.subtitleClone})]}),(0,R.jsx)(`div`,{className:`semiont-form`,children:(0,R.jsxs)(`form`,{onSubmit:fe,className:`semiont-form__fields semiont-compose-grid`,children:[(0,R.jsxs)(`div`,{className:`semiont-compose-grid__meta`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`docName`,className:`semiont-form__label`,children:u.resourceName}),(0,R.jsx)(`input`,{id:`docName`,type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:u.resourceNamePlaceholder,className:`semiont-input`,required:!0,disabled:w})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`storagePath`,className:`semiont-form__label`,children:`Save location`}),(0,R.jsxs)(`div`,{className:`semiont-input-addon`,children:[(0,R.jsx)(`span`,{className:`semiont-input-addon__prefix`,children:`file://`}),(0,R.jsx)(`input`,{id:`storagePath`,type:`text`,value:le,onChange:e=>se(e.target.value),placeholder:`docs/my-resource.md`,required:!0,className:`semiont-input semiont-input--addon`,disabled:w})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__entity-types`,children:[(0,R.jsx)(`div`,{className:`semiont-form__label`,children:u.entityTypes}),(0,R.jsx)(`div`,{className:`semiont-form__entity-type-buttons`,role:`group`,"aria-describedby":`entity-types-description`,children:n.map(e=>{let t=S.includes(e);return(0,R.jsx)(`button`,{type:`button`,onClick:()=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`semiont-form__entity-type-button`,"data-selected":t,disabled:w,"aria-pressed":t,"aria-label":`${e} entity type, ${t?`selected`:`not selected`}`,children:e},e)})}),S.length>0&&(0,R.jsxs)(`div`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:[S.length,` entity type`,S.length===1?``:`s`,` selected: `,S.join(`, `)]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`language-select`,className:`semiont-form__label`,children:u.language}),(0,R.jsx)(`select`,{id:`language-select`,value:ne,onChange:e=>re(e.target.value),disabled:w,className:`semiont-select`,children:ei.map(e=>(0,R.jsx)(`option`,{value:e.code,children:e.nativeName},e.code))})]})]}),(0,R.jsxs)(`div`,{className:`semiont-compose-grid__content`,children:[!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:u.contentSource}),(0,R.jsxs)(`div`,{className:`semiont-form__content-source-toggle`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>D(`upload`),disabled:w,className:`semiont-form__content-source-button`,"data-active":E===`upload`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,R.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`📎`}),(0,R.jsx)(`span`,{className:`semiont-form__content-source-label`,children:u.uploadFile})]}),(0,R.jsx)(`div`,{className:`semiont-form__content-source-description`,children:u.uploadFileDescription})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>D(`write`),disabled:w,className:`semiont-form__content-source-button`,"data-active":E===`write`,children:[(0,R.jsxs)(`div`,{className:`semiont-form__content-source-icon-wrapper`,children:[(0,R.jsx)(`span`,{className:`semiont-form__content-source-icon`,children:`✍️`}),(0,R.jsx)(`span`,{className:`semiont-form__content-source-label`,children:u.writeContent})]}),(0,R.jsx)(`div`,{className:`semiont-form__content-source-description`,children:u.writeContentDescription})]})]})]}),!pe&&E===`upload`&&(0,R.jsxs)(`div`,{className:`semiont-form__upload-section`,children:[(0,R.jsx)(`div`,{children:(0,R.jsxs)(`div`,{className:`semiont-form__upload-container`,children:[(0,R.jsx)(`label`,{className:`semiont-form__upload-dropzone`,"data-drag-over":N?`true`:`false`,onDragOver:e=>{e.preventDefault(),te(!0)},onDragLeave:()=>te(!1),onDrop:e=>{e.preventDefault(),te(!1);let t=e.dataTransfer.files?.[0];t&&!w&&de(t)},children:(0,R.jsxs)(`div`,{className:`semiont-form__upload-area`,children:[(0,R.jsx)(`input`,{type:`file`,accept:F1,onChange:ue,className:`semiont-form__upload-input`,disabled:w}),(0,R.jsx)(`p`,{className:`semiont-form__upload-text`,children:O?O.name:u.dropFileOrClick}),(0,R.jsx)(`p`,{className:`semiont-form__upload-hint`,children:u.supportedFormats})]})}),O&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>{k(null),ee(null),j(`text/markdown`)},className:`semiont-button semiont-button--danger semiont-button--small`,disabled:w,children:`Clear`})]})}),O&&(0,R.jsxs)(`div`,{className:`semiont-form__media-type`,children:[(0,R.jsxs)(`span`,{className:`semiont-form__media-type-label`,children:[u.mediaType,`:`]}),(0,R.jsx)(`code`,{className:`semiont-form__media-type-value`,children:A}),(0,R.jsx)(`span`,{className:`semiont-form__media-type-lock`,title:u.autoDetected,children:`🔒`})]}),O&&M&&bi(A)?.render===`image`&&(0,R.jsxs)(`div`,{className:`semiont-form__image-preview`,children:[(0,R.jsx)(`p`,{className:`semiont-form__image-preview-label`,children:`Preview:`}),(0,R.jsx)(`div`,{className:`semiont-form__image-preview-container`,children:(0,R.jsx)(`img`,{src:M,alt:`Upload preview`,className:`semiont-form__image-preview-img`})})]})]}),(pe||E===`write`)&&(0,R.jsxs)(`div`,{className:`semiont-form__write-section`,children:[!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`format-select`,className:`semiont-form__label`,children:u.format}),(0,R.jsx)(`select`,{id:`format-select`,value:P,onChange:e=>F(e.target.value),disabled:w,className:`semiont-select`,children:Oi.map(e=>(0,R.jsxs)(`option`,{value:e,children:[bi(e)?.label??e,` (`,e,`)`]},e))})]}),(0,R.jsxs)(`div`,{className:`semiont-form__field semiont-form__editor`,children:[(0,R.jsx)(`label`,{className:`semiont-form__label`,children:pe?u.resourceContent:u.content}),(0,R.jsx)(`div`,{className:`semiont-form__editor-wrapper`,lang:ne,children:(0,R.jsx)(DU,{content:b,editable:!w,sourceView:!0,showLineNumbers:g,hoverDelayMs:a,onChange:e=>x(e)})})]}),!pe&&(0,R.jsxs)(`div`,{className:`semiont-form__field`,children:[(0,R.jsx)(`label`,{htmlFor:`charset-select`,className:`semiont-form__label`,children:u.encoding}),(0,R.jsxs)(`select`,{id:`charset-select`,value:ie,onChange:e=>ae(e.target.value),disabled:w,className:`semiont-select`,children:[(0,R.jsx)(`option`,{value:``,children:`UTF-8 (default)`}),(0,R.jsx)(`option`,{value:`iso-8859-1`,children:`ISO-8859-1 (Latin-1)`}),(0,R.jsx)(`option`,{value:`windows-1252`,children:`Windows-1252`}),(0,R.jsx)(`option`,{value:`ascii`,children:`ASCII`}),(0,R.jsx)(`option`,{value:`utf-16le`,children:`UTF-16LE`})]})]})]}),pe&&(0,R.jsxs)(`div`,{className:`semiont-form__checkbox-field`,children:[(0,R.jsx)(`input`,{id:`archiveOriginal`,type:`checkbox`,checked:I,onChange:e=>L(e.target.checked),className:`semiont-checkbox`,disabled:w}),(0,R.jsx)(`label`,{htmlFor:`archiveOriginal`,className:`semiont-form__checkbox-label`,children:u.archiveOriginal})]})]}),(0,R.jsxs)(`div`,{className:`semiont-form__actions`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:c,disabled:w||l!==null,className:aT.tertiary.base,children:u.cancel}),(0,R.jsx)(`button`,{type:`submit`,disabled:w||l!==null||!_.trim(),className:aT.primary.base,children:w?pe?u.saving:u.creating:pe?u.saveClonedResource:u.createResource})]}),(0,R.jsx)(P1,{progress:l})]})})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(d,{activePanel:o,theme:i}),(0,R.jsx)(f,{context:`simple`,activePanel:o})]})]})}var R1=y.memo(({resource:e,onOpen:t,tabIndex:n=0,archivedLabel:r,createdLabel:i})=>(0,R.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,R.jsxs)(`div`,{className:`semiont-resource-card__header`,children:[(0,R.jsx)(`h4`,{className:`semiont-resource-card__title`,children:e.name}),e.archived&&(0,R.jsx)(`span`,{className:`semiont-resource-card__badge`,"data-type":`archived`,children:r})]}),(0,R.jsxs)(`div`,{className:`semiont-resource-card__metadata`,children:[(0,R.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,R.jsxs)(`div`,{className:`semiont-tags`,children:[e.entityTypes.slice(0,2).map(e=>(0,R.jsx)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:e},e)),e.entityTypes.length>2&&(0,R.jsxs)(`span`,{className:`semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm`,children:[`+`,e.entityTypes.length-2]})]})]})]}));R1.displayName=`ResourceCard`;function z1({recentDocuments:e,searchDocuments:t,entityTypes:n,isLoadingRecent:r,recentError:i=null,onRetryRecent:a,isSearching:o,searchMatchKind:s,searchQuery:c,onSearchQueryChange:l,selectedEntityType:u,onSelectedEntityTypeChange:d,theme:f,activePanel:p,onNavigateToResource:m,onNavigateToCompose:h,translations:g,ToolbarPanels:_}){let v=c.trim()!==``,b=v?t:e,x=BF(n.length+1,{orientation:`horizontal`}),S=BF(b.length,{orientation:`grid`,cols:2}),C=(0,y.useRef)(m);C.current=m;let w=(0,y.useCallback)(e=>{d(e)},[d]),T=(0,y.useCallback)(e=>{let t=Br(e);t&&C.current(t)},[]);if(i)return(0,R.jsxs)(`div`,{className:`semiont-page__loading`,children:[(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:g.recentFailed}),a&&(0,R.jsx)(`button`,{type:`button`,onClick:a,className:`semiont-button`,"data-variant":`secondary`,children:g.retry})]});if(r)return(0,R.jsx)(`div`,{className:`semiont-page__loading`,children:(0,R.jsx)(`p`,{className:`semiont-page__loading-text`,children:g.loadingKnowledgeBase})});let E=v&&t.length===0&&!o;return(0,R.jsxs)(`div`,{className:`semiont-page${p&&_1.includes(p)?` semiont-page--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__content`,children:[(0,R.jsxs)(`div`,{className:`semiont-page__header`,children:[(0,R.jsx)(`h1`,{className:`semiont-page__title`,children:g.title}),(0,R.jsx)(`p`,{className:`semiont-page__subtitle`,children:g.subtitle})]}),(0,R.jsxs)(`div`,{className:`semiont-card`,children:[(0,R.jsx)(`div`,{className:`semiont-card__search-form`,children:(0,R.jsxs)(`div`,{className:`semiont-card__search-wrapper`,children:[(0,R.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:g.searchPlaceholder,className:`semiont-card__search-input`,"aria-label":g.searchPlaceholder}),o&&(0,R.jsx)(`span`,{className:`semiont-card__search-status`,"aria-live":`polite`,children:g.searching})]})}),n.length>0&&(0,R.jsxs)(`div`,{className:`semiont-card__filters`,children:[(0,R.jsx)(`h3`,{className:`semiont-card__filters-label`,children:g.filterByEntityType}),(0,R.jsxs)(`div`,{ref:x.containerRef,onKeyDown:x.handleKeyDown,className:`semiont-card__filter-buttons`,role:`group`,"aria-label":`Entity type filters`,children:[(0,R.jsx)(`button`,{onClick:()=>w(``),tabIndex:0,"aria-pressed":u===``,className:`semiont-card__filter-button`,"data-active":u===``,children:g.all}),n.map(e=>(0,R.jsx)(`button`,{onClick:()=>w(e),tabIndex:-1,"aria-pressed":u===e,className:`semiont-card__filter-button`,"data-active":u===e,children:e},e))]})]}),(0,R.jsxs)(`div`,{className:`semiont-card__documents`,children:[(0,R.jsx)(`h3`,{className:`semiont-card__documents-label`,children:v&&t.length>0?g.searchResults(t.length):u?g.documentsTaggedWith(u):g.recentResources}),v&&s===`semantic`&&t.length>0&&(0,R.jsx)(`p`,{className:`semiont-card__documents-note`,"data-testid":`semiont-semantic-match-notice`,"aria-live":`polite`,children:g.semanticFallbackNotice}),E&&(0,R.jsx)(`div`,{className:`semiont-card__warning`,children:(0,R.jsx)(`p`,{className:`semiont-card__warning-text`,children:g.noResultsFound(c)})}),b.length>0?(0,R.jsx)(`div`,{ref:S.containerRef,onKeyDown:S.handleKeyDown,className:`semiont-card-grid`,role:`group`,"aria-label":`Document grid`,children:b.map((e,t)=>(0,R.jsx)(R1,{resource:e,onOpen:T,tabIndex:t===0?0:-1,archivedLabel:g.archived,createdLabel:g.created},Br(e)))}):(0,R.jsxs)(`div`,{className:`semiont-card__empty`,children:[(0,R.jsx)(`p`,{className:`semiont-card__empty-text`,children:g.noResourcesAvailable}),!v&&(0,R.jsx)(`button`,{onClick:h,className:`semiont-card__empty-button`,children:g.composeFirstResource})]})]})]})]}),(0,R.jsxs)(`div`,{className:`semiont-page__sidebar`,children:[(0,R.jsx)(_,{activePanel:p,theme:f}),(0,R.jsx)(IU,{context:`simple`,activePanel:p})]})]})}function B1(e,t){let n=Z(Sm().activeSession$),r=(0,y.useRef)(null);(0,y.useEffect)(()=>{!t||!n||r.current!==e&&(r.current=e,n.client.browse.resourceViewed(e))},[e,t,n])}var V1=[`no-text-layer`,`encrypted`,`corrupt`,`too-large`,`empty`];function H1(e){return!Ii(e)||e.declined!==!0||!Pi(e.reason)?null:V1.includes(e.reason)?e.reason:null}function U1(e){let t=ah(`OutcomeToasts`),{showError:n,showSuccess:r,showInfo:i}=Om();rI({"mark:create-error":r=>{r.resourceId===e&&n(t(`createFailed`,{detail:r.message||t(`unknownError`)}))},"mark:delete-error":r=>{r.resourceId===e&&n(t(`deleteFailed`,{detail:r.message||t(`unknownError`)}))},"bind:body-error":r=>{r.resourceId===e&&n(t(`referenceUpdateFailed`,{detail:r.message||t(`unknownError`)}))},"mark:assist-timeout":n=>{n.resourceId===e&&i(t(`assistQuiet`))},"job:complete":n=>{if(n.resourceId!==e)return;if(n.result?.kind===`generation`){r(n.result.resourceName?t(`resourceCreatedNamed`,{name:n.result.resourceName}):t(`resourceCreated`));return}let a=H1(n.result);a?i(t(`decline_${a}`)):r(t(`annotationComplete`))},"job:fail":r=>{r.resourceId===e&&(r.jobType===`generation`?n(t(`generationFailed`,{detail:r.error})):n(r.error||t(`annotationFailed`)))}})}function W1(e,t,n){let r=(0,y.useRef)(e),i=(0,y.useRef)(null),a=(0,y.useRef)(n);(0,y.useEffect)(()=>{a.current=n}),(0,y.useEffect)(()=>{if(e&&e!==r.current&&(r.current=e,i.current=e),!i.current)return;let n=String(i.current.resourceId),o=t.find(e=>e.motivation===`linking`&&String(yr(e.body)??``)===n);o&&(i.current=null,a.current(o.id))},[e,t])}var G1=Te(hm(),1),K1=Te(hm(),1);function q1(e,t){let n=new K1.BehaviorSubject(t),r=new K1.BehaviorSubject(!0),i=new K1.BehaviorSubject(!1),a=new K1.BehaviorSubject(null),o=!1,s=null,c=!1,l=()=>{c||(s?.unsubscribe(),s=e().subscribe(e=>{switch(e.status){case`pending`:o&&!i.getValue()&&i.next(!0);return;case`ready`:a.getValue()!==null&&a.next(null),o=!0,n.next(e.value),r.getValue()&&r.next(!1),i.getValue()&&i.next(!1);return;case`failed`:a.next(e.error),r.getValue()&&r.next(!1),i.getValue()&&i.next(!1);return}}))};return l(),{state:{value$:n.asObservable(),loading$:r.asObservable(),revalidating$:i.asObservable(),error$:a.asObservable(),retry:()=>{c||(a.next(null),o?i.next(!0):r.next(!0),l())}},dispose:()=>{c||(c=!0,s?.unsubscribe(),s=null,n.complete(),r.complete(),i.complete(),a.complete())}}}var J1={open:!1,annotationId:null,resourceId:null,defaultTitle:``,entityTypes:[]};function Y1(e,t,n,r,i){let{client:a}=e,o=Kl(),s=Jl(a),c=tu(a,t),l=Xl(a,t),u=Zl(a,t),d=Ql(a,n);o.add(s),o.add(c),o.add(l),o.add(u),o.add(d);let f=q1(()=>a.browse.annotations(t),[]),p=q1(()=>a.browse.entityTypes(),[]),m=q1(()=>a.browse.events(t),[]),h=q1(()=>a.browse.referencedBy(t),[]);o.add(f.dispose),o.add(p.dispose),o.add(m.dispose),o.add(h.dispose);let g=f.state.value$.pipe((0,G1.map)(qF)),_=new G1.BehaviorSubject(``),v=new G1.BehaviorSubject(!1),y=new G1.BehaviorSubject(null),b=i?.mediaType||`text/plain`,x=Ei(b)!==`decode`;!x&&b&&(v.next(!0),a.browse.resourceRepresentation(t).then(({data:e,contentType:t})=>{_.next(pi(e,t)),v.next(!1)}).catch(()=>{v.next(!1)})),x&&a.auth.mediaToken(t).then(({token:e})=>y.next(e)).catch(()=>{});let S=new G1.BehaviorSubject(J1),C=a.bus.get(`bind:initiate`).subscribe(e=>{S.next({open:!0,annotationId:e.annotationId,resourceId:e.resourceId,defaultTitle:e.defaultTitle,entityTypes:e.entityTypes}),a.bus.get(`gather:requested`).next({correlationId:hr(),annotationId:e.annotationId,resourceId:e.resourceId,options:{contextWindow:2e3}})});return o.add(()=>C.unsubscribe()),{beckon:s,browse:r,mark:c,gather:l,yield:d,annotations:f.state,entityTypes:p.state,events:m.state,referencedBy:h.state,annotationGroups$:g,content$:_.asObservable(),contentLoading$:v.asObservable(),mediaToken$:y.asObservable(),wizard$:S.asObservable(),closeWizard:()=>S.next(J1),dispose:()=>{S.complete(),_.complete(),v.complete(),y.complete(),o.dispose()}}}function X1(){return typeof window>`u`?null:localStorage.getItem(`activeToolbarPanel`)||`knowledge-base`}function Z1(e){typeof window>`u`||(e?localStorage.setItem(`activeToolbarPanel`,e):localStorage.removeItem(`activeToolbarPanel`))}function Q1(){let e=Sm();return AF(()=>v1(e,{initialPanel:X1(),onPanelChange:Z1}))}function $1(e,t){let{context:n,...r}=e;return{...r,...t?{sourceLanguage:t}:{}}}function e0({resource:e,rUri:t,locale:n,Link:r,routes:i,ToolbarPanels:a,refetchDocument:o,streamStatus:s,knowledgeBaseName:c,browseRenderers:l,annotateRenderers:u}){let d=ah(`ReferenceWizard`),f=ah(`ResourceGenerate`),p=Sm(),m=Z(p.activeSession$),h=m?.client,g=RF(),{collaborators:_}=YF(h??null),v=_.find(e=>e.servesJobTypes?.includes(`generation`)),b=(0,y.useCallback)(e=>{g(`/know/resource/${e}`,{resourceId:e})},[g]),x=(0,y.useCallback)(e=>{p.emit(`panel:open`,e)},[p]),{showError:S,showSuccess:C}=Om(),{theme:w}=WF(),{showLineNumbers:T}=vm(),{hoverDelayMs:E}=LF(),{triggerSparkleAnimation:D,clearSparkle:O,sparkleAnnotationIds:k}=fI(),A=Hr(e)||`text/plain`,j=eI(_F(A)),M=j.annotateMode,ee=bi(A)?.render,N=ee===`image`||ee===`pdf`,{content:te,loading:P,error:F}=KF(h??null,t,e,!N);(0,y.useEffect)(()=>{F&&S(`Failed to load resource representation`)},[F,S]);let{token:ne,loading:re}=JF(h??null,t),ie=(N?bF(h,t,ne):void 0)??``,ae=N?ie:te,oe=N?re:P,se=Q1(),I=jF(m??void 0,e=>Y1(e,t,n,se)),L=Z(I?.annotations.value$)??[],ce=Z(I?.annotations.error$)??null,le=Z(I?.annotationGroups$),ue=Z(I?.entityTypes.value$)??[],de=Z(I?.entityTypes.error$)??null,fe=Z(I?.referencedBy.value$)??[],pe=Z(I?.referencedBy.loading$)??!0,me=Z(I?.referencedBy.error$)??null,he=Z(I?.events.value$)??[],ge=Z(I?.events.loading$)??!0,_e=Z(I?.events.error$)??null,ve=Z(I?.beckon.hoveredAnnotationId$)??null,ye=Z(I?.mark.pendingAnnotation$)??null,be=Z(I?.mark.assistingMotivation$)??null,xe=Z(I?.mark.progress$)??null,Se=Z(I?.browse.activePanel$)??null,Ce=Z(I?.browse.scrollToAnnotationId$)??null,z=Z(I?.browse.panelInitialTab$)??null,we=I?.browse.onScrollCompleted,Te=Z(I?.yield.progress$)??null,Ee=Z(I?.yield.isGenerating$)??!1,De=Z(I?.yield.outcome$)??null;W1(De,L,(0,y.useCallback)(e=>{p.emit(`panel:open`,{panel:`annotations`,scrollToAnnotationId:e,motivation:`linking`}),D(e)},[p,D]));let Oe=Z(I?.gather.context$)??null,ke=Z(I?.gather.loading$)??!1,Ae=Z(I?.gather.error$)??null,je=Z(I?.gather.resourceContext$)??null,Me=Z(I?.gather.resourceLoading$)??!1,Ne=Z(I?.gather.resourceError$)??null,Pe=Z(I?.wizard$),Fe=Pe?.open??!1,Ie=Pe?.annotationId??null,Le=Pe?.resourceId??null,Re=Pe?.defaultTitle??``,ze=Pe?.entityTypes??[],[Be,Ve]=(0,y.useState)(!1),He=(0,y.useCallback)(()=>{I?.closeWizard()},[I]),Ue=(0,y.useCallback)((t,n)=>{O(lr(t)),I?.yield.generate(n.context,$1(n,Ur(e)))},[I,O,e]),We=(0,y.useCallback)((t,n)=>{I?.yield.generate(n.context,$1(n,Ur(e)))},[I,e]),Ge=(0,y.useCallback)(async(e,n)=>{if(h)try{await h.bind.body(t,lr(e),[{op:`add`,item:{type:`SpecificResource`,source:n,purpose:`linking`}}]),C(`Reference linked successfully`)}catch(e){S(`Failed to link reference: ${e instanceof Error?e.message:String(e)}`)}},[t,h,C,S]),Ke=(0,y.useCallback)(async(e,n)=>{if(!h)throw Error(`No active session`);try{let r=`text/markdown`,i=new File([new Blob([n.content],{type:r})],n.name+Si(r),{type:r}),a=await new Promise((e,t)=>{h.yield.resource({name:n.name,file:i,format:r,entityTypes:n.entityTypes,language:n.language,storageUri:n.storagePath}).subscribe({next:t=>{t.phase===`finished`&&e(t.resourceId)},error:t})});await h.bind.body(t,lr(e),[{op:`add`,item:{type:`SpecificResource`,source:a,purpose:`linking`}}]),C(`Reference successfully linked to the new resource`)}catch(e){throw S(`Failed to compose resource: ${e instanceof Error?e.message:String(e)}`),e}},[h,t,C,S]);(0,y.useEffect)(()=>{if(e&&t){let n=Hr(e);p.addOpenResource(t,e.name,n||void 0,Wr(e)),p.setLastViewedResource(t)}},[e,t,p]),(0,y.useEffect)(()=>{ye&&p.emit(`panel:open`,{panel:`annotations`})},[ye,p]);let qe=(0,y.useCallback)(async()=>{if(h)try{await h.mark.archive(t),await o()}catch(e){console.error(`Failed to archive document:`,e),S(`Failed to archive document`)}},[h,t,o,S]),Je=(0,y.useCallback)(async()=>{if(h)try{await h.mark.unarchive(t),await o()}catch(e){console.error(`Failed to unarchive document:`,e),S(`Failed to unarchive document`)}},[h,t,o,S]),Ye=(0,y.useCallback)(async()=>{if(h)try{let e=(await h.yield.cloneToken(t)).token;p.emit(`nav:push`,{path:`/know/compose?mode=clone&token=${e}`,reason:`clone`})}catch(e){console.error(`Failed to generate clone token:`,e),S(`Failed to generate clone link`)}},[h,t,S,p]),Xe=(0,y.useCallback)(({annotationId:e})=>{D(e)},[D]),Ze=(0,y.useCallback)(e=>{D(e.payload.annotation.id)},[D]),Qe=(0,y.useCallback)(e=>{e.payload.operations.some(e=>e.op===`add`&&e.item.type===`SpecificResource`&&e.item.purpose===`linking`)&&D(e.payload.annotationId)},[D]),$e=(0,y.useCallback)(({resourceId:e})=>{if(i.resourceDetail){let t=i.resourceDetail(e);p.emit(`nav:push`,{path:t,reason:`reference-link`})}},[i.resourceDetail,p]),et=(0,y.useCallback)(({entityType:e})=>{if(i.know){let t=`${i.know}?entityType=${encodeURIComponent(e)}`;p.emit(`nav:push`,{path:t,reason:`entity-type-filter`})}},[i.know,p]);U1(t),rI({"mark:archive":qe,"mark:unarchive":Je,"yield:clone":Ye,"beckon:sparkle":Xe,"mark:added":Ze,"mark:body-updated":Qe,"browse:resource-open":$e,"browse:entity-type-clicked":et});let{announceResourceLoading:tt,announceResourceLoaded:nt}=sI();(0,y.useEffect)(()=>{oe?tt(e.name):ae&&nt(e.name)},[oe,ae,e.name,tt,nt]),B1(t,!oe&&!!ae);let rt=e.entityTypes||[],it=Vr(e),at=it?.mediaType,ot=it?.byteSize,st={...e,content:ae},ct=(0,y.useCallback)(e=>{e&&m?.client.beckon.sparkle(lr(e))},[m]),lt=(0,y.useCallback)(e=>{e&&I?.beckon.focus(lr(e))},[I]);return(0,R.jsxs)(`div`,{className:`semiont-document-viewer${Se?` semiont-document-viewer--panel-open`:``}`,children:[(0,R.jsxs)(`div`,{className:`semiont-document-viewer__main`,children:[(0,R.jsxs)(`div`,{className:`semiont-document-viewer__content`,children:[(0,R.jsx)(`div`,{className:`semiont-document-viewer__header`,children:(0,R.jsx)(`div`,{className:`semiont-document-viewer__header-inner`,children:(0,R.jsx)(`h2`,{className:`semiont-document-viewer__title`,children:e.name})})}),(0,R.jsx)(`div`,{className:`semiont-document-viewer__scrollable-body`,lang:Ur(e)||void 0,children:(0,R.jsx)(jU,{fallback:(e,t)=>(0,R.jsxs)(`div`,{className:`semiont-document-viewer__error`,children:[(0,R.jsx)(`h3`,{className:`semiont-document-viewer__error-title`,children:`Error loading document viewer`}),(0,R.jsx)(`p`,{className:`semiont-document-viewer__error-message`,children:e.message}),(0,R.jsx)(`button`,{onClick:t,className:`semiont-document-viewer__error-button`,children:`Try again`})]}),children:oe?(0,R.jsx)(`div`,{className:`semiont-document-viewer__loading`,children:`Loading document content...`}):(0,R.jsx)(KJ,{resource:st,annotations:le??{highlights:[],comments:[],assessments:[],references:[],tags:[]},session:m??null,onOpenResource:b,onOpenPanel:x,annotateMode:j.annotateMode,onAnnotateModeChange:j.setAnnotateMode,clickAction:j.clickAction,onClickActionChange:j.setClickAction,selectionMotivation:j.selectionMotivation,onSelectionMotivationChange:j.setSelectionMotivation,shape:j.shape,onShapeChange:j.setShape,sparkleAnnotationIds:k,generatingReferenceId:Te?.annotationId??null,showLineNumbers:T,hoverDelayMs:E,hoveredAnnotationId:ve,...l&&{browseRenderers:l},...u&&{annotateRenderers:u}})})})]}),(0,R.jsxs)(`div`,{className:`semiont-document-viewer__sidebar`,children:[(0,R.jsxs)(a,{activePanel:Se,theme:w,width:Se===`jsonld`?`w-[600px]`:Se===`annotations`?`w-[400px]`:`w-64`,children:[M&&e.archived&&(0,R.jsx)(`div`,{className:`semiont-document-viewer__archived-status`,children:(0,R.jsx)(`div`,{className:`semiont-document-viewer__archived-text`,children:`📦 Archived`})}),Se===`annotations`&&!e.archived&&(0,R.jsx)(NY,{session:m??null,onOpenResource:b,annotations:L,annotators:rT,annotateMode:M,assistingMotivation:be,progress:xe,pendingAnnotation:ye,allEntityTypes:ue,annotationsError:ce,onRetryAnnotations:I?.annotations.retry,entityTypesError:de,generatingReferenceId:Te?.annotationId??null,sparkleAnnotationIds:k,referencedBy:fe,referencedByLoading:pe,referencedByError:me,onRetryReferencedBy:I?.referencedBy.retry,resourceId:t,locale:n,sourceLanguage:Ur(e),scrollToAnnotationId:Ce,hoveredAnnotationId:ve,onScrollCompleted:we,initialTab:z?.tab,initialTabGeneration:z?.generation,Link:r,routes:i}),Se===`history`&&(0,R.jsx)(LJ,{events:he,eventsLoading:ge,eventsError:_e,onRetryEvents:I?.events.retry,annotations:L,hoveredAnnotationId:ve,onEventHover:ct,onEventClick:lt,Link:r,routes:i}),Se===`info`&&(0,R.jsx)(EY,{session:m??null,resourceId:t,documentEntityTypes:rt,documentLocale:Ur(e),primaryMediaType:at,primaryByteSize:ot,storageUri:Wr(e),isArchived:e.archived??!1,dateCreated:e.dateCreated,dateModified:e.dateModified,wasAttributedTo:e.wasAttributedTo,wasDerivedFrom:e.wasDerivedFrom,generator:e.generator,onGenerate:()=>Ve(!0),isGenerating:Ee,generationProgress:Te&&!Te.annotationId?Te:null,generationOutcome:De,onDismissProgress:()=>I?.yield.dismissProgress()}),Se===`collaboration`&&(0,R.jsx)(lY,{state:s,eventCount:0,knowledgeBaseName:c,collaborators:_}),Se===`jsonld`&&(0,R.jsx)(vY,{resourceId:t})]}),(0,R.jsx)(IU,{context:`document`,activePanel:Se,isArchived:e.archived??!1})]})]}),(0,R.jsx)(y$,{...v?{generationAgent:v}:{},isOpen:Fe,onClose:He,annotationId:Ie,resourceId:Le,defaultTitle:Re,defaultFolder:Mi(Wr(e)),entityTypes:ze,resourceName:e.name,locale:n,context:Oe,contextLoading:ke,contextError:Ae,onGenerateSubmit:Ue,onLinkResource:Ge,onComposeSubmit:Ke,entityTypeOptions:ue,hoverDelayMs:E,translations:{resolveTitle:d(`resolveTitle`),sourceContextLabel:d(`sourceContextLabel`),connectionsLabel:d(`connectionsLabel`),citedByLabel:d(`citedByLabel`),userHintLabel:d(`userHintLabel`),userHintEffect:d(`userHintEffect`),userHintPlaceholder:d(`userHintPlaceholder`),graphPaneTitle:d(`graphPaneTitle`),graphEmpty:d(`graphEmpty`),resourceLinkLabel:d(`resourceLinkLabel`),corpusPaneTitle:d(`corpusPaneTitle`),corpusEmpty:d(`corpusEmpty`),excludedReceipt:d(`excludedReceipt`),machineRead:d(`machineRead`),loadingContext:d(`loadingContext`),failedContext:d(`failedContext`),search:d(`search`),searching:d(`searching`),generate:d(`generate`),compose:d(`compose`),resolutionStrategyLabel:d(`resolutionStrategyLabel`),back:d(`back`),link:d(`link`),score:d(`score`),noResults:d(`noResults`),resourceTitle:d(`resourceTitle`),resourceTitlePlaceholder:d(`resourceTitlePlaceholder`),saveLocation:d(`saveLocation`),additionalInstructions:d(`additionalInstructions`),additionalInstructionsPlaceholder:d(`additionalInstructionsPlaceholder`),language:d(`language`),languageHelp:d(`languageHelp`),creativity:d(`creativity`),creativityFocused:d(`creativityFocused`),creativityCreative:d(`creativityCreative`),maxLength:d(`maxLength`),maxLengthHelp:d(`maxLengthHelp`),maxLengthCeiling:d(`maxLengthCeiling`),outputFormat:d(`outputFormat`),formatExtensionMismatch:d(`formatExtensionMismatch`),maxResults:d(`maxResults`),semanticScoring:d(`semanticScoring`),semanticScoringHelp:d(`semanticScoringHelp`),searchFailed:d(`searchFailed`),entityTypes:d(`entityTypes`),contentLabel:d(`contentLabel`),createAndLink:d(`createAndLink`),creatingAndLinking:d(`creatingAndLinking`),discardDraftPrompt:d(`discardDraftPrompt`),discardDraft:d(`discardDraft`),keepEditing:d(`keepEditing`)}}),(0,R.jsx)(x$,{...v?{generationAgent:v}:{},isOpen:Be,onClose:()=>Ve(!1),resourceId:t,defaultTitle:e.name,defaultFolder:Mi(Wr(e)),locale:n,entityTypeOptions:ue,onGenerateSubmit:We,gatherContext:je,gatherLoading:Me,gatherError:Ne,onGather:e=>I?.gather.gatherResource(t,e),translations:{title:f(`title`),gatherIntro:f(`gatherIntro`),includeContent:f(`includeContent`),includeSummary:f(`includeSummary`),gatherDepth:f(`gatherDepth`),gatherMaxResources:f(`gatherMaxResources`),gatherButton:f(`gatherButton`),editGather:f(`editGather`),recallLabel:f(`recallLabel`),loadingContext:f(`loadingContext`),failedContext:f(`failedContext`),sourceContextLabel:f(`sourceContextLabel`),connectionsLabel:f(`connectionsLabel`),citedByLabel:f(`citedByLabel`),graphPaneTitle:f(`graphPaneTitle`),graphEmpty:f(`graphEmpty`),resourceLinkLabel:f(`resourceLinkLabel`),corpusPaneTitle:f(`corpusPaneTitle`),corpusEmpty:f(`corpusEmpty`),excludedReceipt:f(`excludedReceipt`),machineRead:f(`machineRead`),score:f(`score`),resourceTitle:f(`resourceTitle`),resourceTitlePlaceholder:f(`resourceTitlePlaceholder`),saveLocation:f(`saveLocation`),additionalInstructions:f(`additionalInstructions`),additionalInstructionsPlaceholder:f(`additionalInstructionsPlaceholder`),language:f(`language`),languageHelp:f(`languageHelp`),creativity:f(`creativity`),creativityFocused:f(`creativityFocused`),creativityCreative:f(`creativityCreative`),maxLength:f(`maxLength`),maxLengthHelp:f(`maxLengthHelp`),maxLengthCeiling:f(`maxLengthCeiling`),outputFormat:f(`outputFormat`),formatExtensionMismatch:f(`formatExtensionMismatch`),generate:f(`generate`),discardDraftPrompt:f(`discardDraftPrompt`),discardDraft:f(`discardDraft`),keepEditing:f(`keepEditing`)}})]})}var t0=Te(hm(),1);function n0(e){let{client:t}=e,n=new t0.BehaviorSubject(!1);return{isLoggingOut$:n.asObservable(),logout:async()=>{n.next(!0);try{await t.auth.logout()}catch{}finally{n.next(!1)}},dispose:()=>{n.complete()}}}var r0=Te(hm(),1);function i0(e,t,n,r){let{client:i}=e,a=Kl(),o=n.mode===`clone`&&!!n.token,s=o?`clone`:`new`,c=new r0.BehaviorSubject(s),l=new r0.BehaviorSubject(!0),u=new r0.BehaviorSubject(null),d=new r0.BehaviorSubject(null),f=q1(()=>i.browse.entityTypes(),[]);return a.add(f.dispose),o?(async()=>{try{let e=await i.yield.fromToken(n.token);if(e&&r){let t=cr(e[`@id`]),{data:n,contentType:r}=await i.browse.resourceRepresentation(t),a=pi(n,r);u.next({sourceResource:e,sourceContent:a})}}catch{}l.next(!1)})():l.next(!1),{browse:t,mode$:c.asObservable(),loading$:l.asObservable(),cloneData$:u.asObservable(),entityTypes:f.state,uploadProgress$:d.asObservable(),save:async e=>{if(e.mode===`clone`)return(await i.yield.createFromToken({token:n.token,name:e.name,content:e.content,archiveOriginal:e.archiveOriginal??!0})).resourceId;let t,r;if(e.file)t=e.file,r=e.format??`application/octet-stream`;else{let n=new Blob([e.content||``],{type:e.format??`application/octet-stream`}),i=Si(e.format??`application/octet-stream`);t=new File([n],e.name+i,{type:e.format??`application/octet-stream`}),r=e.format??`application/octet-stream`}let a=e.charset&&!e.file?`${r}; charset=${e.charset}`:r;return await new Promise((n,r)=>{i.yield.resource({name:e.name,file:t,format:a,entityTypes:e.entityTypes||[],language:e.language,storageUri:e.storageUri}).subscribe({next:e=>{d.next(e),e.phase===`finished`&&n(e.resourceId)},error:e=>{d.next(null),r(e)},complete:()=>d.next(null)})})},dispose:()=>{c.complete(),l.complete(),u.complete(),d.complete(),a.dispose()}}}var a0=Te(hm(),1);function o0(e,t){let{client:n}=e,r=new a0.BehaviorSubject(void 0),i=new a0.BehaviorSubject(null),a=null,o=!1,s=()=>{o||(a?.unsubscribe(),a=n.browse.resource(t).subscribe(e=>{if(e.status===`failed`){i.next(e.error);return}e.status===`ready`&&i.getValue()!==null&&i.next(null),r.next(Wc(e))}))};s();let c=(0,a0.combineLatest)([r,i]).pipe((0,a0.map)(([e,t])=>e===void 0&&t===null),(0,a0.distinctUntilChanged)());return{resource$:r.asObservable(),isLoading$:c,error$:i.asObservable(),invalidate:()=>{o||(i.next(null),n.browse.invalidateResourceDetail(t),s())},dispose:()=>{o||(o=!0,a?.unsubscribe(),a=null,r.complete(),i.complete())}}}var s0=Te(hm(),1);function c0(e,t){let{client:n}=e,r=Kl(),i=new s0.BehaviorSubject([]),a=new s0.BehaviorSubject(null),o=new s0.BehaviorSubject(!0),s=new s0.BehaviorSubject(!0),c=()=>{o.next(!0),n.admin.users().then(e=>{i.next(e.users??[]),o.next(!1)}).catch(()=>o.next(!1))},l=()=>{s.next(!0),n.admin.userStats().then(e=>{a.next(e.stats??null),s.next(!1)}).catch(()=>s.next(!1))};return c(),l(),{browse:t,users$:i.asObservable(),stats$:a.asObservable(),usersLoading$:o.asObservable(),statsLoading$:s.asObservable(),updateUser:async(e,t)=>{await n.admin.updateUser(Gn(e),t),c(),l()},dispose:()=>{i.complete(),a.complete(),o.complete(),s.complete(),r.dispose()}}}var l0=Te(hm(),1);function u0(e,t){let{client:n}=e,r=Kl(),i=new l0.BehaviorSubject([]),a=new l0.BehaviorSubject([]),o=new l0.BehaviorSubject(!0);return n.admin.oauthConfig().then(e=>{let t=e;i.next(t.providers??[]),a.next(t.allowedDomains??[]),o.next(!1)}).catch(()=>o.next(!1)),{browse:t,providers$:i.asObservable(),allowedDomains$:a.asObservable(),isLoading$:o.asObservable(),dispose:()=>{i.complete(),a.complete(),o.complete(),r.dispose()}}}var d0=Te(hm(),1);function f0(e){let{client:t}=e,n=Kl(),r=new d0.BehaviorSubject(null),i=new d0.BehaviorSubject(!1);return t.auth.me().then(e=>r.next(e)).catch(()=>{}),{userData$:r.asObservable(),isProcessing$:i.asObservable(),acceptTerms:async()=>{i.next(!0);try{await t.auth.acceptTerms(),r.next({...r.getValue(),termsAcceptedAt:new Date().toISOString()})}finally{i.next(!1)}},dispose:()=>{r.complete(),i.complete(),n.dispose()}}}var p0=Te(hm(),1),m0=Te(nT(),1),h0=10,g0=20,_0=250;function v0(e,t){let{client:n}=e,r=Kl(),i=new p0.BehaviorSubject(``);r.add(()=>i.complete());let a=new p0.Subject;r.add(()=>a.complete());let o=q1(()=>i.pipe((0,m0.switchMap)(e=>n.browse.resources({limit:h0,archived:!1,...e?{entityType:e}:{}}).pipe((0,m0.map)(e=>e.status===`ready`?{status:`ready`,value:e.value.resources}:e)))),[]);r.add(o.dispose);let s=q1(()=>n.browse.entityTypes(),[]);r.add(s.dispose);let c=a.pipe((0,m0.startWith)(``),(0,m0.debounceTime)(_0),(0,m0.distinctUntilChanged)()),l=(0,p0.combineLatest)([c,i]).pipe((0,m0.switchMap)(([e,t])=>{let r=e.trim();return r?n.browse.resources({search:r,limit:g0,...t?{entityType:t}:{}}).pipe((0,m0.map)(e=>{let t=Wc(e);return{results:t?.resources??[],isSearching:e.status===`pending`,...t?{matchKind:t.matchKind}:{}}}),(0,m0.startWith)({results:[],isSearching:!0})):(0,p0.of)({results:[],isSearching:!1})}),(0,m0.shareReplay)({bufferSize:1,refCount:!0}));return{browse:t,search:{query$:a.pipe((0,m0.startWith)(``)),state$:l,setQuery:e=>a.next(e)},recent:o.state,entityTypes:s.state,selectedEntityType$:i.asObservable(),setSelectedEntityType:e=>i.next(e),dispose:()=>r.dispose()}}var y0=Te(hm(),1);function b0(e,t){let{client:n}=e,r=Kl(),i=new y0.BehaviorSubject(``),a=new y0.BehaviorSubject(``),o=new y0.BehaviorSubject(!1),s=q1(()=>n.browse.entityTypes(),[]);return r.add(s.dispose),{browse:t,entityTypes:s.state,newTag$:i.asObservable(),error$:a.asObservable(),isAdding$:o.asObservable(),setNewTag:e=>i.next(e),addTag:async()=>{let e=i.getValue().trim();if(e){a.next(``),o.next(!0);try{await n.frame.addEntityType(e),i.next(``)}catch(e){a.next(e instanceof Error?e.message:`Failed to add entity type`)}finally{o.next(!1)}}},dispose:()=>{i.complete(),a.complete(),o.complete(),r.dispose()}}}function x0({children:e}){let t=v();return(0,R.jsxs)(NU,{resetKeys:[t.pathname],children:[(0,R.jsx)(mJ,{}),(0,R.jsx)(pJ,{}),e]})}var S0=y.lazy(()=>s(()=>import(`./layout-3T2CwuLU.js`),__vite__mapDeps([5,2,3,1,6,7]))),C0=y.lazy(()=>s(()=>import(`./page-DLiS_avb.js`),__vite__mapDeps([8,2,3,1,7]))),w0=y.lazy(()=>s(()=>import(`./page-bR7KMw9p.js`),__vite__mapDeps([9,2,3,1,6,7,10,11,12]))),T0=y.lazy(()=>s(()=>import(`./page-OhVx5cMH.js`),__vite__mapDeps([13,2,3,1,6,7,10,11,12]))),E0=y.lazy(()=>s(()=>import(`./page-CywSuXyN.js`),__vite__mapDeps([14,2,3,1,6,7,10,11,12]))),D0=y.lazy(()=>s(()=>import(`./page-Bk2UhTqA.js`),__vite__mapDeps([15,2,3,7,1]))),O0=y.lazy(()=>s(()=>import(`./page-DYqW4iWr.js`),__vite__mapDeps([16,2,3,1,6,7,10,11,12]))),k0=y.lazy(()=>s(()=>import(`./page-BNXN9uWs.js`),__vite__mapDeps([17,2,3,1,6,7,10,11,12]))),A0=y.lazy(()=>s(()=>import(`./page-DYcAqNIR.js`),__vite__mapDeps([18,2,3,1,7]))),j0=y.lazy(()=>s(()=>import(`./layout-DSvS5iO0.js`),__vite__mapDeps([19,2,3,1,6,7,10,11,20,21,12]))),M0=y.lazy(()=>s(()=>import(`./page-Ct7GNMjQ.js`),__vite__mapDeps([22,2,3,1,7]))),N0=y.lazy(()=>s(()=>import(`./page-BhPjX09z.js`),__vite__mapDeps([23,3,2,1,20,11,7]))),P0=y.lazy(()=>s(()=>import(`./page-DS47DLy5.js`),__vite__mapDeps([24,2,3,1,20,11,7]))),F0=y.lazy(()=>s(()=>import(`./page-DwyBQfbg.js`),__vite__mapDeps([25,2,3,1,20,11,7,12,26]))),I0=y.lazy(()=>s(()=>import(`./layout-CGq5doN0.js`),__vite__mapDeps([27,2,3,1,6,7,10,11,21,28,12]))),L0=y.lazy(()=>s(()=>import(`./page-De7BG-0h.js`),__vite__mapDeps([29,1,2,3,7]))),R0=y.lazy(()=>s(()=>import(`./client-CXKycZZZ.js`),__vite__mapDeps([30,2,3,1,20,11,7]))),z0=y.lazy(()=>s(()=>import(`./client-CiXdSyqF.js`),__vite__mapDeps([31,3,2,1,20,11,7]))),B0=y.lazy(()=>s(()=>import(`./page-D-_kPKxI.js`),__vite__mapDeps([32,2,3,1,20,11,7,28]))),V0=y.lazy(()=>s(()=>import(`./layout-B4A7CIsE.js`),__vite__mapDeps([33,2,3,1,6,7,10,11,21,12]))),H0=y.lazy(()=>s(()=>import(`./page-XISoI7Ji.js`),__vite__mapDeps([34,2,3,1,7]))),U0=y.lazy(()=>s(()=>import(`./page-BfbTxteF.js`),__vite__mapDeps([35,3,2,1,20,11,7]))),W0=y.lazy(()=>s(()=>import(`./page-BWTL-Lea.js`),__vite__mapDeps([36,3,2,1,20,11,7]))),G0=y.lazy(()=>s(()=>import(`./page-CJnENX8F.js`),__vite__mapDeps([37,2,3,1,20,11,7]))),K0=y.lazy(()=>s(()=>import(`./not-found-k9OeYO0z.js`),__vite__mapDeps([26,3,2,1,7])));function q0({children:e}){let{locale:t}=u(),{i18n:n}=o();return(0,y.useEffect)(()=>{if(!t)return;let e=le(t)?t:`en`;n.language!==e&&n.changeLanguage(e)},[t,n]),!t||!le(t)?(0,R.jsx)(m,{to:`/en`,replace:!0}):(0,R.jsx)(R.Fragment,{children:e})}function J0(){return(0,R.jsx)(x0,{children:(0,R.jsx)(g,{})})}function Y0(){let e=l();return(0,y.useEffect)(()=>{let t=navigator.language.split(`-`)[0]??`en`,n=le(t)?t:`en`;e(`/${n}`,{replace:!0})},[e]),null}function X0(){return(0,R.jsx)(y.Suspense,{fallback:null,children:(0,R.jsxs)(d,{children:[(0,R.jsx)(c,{path:`/`,element:(0,R.jsx)(Y0,{})}),(0,R.jsxs)(c,{path:`/:locale`,element:(0,R.jsx)(q0,{children:(0,R.jsx)(S0,{})}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(C0,{})}),(0,R.jsx)(c,{path:`about`,element:(0,R.jsx)(w0,{})}),(0,R.jsx)(c,{path:`privacy`,element:(0,R.jsx)(T0,{})}),(0,R.jsx)(c,{path:`terms`,element:(0,R.jsx)(E0,{})}),(0,R.jsx)(c,{path:`auth/connect`,element:(0,R.jsx)(D0,{})}),(0,R.jsx)(c,{path:`auth/signup`,element:(0,R.jsx)(O0,{})}),(0,R.jsx)(c,{path:`auth/error`,element:(0,R.jsx)(k0,{})}),(0,R.jsxs)(c,{element:(0,R.jsx)(J0,{}),children:[(0,R.jsx)(c,{path:`auth/welcome`,element:(0,R.jsx)(A0,{})}),(0,R.jsxs)(c,{path:`know`,element:(0,R.jsx)(j0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(M0,{})}),(0,R.jsx)(c,{path:`discover`,element:(0,R.jsx)(N0,{})}),(0,R.jsx)(c,{path:`compose`,element:(0,R.jsx)(P0,{})}),(0,R.jsx)(c,{path:`resource/:id`,element:(0,R.jsx)(F0,{})})]}),(0,R.jsxs)(c,{path:`admin`,element:(0,R.jsx)(I0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(L0,{})}),(0,R.jsx)(c,{path:`users`,element:(0,R.jsx)(R0,{})}),(0,R.jsx)(c,{path:`security`,element:(0,R.jsx)(z0,{})}),(0,R.jsx)(c,{path:`devops`,element:(0,R.jsx)(B0,{})})]}),(0,R.jsxs)(c,{path:`moderate`,element:(0,R.jsx)(V0,{}),children:[(0,R.jsx)(c,{index:!0,element:(0,R.jsx)(H0,{})}),(0,R.jsx)(c,{path:`recent`,element:(0,R.jsx)(U0,{})}),(0,R.jsx)(c,{path:`entity-tags`,element:(0,R.jsx)(W0,{})}),(0,R.jsx)(c,{path:`tag-schemas`,element:(0,R.jsx)(G0,{})})]})]}),(0,R.jsx)(c,{path:`*`,element:(0,R.jsx)(K0,{})})]}),(0,R.jsx)(c,{path:`*`,element:(0,R.jsx)(m,{to:`/en`,replace:!0})})]})})}de(`/assets/pdf.worker.min-CHFwMXne.mjs`);var Z0={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_OTEL_OTLP_ENDPOINT;Z0&&s(async()=>{let{initObservabilityWeb:e}=await import(`./web-DWjmWGs5.js`);return{initObservabilityWeb:e}},[]).then(({initObservabilityWeb:e})=>{e({serviceName:`semiont-browser`,otlpEndpoint:Z0})});var Q0=document.getElementById(`root`);if(!Q0)throw Error(`Root element not found`);b.createRoot(Q0).render((0,R.jsx)(y.StrictMode,{children:(0,R.jsx)(p,{children:(0,R.jsx)(X0,{})})}));export{Q1 as $,Fr as $t,UF as A,Sm as At,n0 as B,lc as Bt,k$ as C,jm as Ct,D$ as D,xm as Dt,IY as E,_m as Et,c0 as F,Uc as Ft,rI as G,Rs as Gt,MF as H,Xs as Ht,i0 as I,Ml as It,PF as J,ys as Jt,LF as K,Ds as Kt,v0 as L,Ic as Lt,D1 as M,Yl as Mt,aT as N,ml as Nt,O$ as O,Dm as Ot,u0 as P,Al as Pt,jF as Q,qo as Qt,b0 as R,Fc as Rt,E$ as S,Rm as St,w1 as T,Zm as Tt,kF as U,Ys as Ut,f0 as V,Zs as Vt,FF as W,Bs as Wt,zF as X,$o as Xt,Z as Y,es as Yt,VF as Z,Qo as Zt,L1 as _,Jm as _t,_1 as a,Ir as an,Pm as at,P$ as b,Km as bt,O1 as c,wt as cn,Nm as ct,j$ as d,ge as dn,Im as dt,Mr as en,WF as et,oI as f,le as fn,Hm as ft,dI as g,Vm as gt,FU as h,Ym as ht,E1 as i,cr as in,qm as it,IU as j,Om as jt,M1 as k,vm as kt,PY as l,me as ln,Wm as lt,k1 as m,Am as mt,b1 as n,Pr as nn,ah as nt,a$ as o,Un as on,Lm as ot,M$ as p,Xm as pt,tI as q,Es as qt,S1 as r,Nr as rn,Um as rt,N$ as s,qn as sn,km as st,y1 as t,xr as tn,ih as tt,fJ as u,he as un,Fm as ut,z1 as v,Mm as vt,LU as w,zm as wt,e0 as x,Bm as xt,F$ as y,Gm as yt,o0 as z,dc as zt};
142
+ //# sourceMappingURL=index-cHWd4mGO.js.map