sessiongraph 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  </h1>
5
5
  <p align="center">Explore &amp; visualize all your LLM sessions</p>
6
6
  <p align="center">
7
+ <a href="https://sessiongraph.ai">Website</a> ·
7
8
  <a href="https://github.com/arvindell/sessiongraph/releases/latest">Download</a> ·
8
9
  <a href="docs/guide.md">Documentation</a> ·
9
10
  <a href="PRIVACY.md">Privacy</a> ·
@@ -1 +1 @@
1
- import{j as i}from"./index-Dm6VCxBu.js";function r(e){if(e!==void 0){if(typeof e=="string")return e;if("ok"in e&&"cancel"in e)return{OkCancelCustom:[e.ok,e.cancel]};if("yes"in e&&"no"in e&&"cancel"in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if("ok"in e)return{OkCustom:e.ok}}}async function f(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|open",{options:e})}async function k(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|save",{options:e})}async function l(e,a){return await i("plugin:dialog|message",{message:e,title:a?.title,kind:a?.kind,buttons:r(a?.buttons)})}async function s(e,a){const n=typeof a=="string"?{title:a}:a;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),l(e,n)}async function u(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Yes";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"No"}:"YesNo"})===t}async function d(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Ok";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"Cancel"}:"OkCancel"})===t}export{u as ask,d as confirm,s as message,f as open,k as save};
1
+ import{j as i}from"./index-DCSeQKMi.js";function r(e){if(e!==void 0){if(typeof e=="string")return e;if("ok"in e&&"cancel"in e)return{OkCancelCustom:[e.ok,e.cancel]};if("yes"in e&&"no"in e&&"cancel"in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if("ok"in e)return{OkCustom:e.ok}}}async function f(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|open",{options:e})}async function k(e={}){return typeof e=="object"&&Object.freeze(e),await i("plugin:dialog|save",{options:e})}async function l(e,a){return await i("plugin:dialog|message",{message:e,title:a?.title,kind:a?.kind,buttons:r(a?.buttons)})}async function s(e,a){const n=typeof a=="string"?{title:a}:a;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),l(e,n)}async function u(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Yes";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"No"}:"YesNo"})===t}async function d(e,a){const n=typeof a=="string"?{title:a}:a,c=n?.okLabel||n?.cancelLabel,t=n?.okLabel??"Ok";return await l(e,{title:n?.title,kind:n?.kind,buttons:c?{ok:t,cancel:n.cancelLabel??"Cancel"}:"OkCancel"})===t}export{u as ask,d as confirm,s as message,f as open,k as save};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-viewer-B3t-LR4T.js","assets/scene-CnihjOu5.js","assets/three-DDiuFd7k.js","assets/public-viewer-CyDoUT6s.css","assets/share-BWJVjZdG.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-viewer-DVqMq2gi.js","assets/scene-B94ITHcm.js","assets/three-DDiuFd7k.js","assets/public-viewer-CyDoUT6s.css","assets/share-DnZuWOzh.js"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();const Ed="modulepreload",Sd=function(e){return"/"+e},Yi={},br=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let c=function(l){return Promise.all(l.map(f=>Promise.resolve(f).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=i?.nonce||i?.getAttribute("nonce");r=c(n.map(l=>{if(l=Sd(l),l in Yi)return;Yi[l]=!0;const f=l.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":Ed,f||(g.as="script"),g.crossOrigin="",g.href=l,a&&g.setAttribute("nonce",a),document.head.appendChild(g),f)return new Promise((p,h)=>{g.addEventListener("load",p),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},xd=[["path",{d:"M12 5.75C12 3.75 13.5 1.75 15.5 1.75C15.5 3.75 14 5.75 12 5.75Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.5 8.09001C11.9851 8.09001 11.5867 7.92646 11.1414 7.74368C10.5776 7.51225 9.93875 7.25 8.89334 7.25C7.02235 7.25 4 8.74945 4 12.7495C4 17.4016 7.10471 22.25 9.10471 22.25C9.77426 22.25 10.3775 21.9871 10.954 21.7359C11.4815 21.5059 11.9868 21.2857 12.5 21.2857C13.0132 21.2857 13.5185 21.5059 14.046 21.7359C14.6225 21.9871 15.2257 22.25 15.8953 22.25C17.2879 22.25 18.9573 19.8992 20 16.9008C18.3793 16.2202 17.338 14.618 17.338 12.75C17.338 11.121 18.2036 10.0398 19.5 9.25C18.5 7.75 17.0134 7.25 15.9447 7.25C14.8993 7.25 14.2604 7.51225 13.6966 7.74368C13.2514 7.92646 13.0149 8.09001 12.5 8.09001Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],$d=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ld=[["path",{d:"M12 16V3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6 21H18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M7 12C7 12 10.6824 17 12 17C13.3176 17 17 12 17 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Id=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Td=[["path",{d:"M5.5 12.002H19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Md=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ad=[["path",{d:"M18.5 12L4.99997 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 18C13 18 19 13.5811 19 12C19 10.4188 13 6 13 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Od=[["path",{d:"M9 6.65032C9 6.65032 15.9383 6.10759 16.9154 7.08463C17.8924 8.06167 17.3496 15 17.3496 15M16.5 7.5L6.5 17.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Pd=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],Rd=[["path",{d:"M16 2V6M8 2V6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 10H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M12.1258 14H12.0008M12.1258 18H12.0008M7.625 14H7.5M7.625 18H7.5M16.625 14H16.5M12.2508 14C12.2508 14.1381 12.1389 14.25 12.0008 14.25C11.8628 14.25 11.7508 14.1381 11.7508 14C11.7508 13.8619 11.8628 13.75 12.0008 13.75C12.1389 13.75 12.2508 13.8619 12.2508 14ZM12.2508 18C12.2508 18.1381 12.1389 18.25 12.0008 18.25C11.8628 18.25 11.7508 18.1381 11.7508 18C11.7508 17.8619 11.8628 17.75 12.0008 17.75C12.1389 17.75 12.2508 17.8619 12.2508 18ZM7.75 14C7.75 14.1381 7.63807 14.25 7.5 14.25C7.36193 14.25 7.25 14.1381 7.25 14C7.25 13.8619 7.36193 13.75 7.5 13.75C7.63807 13.75 7.75 13.8619 7.75 14ZM7.75 18C7.75 18.1381 7.63807 18.25 7.5 18.25C7.36193 18.25 7.25 18.1381 7.25 18C7.25 17.8619 7.36193 17.75 7.5 17.75C7.63807 17.75 7.75 17.8619 7.75 18ZM16.75 14C16.75 14.1381 16.6381 14.25 16.5 14.25C16.3619 14.25 16.25 14.1381 16.25 14C16.25 13.8619 16.3619 13.75 16.5 13.75C16.6381 13.75 16.75 13.8619 16.75 14Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],Dd=[["path",{d:"M18.9991 19L5 5.00098",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 5L5.00092 18.999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Vd=[["path",{d:"M9.13432 2.5C6.46805 2.56075 4.9107 2.81456 3.84664 3.87493C2.91537 4.80297 2.60406 6.10756 2.5 8.2M14.8657 2.5C17.532 2.56075 19.0893 2.81456 20.1534 3.87493C21.0846 4.80297 21.3959 6.10756 21.5 8.2M14.8657 21.5C17.532 21.4392 19.0893 21.1854 20.1534 20.1251C21.0846 19.197 21.3959 17.8924 21.5 15.8M9.13432 21.5C6.46805 21.4392 4.9107 21.1854 3.84664 20.1251C2.91537 19.197 2.60406 17.8924 2.5 15.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Nd=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12L14 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Fd=[["ellipse",{cx:"15.5",cy:"11",rx:"6.5",ry:"2",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M22 15.5C22 16.6046 19.0899 17.5 15.5 17.5C11.9101 17.5 9 16.6046 9 15.5",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M22 11V19.8C22 21.015 19.0899 22 15.5 22C11.9101 22 9 21.015 9 19.8V11",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["ellipse",{cx:"8.5",cy:"4",rx:"6.5",ry:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M6 11C4.10819 10.7698 2.36991 10.1745 2 9M6 16C4.10819 15.7698 2.36991 15.1745 2 14",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M6 21C4.10819 20.7698 2.36991 20.1745 2 19V4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M15 6V4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}]],Hd=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Wd=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],jd=[["path",{d:"M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 2V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14.5 2V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M9.5 20V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14.5 20V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M13 9L9 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M15 13L13 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M22 14.5L20 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"7"}],["path",{d:"M4 9.5L2 9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"8"}],["path",{d:"M4 14.5L2 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"9"}],["path",{d:"M22 9.5L20 9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"10"}]],_d=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 7.5L17 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M7.125 7.5H7M7.25 7.5C7.25 7.63807 7.13807 7.75 7 7.75C6.86193 7.75 6.75 7.63807 6.75 7.5C6.75 7.36193 6.86193 7.25 7 7.25C7.13807 7.25 7.25 7.36193 7.25 7.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 16.5L17 16.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.125 16.5H7M7.25 16.5C7.25 16.6381 7.13807 16.75 7 16.75C6.86193 16.75 6.75 16.6381 6.75 16.5C6.75 16.3619 6.86193 16.25 7 16.25C7.13807 16.25 7.25 16.3619 7.25 16.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],Bd=[["path",{d:"M6 15.5C6 17.433 7.567 19 9.5 19H14.5C16.433 19 18 17.433 18 15.5C18 13.567 16.433 12 14.5 12H9.5C7.567 12 6 10.433 6 8.5C6 6.567 7.567 5 9.5 5H14.5C16.433 5 18 6.567 18 8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 2.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Ud=[["path",{d:"M10 18C10 18 7.50004 16.1588 7.50003 15.5C7.50003 14.8412 10 13 10 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 18C14 18 16.5 16.1588 16.5 15.5C16.5 14.8412 14 13 14 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],qd=[["path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Gd=[["path",{d:"M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Yd=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],Kd=[["circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 12H3M15 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Zd=[["path",{d:"M6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 20C13.1046 20 14 19.1046 14 18C14 16.8954 13.1046 16 12 16C10.8954 16 10 16.8954 10 18C10 19.1046 10.8954 20 12 20Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 8C19.1046 8 20 7.10457 20 6C20 4.89543 19.1046 4 18 4C16.8954 4 16 4.89543 16 6C16 7.10457 16.8954 8 18 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.01734 8.74067C6.01734 10.4142 5.77537 12.1995 9.22051 11.9855H12.0053M17.9929 8.57617C18.1259 11.9855 16.9199 11.7648 15.7861 11.9855H12.0053M12.0053 15.7001V11.9855",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],zd=[["path",{d:"M10 20.5675C6.57143 21.7248 3.71429 20.5675 2 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 22V18.7579C10 18.1596 10.1839 17.6396 10.4804 17.1699C10.6838 16.8476 10.5445 16.3904 10.1771 16.2894C7.13394 15.4528 5 14.1077 5 9.64606C5 8.48611 5.38005 7.39556 6.04811 6.4464C6.21437 6.21018 6.29749 6.09208 6.31748 5.9851C6.33746 5.87813 6.30272 5.73852 6.23322 5.45932C5.95038 4.32292 5.96871 3.11619 6.39322 2.02823C6.39322 2.02823 7.27042 1.74242 9.26698 2.98969C9.72282 3.27447 9.95075 3.41686 10.1515 3.44871C10.3522 3.48056 10.6206 3.41384 11.1573 3.28041C11.8913 3.09795 12.6476 3 13.5 3C14.3524 3 15.1087 3.09795 15.8427 3.28041C16.3794 3.41384 16.6478 3.48056 16.8485 3.44871C17.0493 3.41686 17.2772 3.27447 17.733 2.98969C19.7296 1.74242 20.6068 2.02823 20.6068 2.02823C21.0313 3.11619 21.0496 4.32292 20.7668 5.45932C20.6973 5.73852 20.6625 5.87813 20.6825 5.9851C20.7025 6.09207 20.7856 6.21019 20.9519 6.4464C21.6199 7.39556 22 8.48611 22 9.64606C22 14.1077 19.8661 15.4528 16.8229 16.2894C16.4555 16.3904 16.3162 16.8476 16.5196 17.1699C16.8161 17.6396 17 18.1596 17 18.7579V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Jd=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Xd=[["path",{d:"M9.89128 7.55559C9.34109 7.8715 7.89853 8.51654 8.77715 9.32371C9.20634 9.71801 9.68436 10 10.2853 10H13.7147C14.3156 10 14.7937 9.71801 15.2229 9.32371C16.1015 8.51654 14.6589 7.8715 14.1087 7.55559C12.8185 6.8148 11.1815 6.8148 9.89128 7.55559Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13.5 3.5C13.5 4.32843 12.8284 5 12 5C11.1716 5 10.5 4.32843 10.5 3.5C10.5 2.67157 11.1716 2 12 2C12.8284 2 13.5 2.67157 13.5 3.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M16.3913 19.5556C15.8411 19.8715 14.3985 20.5165 15.2771 21.3237C15.7063 21.718 16.1844 22 16.7853 22H20.2147C20.8156 22 21.2937 21.718 21.7229 21.3237C22.6015 20.5165 21.1589 19.8715 20.6087 19.5556C19.3185 18.8148 17.6815 18.8148 16.3913 19.5556Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M20 15.5C20 16.3284 19.3284 17 18.5 17C17.6716 17 17 16.3284 17 15.5C17 14.6716 17.6716 14 18.5 14C19.3284 14 20 14.6716 20 15.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M3.39128 19.5556C2.84109 19.8715 1.39853 20.5165 2.27715 21.3237C2.70634 21.718 3.18436 22 3.78534 22H7.21466C7.81564 22 8.29366 21.718 8.72285 21.3237C9.60147 20.5165 8.15891 19.8715 7.60872 19.5556C6.31854 18.8148 4.68146 18.8148 3.39128 19.5556Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7 15.5C7 16.3284 6.32843 17 5.5 17C4.67157 17 4 16.3284 4 15.5C4 14.6716 4.67157 14 5.5 14C6.32843 14 7 14.6716 7 15.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 13V15.5M12 15.5L14.5 17M12 15.5L9.5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],Qd=[["path",{d:"M14.5 7H9.5C6.21252 7 4.56878 7 3.46243 7.90796C3.25989 8.07418 3.07418 8.25989 2.90796 8.46243C2 9.56878 2 11.2125 2 14.5C2 17.7875 2 19.4312 2.90796 20.5376C3.07418 20.7401 3.25989 20.9258 3.46243 21.092C4.56878 22 6.21252 22 9.5 22H14.5C17.7875 22 19.4312 22 20.5376 21.092C20.7401 20.9258 20.9258 20.7401 21.092 20.5376C22 19.4312 22 17.7875 22 14.5C22 11.2125 22 9.56878 21.092 8.46243C20.9258 8.25989 20.7401 8.07418 20.5376 7.90796C19.4312 7 17.7875 7 14.5 7Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 7V5C12 4.44772 12.4477 4 13 4C13.5523 4 14 3.55228 14 3V2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M7 12L8 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M11.5 12L12.5 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M16 12L17 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7 17L17 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],eu=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],tu=[["path",{d:"M16.4964 9V6.5C16.4964 4.01472 14.4817 2 11.9964 2C9.51112 2 7.4964 4.01472 7.4964 6.5V9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13.4958 9H10.4964C8.16158 9 6.99417 9 6.11049 9.47237C5.41275 9.84535 4.84128 10.4169 4.46837 11.1146C3.99608 11.9984 3.99619 13.1658 3.99641 15.5006C3.99662 17.835 3.99673 19.0023 4.46907 19.8858C4.84203 20.5835 5.41347 21.1548 6.11115 21.5277C6.99475 22 8.16197 22 10.4964 22H13.4958C15.8304 22 16.9978 22 17.8814 21.5277C18.5791 21.1548 19.1506 20.5833 19.5235 19.8856C19.9958 19.0019 19.9958 17.8346 19.9958 15.5C19.9958 13.1654 19.9958 11.9981 19.5235 11.1144C19.1506 10.4167 18.5791 9.84525 17.8814 9.47231C16.9978 9 15.8304 9 13.4958 9Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"11.9964",cy:"15.5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],nu=[["path",{d:"M21.9598 12.9919C21.6856 17.2342 18.3536 20.6134 14.1706 20.8915C13.4574 20.9389 12.7285 21.001 12 21.001C10.4054 21.001 8.95127 20.8637 7.44544 20.2902C7.44544 20.2902 5.56108 21.7589 3.69962 21.4587C3.31009 21.3959 3.11532 21.3644 3.00091 21.1343C2.8865 20.9042 3.00788 20.6756 3.25063 20.2185C3.65964 19.4483 3.92248 18.6737 3.80076 17.8306C3.73703 17.3892 3.50433 16.9974 3.27644 16.6136L3.26529 16.5948C2.62637 15.5188 2.12462 14.2975 2.04024 12.9919C1.98659 12.1617 1.98659 11.3019 2.04024 10.4717C2.31441 6.22935 5.64639 2.85011 9.8294 2.57205C11.2536 2.47738 12.7435 2.47719 14.1706 2.57205C18.3536 2.85011 21.6856 6.22935 21.9598 10.4717C22.0134 11.3019 22.0134 12.1617 21.9598 12.9919Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.75 14.501H15.25M8.75 9.50098H12.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],su=[["path",{d:"M13.5 15.5C13.5 14.5572 13.5 14.0858 13.7929 13.7929C14.0858 13.5 14.5572 13.5 15.5 13.5H20C20.9428 13.5 21.4142 13.5 21.7071 13.7929C22 14.0858 22 14.5572 22 15.5V20C22 20.9428 22 21.4142 21.7071 21.7071C21.4142 22 20.9428 22 20 22H15.5C14.5572 22 14.0858 22 13.7929 21.7071C13.5 21.4142 13.5 20.9428 13.5 20V15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 4C2 3.05719 2 2.58579 2.29289 2.29289C2.58579 2 3.05719 2 4 2H8.5C9.44281 2 9.91421 2 10.2071 2.29289C10.5 2.58579 10.5 3.05719 10.5 4V8.5C10.5 9.44281 10.5 9.91421 10.2071 10.2071C9.91421 10.5 9.44281 10.5 8.5 10.5H4C3.05719 10.5 2.58579 10.5 2.29289 10.2071C2 9.91421 2 9.44281 2 8.5V4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 15.5C2 14.5572 2 14.0858 2.29289 13.7929C2.58579 13.5 3.05719 13.5 4 13.5H8.5C9.44281 13.5 9.91421 13.5 10.2071 13.7929C10.5 14.0858 10.5 14.5572 10.5 15.5V20C10.5 20.9428 10.5 21.4142 10.2071 21.7071C9.91421 22 9.44281 22 8.5 22H4C3.05719 22 2.58579 22 2.29289 21.7071C2 21.4142 2 20.9428 2 20V15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M13.5 4C13.5 3.05719 13.5 2.58579 13.7929 2.29289C14.0858 2 14.5572 2 15.5 2H20C20.9428 2 21.4142 2 21.7071 2.29289C22 2.58579 22 3.05719 22 4V8.5C22 9.44281 22 9.91421 21.7071 10.2071C21.4142 10.5 20.9428 10.5 20 10.5H15.5C14.5572 10.5 14.0858 10.5 13.7929 10.2071C13.5 9.91421 13.5 9.44281 13.5 8.5V4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],ru=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18.6461 4.52795C18.2489 4.89346 18 5.41766 18 6C18 7.10457 18.8954 8 20 8C20.3793 8 20.7339 7.89441 21.0361 7.71103C21.6139 7.36038 22 6.72527 22 6C22 4.89543 21.1046 4 20 4C19.4778 4 19.0023 4.20016 18.6461 4.52795ZM18.6461 4.52795C16.8794 2.95541 14.5513 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.6625 21.9833 11.3289 21.9506 11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],ou=[["path",{d:"M12 22C11.1818 22 10.4002 21.6698 8.83693 21.0095C4.94564 19.3657 3 18.5438 3 17.1613C3 16.7742 3 10.0645 3 7M12 22C12.8182 22 13.5998 21.6698 15.1631 21.0095C19.0544 19.3657 21 18.5438 21 17.1613V7M12 22L12 11.3548",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.32592 9.69138L5.40472 8.27785C3.80157 7.5021 3 7.11423 3 6.5C3 5.88577 3.80157 5.4979 5.40472 4.72215L8.32592 3.30862C10.1288 2.43621 11.0303 2 12 2C12.9697 2 13.8712 2.4362 15.6741 3.30862L18.5953 4.72215C20.1984 5.4979 21 5.88577 21 6.5C21 7.11423 20.1984 7.5021 18.5953 8.27785L15.6741 9.69138C13.8712 10.5638 12.9697 11 12 11C11.0303 11 10.1288 10.5638 8.32592 9.69138Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 12L8 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 4L7 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],iu=[["path",{d:"M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 3V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],au=[["path",{d:"M2.49219 12C2.49219 7.52166 2.49219 5.28249 3.88343 3.89124C5.27467 2.5 7.51384 2.5 11.9922 2.5C16.4705 2.5 18.7097 2.5 20.1009 3.89124C21.4922 5.28249 21.4922 7.52166 21.4922 12C21.4922 16.4783 21.4922 18.7175 20.1009 20.1088C18.7097 21.5 16.4705 21.5 11.9922 21.5C7.51384 21.5 5.27467 21.5 3.88343 20.1088C2.49219 18.7175 2.49219 16.4783 2.49219 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.49219 9H21.4922",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M7.99219 21.5V9",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],cu=[["path",{d:"M4 7C4 5.58579 4 4.87868 4.43934 4.43934C4.87868 4 5.58579 4 7 4C8.41421 4 9.12132 4 9.56066 4.43934C10 4.87868 10 5.58579 10 7V17C10 18.4142 10 19.1213 9.56066 19.5607C9.12132 20 8.41421 20 7 20C5.58579 20 4.87868 20 4.43934 19.5607C4 19.1213 4 18.4142 4 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 7C14 5.58579 14 4.87868 14.4393 4.43934C14.8787 4 15.5858 4 17 4C18.4142 4 19.1213 4 19.5607 4.43934C20 4.87868 20 5.58579 20 7V17C20 18.4142 20 19.1213 19.5607 19.5607C19.1213 20 18.4142 20 17 20C15.5858 20 14.8787 20 14.4393 19.5607C14 19.1213 14 18.4142 14 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],lu=[["path",{d:"M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ki=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],du=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],uu=[["path",{d:"M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],fu=[["path",{d:"M21 6.5C21 8.15685 19.6569 9.5 18 9.5C16.3431 9.5 15 8.15685 15 6.5C15 4.84315 16.3431 3.5 18 3.5C19.6569 3.5 21 4.84315 21 6.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 12C9 13.6569 7.65685 15 6 15C4.34315 15 3 13.6569 3 12C3 10.3431 4.34315 9 6 9C7.65685 9 9 10.3431 9 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 17.5C21 19.1569 19.6569 20.5 18 20.5C16.3431 20.5 15 19.1569 15 17.5C15 15.8431 16.3431 14.5 18 14.5C19.6569 14.5 21 15.8431 21 17.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M8.72852 10.7495L15.2285 7.75M8.72852 13.25L15.2285 16.2495",stroke:"currentColor",strokeWidth:"1.5",key:"3"}]],hu=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],pu=[["path",{d:"M15.1312 2.5C14.1462 2.17555 13.0936 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 10.9548 21.8396 9.94704 21.5422 9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M19.5 4.5L12 12M19.5 4.5V2M19.5 4.5H22",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}]],gu=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],mu=[["path",{d:"M20 21.0001C19.713 17.269 16.7289 14.3151 12.995 14.0662L12 13.9999C11.6446 14.0096 11.3134 14.0225 11.0008 14.0378C7.3 14.2192 4.28417 17.3057 4 21.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"12",cy:"6.99988",r:"4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],yu=[["path",{d:"M14 14.8135V9.18646C14 6.04126 14 4.46866 13.0747 4.0773C12.1494 3.68593 11.0603 4.79793 8.88232 7.02192C7.75439 8.17365 7.11085 8.42869 5.50604 8.42869C4.10257 8.42869 3.40084 8.42869 2.89675 8.77262C1.85035 9.48655 2.00852 10.882 2.00852 12C2.00852 13.118 1.85035 14.5134 2.89675 15.2274C3.40084 15.5713 4.10257 15.5713 5.50604 15.5713C7.11085 15.5713 7.75439 15.8264 8.88232 16.9781C11.0603 19.2021 12.1494 20.3141 13.0747 19.9227C14 19.5313 14 17.9587 14 14.8135Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 9C17.6254 9.81968 18 10.8634 18 12C18 13.1366 17.6254 14.1803 17 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 7C21.2508 8.36613 22 10.1057 22 12C22 13.8943 21.2508 15.6339 20 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],vu=[["path",{d:"M22 22L2 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 10C17.6296 10.7667 18 11.7054 18 12.7195C18 13.1635 17.929 13.593 17.7963 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 8C21.2508 9.22951 22 10.7952 22 12.5C22 13.9164 21.4829 15.2367 20.5906 16.348",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14 14C14 17.1452 14 19.5313 13.074 19.9227C12.1481 20.3141 11.0583 19.2021 8.8787 16.9781C7.7499 15.8264 7.106 15.5713 5.5 15.5713C4.3879 15.5713 3.02749 15.7187 2.33706 14.6643C2 14.1496 2 13.4331 2 12C2 10.5669 2 9.85038 2.33706 9.33566C3.02749 8.28131 4.3879 8.42869 5.5 8.42869C6.60725 8.42869 7.3569 8.43869 7.96 7.96M14 9.5C14 6.3548 14.026 4.46866 13.1 4.0773C12.3292 3.75147 11.5323 4.46765 10 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],bu={apple:xd,windows:su,github:zd,search:du,"chevron-down":$d,"chevron-left":Id,"chevron-right":Md,"arrow-down":Ld,"arrow-left":Td,"arrow-right":Ad,"arrow-up-right":Od,bot:Pd,calendar:Rd,x:Dd,clock:Nd,coins:Fd,terminal:Hd,copy:Wd,cpu:jd,database:_d,"dollar-sign":Bd,"file-code-2":Ud,"sliders-horizontal":qd,folder:Gd,"git-branch":Yd,"git-commit":Kd,"git-fork":Zd,"circle-help":Jd,network:Xd,keyboard:Qd,"loader-circle":eu,lock:tu,message:nu,orbit:ru,box:ou,"panel-right":iu,panels:au,pause:cu,play:lu,"refresh-cw":Ki,"rotate-ccw":Ki,"settings-2":uu,"share-2":fu,sparkles:hu,crosshair:pu,"center-focus":Vd,check:gu,user:mu,"volume-2":yu,"volume-x":vu},ut=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function W(e,t=""){const n=bu[e].map(([s,r])=>`<${s}${Object.entries(r).filter(([o])=>o!=="key").map(([o,i])=>` ${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}="${ut(String(i))}"`).join("")}></${s}>`).join("");return`<svg class="ui-icon${t?` ${ut(t)}`:""}" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true" focusable="false">${n}</svg>`}function wo(e){const t=document.createElement("template");return t.innerHTML=W(e),t.content.firstElementChild}function wu(e,t="",n=!0){return`<details class="session-info graph-session-info"${n?" open":""}><summary>Session info ${W("chevron-down")}</summary><dl>
3
3
  ${e.map(([s,r,o])=>`<div><dt>${W(s)}${ut(r)}</dt><dd>${ut(o)}</dd></div>`).join("")}
4
4
  </dl>${t}</details>`}function it(e,t,n={},s=t,r=""){const o=Object.entries(n).flatMap(([i,a])=>a===!1?[]:[a===!0?i:`${i}="${ut(a)}"`]);return`<button type="button" class="graph-button${r?" graph-button-labeled":""}" aria-label="${ut(t)}" title="${ut(s)}" ${o.join(" ")}>${W(e)}${r?`<span>${ut(r)}</span>`:""}</button>`}const gc={search:["search","/","Search"],fit:["center-focus","F","Fit view"],panels:["panels","H","Panels"],clear:["x","Esc","Clear selection"]};function Cu(e,t){return`<aside class="graph-shortcuts ${ut(t)}" aria-label="Keyboard shortcuts">${e.map(n=>{const[s,r,o]=gc[n];return`<span>${W(s)}<kbd>${r}</kbd>${o}</span>`}).join("")}</aside>`}function ku(e){return{glyph:e?"volume-x":"volume-2",label:e?"Unmute sound":"Mute sound"}}function Eu(e,t,n=""){const s=t.map(r=>gc[r]);return`<dialog class="graph-help" id="${e}" aria-labelledby="${e}-title">${it("x","Close help",{"data-close-help":!0})}<h2 id="${e}-title">Explore the map</h2>
@@ -96,7 +96,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-viewer-B
96
96
  ${v.input}`:"",v.output?`Output
97
97
  ${v.output}`:""].filter(Boolean).join(`
98
98
 
99
- `);return{text:C.slice(0,1800),shortened:C.length>1800||!!v.partial}}return{clear:h,show(v,C,L,O,w,S){const b=`${C}:${L}:${v.id}`,E=r!==b;E&&h(),r=b,a=v,c=w,l=S,f=O;const k=s.get(b);d(k?.text||v.preview,k?k.shortened?"Content preview":"":"Loading message…"),!(!E||k)&&(i=setTimeout(async()=>{const x=new AbortController;o=x;try{const y=await n.read(C,{item:v.id,revision:L,filter:v.kind==="commit"?"tools":"messages"},x.signal);if(x.signal.aborted||r!==b||y.selected?.id!==v.id)return;const A=m(y.selected);s.set(b,A),s.size>20&&s.delete(s.keys().next().value),d(A.text,A.shortened?"Content preview":"")}catch{!x.signal.aborted&&r===b&&d(v.preview,"Saved excerpt · open for details")}},120))},dispose(){h(),s.clear()}}}const Vg=e=>e.length!==40&&e.length!==64;function Ng(e,t,n){const s=new AbortController,r=document.createElement("div");r.className="section-label",r.textContent="Commits";const o=document.createElement("span");r.append(o);const i=document.createElement("p");i.className="coverage-note commit-coverage",i.textContent="Loading commits…";const a=document.createElement("div"),c=document.createElement("button");c.className="load-more",c.hidden=!0,e.replaceChildren(r,i,a,c);let l,f;async function u(){c.disabled=!0;try{const g=new URLSearchParams({limit:"30",...l?{cursor:l}:{}}),p=await gt(`/api/sessiongraph/session/${encodeURIComponent(t)}/commits?${g}`,"Could not load commits.",{signal:AbortSignal.any([s.signal,AbortSignal.timeout(3e4)])});if(s.signal.aborted)return;f=p.revision,o.textContent=p.total?p.total.toLocaleString():"",i.hidden=p.total>0,i.textContent=p.coverage.state==="pending"?"Commit indexing pending.":p.coverage.state==="unavailable"?"Commit history unavailable.":"No commits found.";for(const h of p.items){const d=document.createElement("button");d.className="relation";const m=document.createElement("span"),v=document.createElement("strong"),C=document.createElement("small");v.textContent=`${h.sha.slice(0,12)} · ${h.operation}`,C.textContent=`${h.occurredAt===null?"Time not recorded":new Date(h.occurredAt).toLocaleString()} · ${h.repositoryPath}`,d.title=`${h.sha}${Vg(h.sha)?" (abbreviated)":""} — inspect execution evidence`,m.append(v,C),d.append(m),d.addEventListener("click",()=>n(h.evidenceEventID,f),{signal:s.signal}),a.append(d)}l=p.nextCursor||void 0,c.hidden=!l,c.textContent="Load more commits"}catch(g){if(s.signal.aborted)return;o.textContent="",i.hidden=!1,i.textContent=g instanceof Error?g.message:"Commit index unavailable.",l=void 0,a.replaceChildren(),c.hidden=!1,c.textContent="Reload commits"}finally{c.disabled=!1}}return c.addEventListener("click",()=>{u()},{signal:s.signal}),u(),()=>s.abort()}function fe(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)}function fn(e,t,n,s,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ps,cn,Oe,ln,Rs,so,Ds;const Ua="__TAURI_TO_IPC_KEY__";function Fg(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class fv{constructor(t){Ps.add(this),cn.set(this,void 0),Oe.set(this,0),ln.set(this,[]),Rs.set(this,void 0),fn(this,cn,t||(()=>{})),this.id=Fg(n=>{const s=n.index;if("end"in n){s==fe(this,Oe,"f")?this.cleanupCallback():fn(this,Rs,s);return}const r=n.message;if(s==fe(this,Oe,"f")){for(fe(this,Ps,"m",so).call(this,r),fn(this,Oe,fe(this,Oe,"f")+1);fe(this,Oe,"f")in fe(this,ln,"f");){const o=fe(this,ln,"f")[fe(this,Oe,"f")];fe(this,Ps,"m",so).call(this,o),delete fe(this,ln,"f")[fe(this,Oe,"f")],fn(this,Oe,fe(this,Oe,"f")+1)}fe(this,Oe,"f")===fe(this,Rs,"f")&&this.cleanupCallback()}else fe(this,ln,"f")[s]=r})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){fn(this,cn,t)}get onmessage(){return fe(this,cn,"f")}[(cn=new WeakMap,Oe=new WeakMap,ln=new WeakMap,Rs=new WeakMap,Ps=new WeakSet,so=function(n){try{fe(this,cn,"f").call(this,n)}catch(s){queueMicrotask(()=>{throw s})}},Ua)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[Ua]()}}async function ki(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}class hv{get rid(){return fe(this,Ds,"f")}constructor(t){Ds.set(this,void 0),fn(this,Ds,t)}async close(){return ki("plugin:resources|close",{rid:this.rid})}async[(Ds=new WeakMap,Symbol.asyncDispose)](){await this.close()}}function is(){return!!(globalThis||window).isTauri}async function Hg(e,t){await ki("plugin:opener|open_url",{url:e,with:t})}function El(e){const t=new URL(e);if(!["https:","http:"].includes(t.protocol)||t.username||t.password)throw new Error("Choose a valid web link.");return t.href}async function Sl(e,t=Hg){await t(El(e))}class Wg{constructor(t=(...n)=>fetch(...n)){this.request=t}request;pages=new Map;pending=new Map;characters=0;generation=0;clear(){this.generation++,this.pages.clear(),this.characters=0;for(const t of this.pending.values())t.controller.abort();this.pending.clear()}read(t,n={},s){if(s?.aborted)return Promise.reject(s.reason);const r=n.filter||"all",o=JSON.stringify([t,n.revision,r,n.item,n.cursor]),i=n.revision?this.pages.get(o):void 0;if(i)return this.pages.delete(o),this.pages.set(o,i),Promise.resolve(i.page);let a=this.pending.get(o);if(!a){const l=new AbortController,f=this.generation,u=new URLSearchParams({filter:r,...n}),g=gt(`/api/sessiongraph/session/${encodeURIComponent(t)}/events?${u}`,"Could not load events.",{signal:AbortSignal.any([l.signal,AbortSignal.timeout(3e4)])},this.request).catch(d=>{throw d instanceof Tt&&d.status===409&&(!d.code||d.code==="STALE_CURSOR")&&this.clear(),d}).then(d=>{if(l.signal.aborted||f!==this.generation)throw new DOMException("Request cancelled","AbortError");if(d.sessionID!==t||n.revision&&d.revision!==n.revision)throw new Error("Saved history changed. Reload the event explorer.");const m=JSON.stringify([t,d.revision,r,n.item,n.cursor]),v=JSON.stringify(d).length;for(this.characters-=this.pages.get(m)?.characters||0,this.pages.delete(m),this.pages.set(m,{page:d,characters:v}),this.characters+=v;this.pages.size>20||this.characters>2e6;){const C=this.pages.keys().next().value;this.characters-=this.pages.get(C).characters,this.pages.delete(C)}return d});a={controller:l,promise:g,readers:0},this.pending.set(o,a);const p=a,h=()=>{this.pending.get(o)===p&&this.pending.delete(o)};g.then(h,h)}const c=a;return c.readers++,new Promise((l,f)=>{const u=()=>{p(),f(s.reason)};let g=!1;const p=()=>{g||(g=!0,s?.removeEventListener("abort",u),--c.readers===0&&this.pending.get(o)===c&&(this.pending.delete(o),c.controller.abort()))};s?.addEventListener("abort",u,{once:!0}),c.promise.then(h=>{g||(p(),l(h))},h=>{g||(p(),f(h))})})}}async function jg(){await ki("plugin:process|restart")}class _g{constructor(t,n,s=Date.now){this.backend=t,this.changed=n,this.now=s}backend;changed;now;state={phase:"hidden"};release;busy=!1;disposed=!1;downloaded=!1;installed=!1;lastCheck=-1/0;set(t){this.disposed||(this.state=t,this.changed(t))}async close(){const t=this.release;this.release=void 0,await t?.close().catch(()=>{})}async check(){if(!(this.disposed||this.busy||this.release||this.now()-this.lastCheck<5*6e4)){this.busy=!0,this.lastCheck=this.now();try{this.release=await this.backend.check()||void 0,this.release&&this.set({phase:"available",version:this.release.version})}catch{}finally{this.busy=!1,this.disposed&&await this.close()}}}async activate(){if(this.disposed||this.busy||!this.release)return;this.busy=!0;const{version:t}=this.release;let n=this.installed?"restart":this.downloaded?"install":"download";try{if(!this.downloaded){let s,r=0;this.set({phase:"downloading",version:t}),await this.release.download(o=>{o.event==="Started"&&(s=o.data.contentLength,r=0),o.event==="Progress"&&(r+=o.data.chunkLength),this.set({phase:"downloading",version:t,progress:s&&s>0?Math.min(99,Math.floor(r/s*100)):void 0})}),this.downloaded=!0,this.set({phase:"ready",version:t});return}if(this.installed||(this.set({phase:"installing",version:t}),await this.release.install(),this.installed=!0),this.disposed)return;n="restart",this.set({phase:"restarting",version:t}),await this.backend.restart()}catch(s){this.set({phase:"error",version:t,retry:n,error:String(s instanceof Error?s.message:s).slice(0,300)})}finally{this.busy=!1,this.disposed&&await this.close()}}dispose(){this.disposed=!0,this.busy||this.close()}}const Bg=W("arrow-down"),Ug=W("refresh-cw");function qg(e){const t=document.createElement("button");t.className="desktop-update glass",t.hidden=!0,t.type="button";const n=document.createElement("span");n.className="sr-only",n.role="status",n.setAttribute("aria-live","polite"),document.querySelector("#app").append(t,n);let s="";const r=l=>{const f=["downloading","installing","restarting"].includes(l.phase),u=l.phase==="ready"||l.phase==="error"&&l.retry!=="download",g=l.retry==="restart"?"Restart failed":l.retry==="install"?"Install failed":/\b(?:signature|verification)\b/i.test(l.error||"")?"Update verification failed":"Download failed",p=l.phase==="downloading"?l.progress===void 0?"Downloading":`${l.progress}%`:l.phase==="installing"?"Installing":l.phase==="restarting"?"Restarting":l.phase==="error"?`${g} · Retry`:u?"Restart":"Update",h=l.phase==="error"?p:l.phase==="restarting"?`Restarting SessionGraph ${l.version}`:u?`Restart to install SessionGraph ${l.version}`:`Update to SessionGraph ${l.version}`;t.hidden=l.phase==="hidden",t.disabled=f,t.dataset.phase=l.phase,t.setAttribute("aria-busy",String(f)),t.setAttribute("aria-label",h),t.title=h;const d=`${u||l.phase==="restarting"?Ug:Bg}<span>${p}</span>`;t.innerHTML!==d&&(t.innerHTML=d);const m=l.phase==="hidden"?"":l.phase==="downloading"?`Downloading SessionGraph ${l.version}`:h;m!==s&&(n.textContent=m,s=m)},o=new _g(e,r);t.addEventListener("click",()=>{o.activate()});const i=()=>{document.visibilityState==="visible"&&navigator.onLine&&o.check()},a=window.setTimeout(i,1e4),c=window.setInterval(i,240*6e4);return document.addEventListener("visibilitychange",i),window.addEventListener("online",i),{check:()=>o.check(),dispose(){clearTimeout(a),clearInterval(c),o.dispose(),t.remove(),n.remove(),document.removeEventListener("visibilitychange",i),window.removeEventListener("online",i)}}}function Gg(){return is()?qg({async check(){const{check:e}=await br(async()=>{const{check:n}=await import("./index-CxNvtrVy.js");return{check:n}},[]),t=await e({timeout:15e3});return t&&{version:t.version,download:n=>t.download(n,{timeout:10*6e4}),install:()=>t.install({restartAfterInstall:!0}),close:()=>t.close()}},async restart(){await jg()}}):{dispose(){}}}var Yg=pn("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),ee=Yg.build();function ro(e,t){return e-t*Math.floor(e/t)}const xl=1721426;function Vs(e,t,n,s){t=Ei(e,t);let r=t-1,o=-2;return n<=2?o=0:Zs(t)&&(o=-1),xl-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+o+s)}function Zs(e){return e%4===0&&(e%100!==0||e%400===0)}function Ei(e,t){return e==="BC"?1-t:t}function Kg(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const Zg={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Sn{fromJulianDay(t){let n=t,s=n-xl,r=Math.floor(s/146097),o=ro(s,146097),i=Math.floor(o/36524),a=ro(o,36524),c=Math.floor(a/1461),l=ro(a,1461),f=Math.floor(l/365),u=r*400+i*100+c*4+f+(i!==4&&f!==4?1:0),[g,p]=Kg(u),h=n-Vs(g,p,1,1),d=2;n<Vs(g,p,3,1)?d=0:Zs(p)&&(d=1);let m=Math.floor(((h+d)*12+373)/367),v=n-Vs(g,p,m,1)+1;return new qe(g,p,m,v)}toJulianDay(t){return Vs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return Zg[Zs(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Zs(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const zg={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Ie(e,t){return t=me(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Jg(e,t){return t=me(t,e.calendar),e=ft(e),t=ft(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Xg(e,t){return t=me(t,e.calendar),e=gs(e),t=gs(t),e.era===t.era&&e.year===t.year}function Qg(e,t){return Rr(e.calendar,t.calendar)&&Ie(e,t)}function qn(e,t){return Rr(e.calendar,t.calendar)&&Jg(e,t)}function Gn(e,t){return Rr(e.calendar,t.calendar)&&Xg(e,t)}function Rr(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function em(e,t){return Ie(e,Dr(t))}const tm={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function $l(e,t,n){let s=e.calendar.toJulianDay(e),r=n?tm[n]:om(t),o=Math.ceil(s+1-r)%7;return o<0&&(o+=7),o}function Ll(e){return ht(Date.now(),e)}function Dr(e){return Kt(Ll(e))}function Il(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function nm(e,t){return qa(e)-qa(t)}function qa(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let oo=null,sm=!1;function Si(){return oo==null&&(oo=new Intl.DateTimeFormat().resolvedOptions().timeZone),oo}function Tl(){return sm}function ft(e){return e.subtract({days:e.day-1})}function Bo(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function gs(e){return ft(e.subtract({months:e.month-1}))}function rm(e){return Bo(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function At(e,t,n){let s=$l(e,t,n);return e.subtract({days:s})}function Ga(e,t,n){return At(e,t,n).add({days:6})}const Ya=new Map,io=new Map;function Ml(e){if(Intl.Locale){let n=Ya.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Ya.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function om(e){let t=io.get(e);if(!t){if(Intl.Locale){let s=new Intl.Locale(e);if("getWeekInfo"in s&&(t=s.getWeekInfo(),t))return io.set(e,t),t.firstDay}let n=Ml(e);if(e.includes("-fw-")){let s=e.split("-fw-")[1].split("-")[0];s==="mon"?t={firstDay:1}:s==="tue"?t={firstDay:2}:s==="wed"?t={firstDay:3}:s==="thu"?t={firstDay:4}:s==="fri"?t={firstDay:5}:s==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&zg[n]||0};io.set(e,t)}return t.firstDay}function im(e,t,n){let s=e.calendar.getDaysInMonth(e);return Math.ceil(($l(ft(e),t,n)+s)/7)}function Al(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Ol(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const am={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function cm(e,t){let n=e.calendar.toJulianDay(e),s=Math.ceil(n+1)%7;s<0&&(s+=7);let r=Ml(t),[o,i]=am[r]||[6,0];return s===o||s===i}function xn(e){e=me(e,new Sn);let t=Ei(e.era,e.year);return Pl(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Pl(e,t,n,s,r,o,i){let a=new Date;return a.setUTCHours(s,r,o,i),a.setUTCFullYear(e,t-1,n),a.getTime()}function Uo(e,t){if(t==="UTC")return 0;if(e>0&&t===Si()&&!Tl())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:s,day:r,hour:o,minute:i,second:a}=Rl(e,t);return Pl(n,s,r,o,i,a,0)-Math.floor(e/1e3)*1e3}const Ka=new Map;function Rl(e,t){let n=Ka.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Ka.set(t,n));let s=n.formatToParts(new Date(e)),r={};for(let o of s)o.type!=="literal"&&(r[o.type]=o.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const Za=864e5;function lm(e,t,n,s){return(n===s?[n]:[n,s]).filter(o=>dm(e,t,o))}function dm(e,t,n){let s=Rl(n,t);return e.year===s.year&&e.month===s.month&&e.day===s.day&&e.hour===s.hour&&e.minute===s.minute&&e.second===s.second}function dt(e,t,n="compatible"){let s=He(e);if(t==="UTC")return xn(s);if(t===Si()&&n==="compatible"&&!Tl()){s=me(s,new Sn);let c=new Date,l=Ei(s.era,s.year);return c.setFullYear(l,s.month-1,s.day),c.setHours(s.hour,s.minute,s.second,s.millisecond),c.getTime()}let r=xn(s),o=Uo(r-Za,t),i=Uo(r+Za,t),a=lm(s,t,r-o,r-i);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-o,r-i);case"compatible":case"later":return Math.max(r-o,r-i);case"reject":throw new RangeError("No such absolute time found")}}function Dl(e,t,n="compatible"){return new Date(dt(e,t,n))}function ht(e,t){let n=Uo(e,t),s=new Date(e+n),r=s.getUTCFullYear(),o=s.getUTCMonth()+1,i=s.getUTCDate(),a=s.getUTCHours(),c=s.getUTCMinutes(),l=s.getUTCSeconds(),f=s.getUTCMilliseconds();return new ms(r<1?"BC":"AD",r<1?-r+1:r,o,i,t,n,a,c,l,f)}function Kt(e){return new qe(e.calendar,e.era,e.year,e.month,e.day)}function He(e,t){let n=0,s=0,r=0,o=0;if("timeZone"in e)({hour:n,minute:s,second:r,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:s,second:r,millisecond:o}=t),new fr(e.calendar,e.era,e.year,e.month,e.day,n,s,r,o)}function me(e,t){if(Rr(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),s=e.copy();return s.calendar=t,s.era=n.era,s.year=n.year,s.month=n.month,s.day=n.day,Qt(s),s}function Vl(e,t,n){if(e instanceof ms)return e.timeZone===t?e:fm(e,t);let s=dt(e,t,n);return ht(s,t)}function um(e){let t=xn(e)-e.offset;return new Date(t)}function fm(e,t){let n=xn(e)-e.offset;return me(ht(n,t),e.calendar)}const Yn=36e5;function Vr(e,t){let n=e.copy(),s="hour"in n?mm(n,t):0;qo(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Go(n),Nl(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=s,hm(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){let i=n.calendar.isInverseEra?.(n);n.year=r,n.month=i?1:n.calendar.getMonthsInYear(n),n.day=i?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let o=n.calendar.getMonthsInYear(n);return n.month>o&&(n.month=o,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function qo(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Go(e){for(;e.month<1;)qo(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qo(e,1)}function hm(e){for(;e.day<1;)e.month--,Go(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Go(e)}function Nl(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Qt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Nl(e)}function Fl(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Hl(e,t){return Vr(e,Fl(t))}function xi(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Qt(n),n}function ur(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),gm(n),n}function pm(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ns(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ns(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ns(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ns(e.hour,24),t}function gm(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ns(e,t){let n=e%t;return n<0&&(n+=t),n}function mm(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,pm(e)}function $i(e,t,n,s){let r=e.copy();switch(t){case"era":{let o=e.calendar.getEras(),i=o.indexOf(e.era);if(i<0)throw new Error("Invalid era: "+e.era);i=pt(i,n,0,o.length-1,s?.round),r.era=o[i],Qt(r);break}case"year":r.calendar.isInverseEra?.(r)&&(n=-n),r.year=pt(e.year,n,-1/0,9999,s?.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e);break;case"month":r.month=pt(e.month,n,1,e.calendar.getMonthsInYear(e),s?.round);break;case"day":r.day=pt(e.day,n,1,e.calendar.getDaysInMonth(e),s?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(r),Qt(r),r}function Wl(e,t,n,s){let r=e.copy();switch(t){case"hour":{let o=e.hour,i=0,a=23;if(s?.hourCycle===12){let c=o>=12;i=c?12:0,a=c?23:11}r.hour=pt(o,n,i,a,s?.round);break}case"minute":r.minute=pt(e.minute,n,0,59,s?.round);break;case"second":r.second=pt(e.second,n,0,59,s?.round);break;case"millisecond":r.millisecond=pt(e.millisecond,n,0,999,s?.round);break;default:throw new Error("Unsupported field "+t)}return r}function pt(e,t,n,s,r=!1){if(r){e+=Math.sign(t),e<n&&(e=s);let o=Math.abs(t);t>0?e=Math.ceil(e/o)*o:e=Math.floor(e/o)*o,e>s&&(e=n)}else e+=t,e<n?e=s-(n-e-1):e>s&&(e=n+(e-s-1));return e}function jl(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Vr(He(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=dt(r,e.timeZone)}else n=xn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let s=ht(n,e.timeZone);return me(s,e.calendar)}function ym(e,t){return jl(e,Fl(t))}function vm(e,t,n,s){switch(t){case"hour":{let r=0,o=23;if(s?.hourCycle===12){let h=e.hour>=12;r=h?12:0,o=h?23:11}let i=He(e),a=me(ur(i,{hour:r}),new Sn),c=[dt(a,e.timeZone,"earlier"),dt(a,e.timeZone,"later")].filter(h=>ht(h,e.timeZone).day===a.day)[0],l=me(ur(i,{hour:o}),new Sn),f=[dt(l,e.timeZone,"earlier"),dt(l,e.timeZone,"later")].filter(h=>ht(h,e.timeZone).day===l.day).pop(),u=xn(e)-e.offset,g=Math.floor(u/Yn),p=u%Yn;return u=pt(g,n,Math.floor(c/Yn),Math.floor(f/Yn),s?.round)*Yn+p,me(ht(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Wl(e,t,n,s);case"era":case"year":case"month":case"day":{let r=$i(He(e),t,n,s),o=dt(r,e.timeZone);return me(ht(o,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function bm(e,t,n){let s=He(e),r=ur(xi(s,t),t);if(r.compare(s)===0)return e;let o=dt(r,e.timeZone,n);return me(ht(o,e.timeZone),e.calendar)}const wm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,Cm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function km(e){let t=e.match(wm);if(!t)throw Cm.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new qe(ao(t[1],0,9999),ao(t[2],1,12),1);return n.day=ao(t[3],1,n.calendar.getDaysInMonth(n)),n}function ao(e,t,n){let s=Number(e);if(s<t||s>n)throw new RangeError(`Value out of range: ${t} <= ${s} <= ${n}`);return s}function Em(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function _l(e){let t=me(e,new Sn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Bl(e){return`${_l(e)}T${Em(e)}`}function Sm(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4),r=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return r!==0&&(o+=`:${String(r).padStart(2,"0")}`),o}function xm(e){return`${Bl(e)}${Sm(e.offset)}[${e.timeZone}]`}function Li(e){let t=typeof e[0]=="object"?e.shift():new Sn,n;if(typeof e[0]=="string")n=e.shift();else{let i=t.getEras();n=i[i.length-1]}let s=e.shift(),r=e.shift(),o=e.shift();return[t,n,s,r,o]}class qe{#e;constructor(...t){let[n,s,r,o,i]=Li(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,Qt(this)}copy(){return this.era?new qe(this.calendar,this.era,this.year,this.month,this.day):new qe(this.calendar,this.year,this.month,this.day)}add(t){return Vr(this,t)}subtract(t){return Hl(this,t)}set(t){return xi(this,t)}cycle(t,n,s){return $i(this,t,n,s)}toDate(t){return Dl(this,t)}toString(){return _l(this)}compare(t){return Il(this,t)}}class fr{#e;constructor(...t){let[n,s,r,o,i]=Li(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Qt(this)}copy(){return this.era?new fr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new fr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Vr(this,t)}subtract(t){return Hl(this,t)}set(t){return xi(ur(this,t),t)}cycle(t,n,s){switch(t){case"era":case"year":case"month":case"day":return $i(this,t,n,s);default:return Wl(this,t,n,s)}}toDate(t,n){return Dl(this,t,n)}toString(){return Bl(this)}compare(t){let n=Il(this,t);return n===0?nm(this,He(t)):n}}class ms{#e;constructor(...t){let[n,s,r,o,i]=Li(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Qt(this)}copy(){return this.era?new ms(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new ms(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return jl(this,t)}subtract(t){return ym(this,t)}set(t,n){return bm(this,t,n)}cycle(t,n,s){return vm(this,t,n,s)}toDate(){return um(this)}toString(){return xm(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Vl(t,this.timeZone).toDate().getTime()}}let co=new Map;class Ve{constructor(t,n={}){this.formatter=Ul(t,n),this.options=n}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let s=this.formatter.formatToParts(t),r=this.formatter.formatToParts(n);return[...s.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return Im()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Tm(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const $m={true:{ja:"h11"},false:{}};function Ul(e,t={}){if(typeof t.hour12=="boolean"&&Lm()){t={...t};let r=$m[String(t.hour12)][e.split("-")[0]],o=t.hour12?"h12":"h23";t.hourCycle=r??o,delete t.hour12}let n=e+(t?Object.entries(t).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(co.has(n))return co.get(n);let s=new Intl.DateTimeFormat(e,t);return co.set(n,s),s}let lo=null;function Lm(){return lo==null&&(lo=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),lo}let uo=null;function Im(){return uo==null&&(uo=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),uo}function Tm(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Ul(e,{...t,timeZone:void 0}),s=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(o=>o.type==="hour").value,10),r=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(o=>o.type==="hour").value,10);if(s===0&&r===23)return"h23";if(s===24&&r===23)return"h24";if(s===0&&r===11)return"h11";if(s===12&&r===11)return"h12";throw new Error("Unexpected hour cycle result")}function Mm(e,t,n,s,r){const o={};for(let a in t){const c=a,l=t[c];l!=null&&(o[c]=Math.floor(l/2),o[c]>0&&l%2===0&&o[c]--)}const i=sn(e,t,n).subtract(o);return Cs(e,i,t,n,s,r)}function sn(e,t,n,s,r){let o=e;return t.years?o=gs(e):t.months?o=ft(e):t.weeks&&(o=At(e,n)),Cs(e,o,t,n,s,r)}function Ii(e,t,n,s,r){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let i=sn(e,t,n).subtract(o);return Cs(e,i,t,n,s,r)}function Cs(e,t,n,s,r,o){return r&&e.compare(r)>=0&&(t=Ol(t,sn(Kt(r),n,s))),o&&e.compare(o)<=0&&(t=Al(t,Ii(Kt(o),n,s))),t}function De(e,t,n){const s=Kt(e),r=t?Kt(t):void 0,o=n?Kt(n):void 0;let i=s;return r&&(i=Ol(i,r)),o&&(i=Al(i,o)),i.compare(s)===0?e:"hour"in e?e.set({year:i.year,month:i.month,day:i.day}):i}function za(e,t,n,s,r,o){switch(t){case"start":return sn(e,n,s,r,o);case"end":return Ii(e,n,s,r,o);default:return Mm(e,n,s,r,o)}}function Lt(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Ie(e,t):He(e).compare(He(t))===0}function Ja(e,t,n,s,r){return e?t?.(e,n)?!0:ze(e,s,r):!1}function ze(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function Am(e,t,n){const s=e.subtract({days:1});return Ie(s,e)||ze(s,t,n)}function Om(e,t,n){const s=e.add({days:1});return Ie(s,e)||ze(s,t,n)}function Ti(e){let t={...e};for(let n in t)t[n]=1;return t}function ql(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Gl(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Yl(e,t,n){const s=n??He(Dr(t));return new Ve(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Gl(s),calendar:s.calendar.identifier,timeZone:t})}function Xa(e,t,n){const s=n??Dr(t);return new Ve(e,{month:"long",year:"numeric",era:Gl(s),calendar:s.calendar.identifier,timeZone:t})}function Pm(e,t,n,s,r){let o=n.formatRangeToParts(e.toDate(r),t.toDate(r)),i=-1;for(let l=0;l<o.length;l++){let f=o[l];if(f.source==="shared"&&f.type==="literal")i=l;else if(f.source==="endRange")break}let a="",c="";for(let l=0;l<o.length;l++)l<i?a+=o[l].value:l>i&&(c+=o[l].value);return s(a,c)}function Fs(e,t,n,s){if(!e)return"";let r=e,o=t??e,i=Yl(n,s);return Ie(r,o)?i.format(r.toDate(s)):Pm(r,o,i,(a,c)=>`${a} – ${c}`,s)}var Rm=["sun","mon","tue","wed","thu","fri","sat"];function Kl(e){return e!=null?Rm[e]:void 0}function Zl(e,t,n){const s=Kl(n);return At(e,t,s)}function zl(e,t,n,s){const r=t.add({weeks:e}),o=[];let i=Zl(r,n,s);for(;o.length<7;){o.push(i);let a=i.add({days:1});if(Ie(i,a))break;i=a}return o}function Dm(e,t,n,s){const r=Kl(s),o=n??im(e,t,r);return[...new Array(o).keys()].map(a=>zl(a,e,t,s))}function Vm(e,t){const n=new Ve(e,{weekday:"long",timeZone:t}),s=new Ve(e,{weekday:"short",timeZone:t}),r=new Ve(e,{weekday:"narrow",timeZone:t});return o=>{const i=o instanceof Date?o:o.toDate(t);return{value:o,short:s.format(i),long:n.format(i),narrow:r.format(i)}}}function Nm(e,t,n,s){const r=Zl(e,s,t),o=[...new Array(7).keys()],i=Vm(s,n);return o.map(a=>i(r.add({days:a})))}function Fm(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const i=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(i.toLocaleString(e,{month:t})),i.setMonth(i.getMonth()+1);return a}const s=n.calendar.getMonthsInYear(n),r=new Ve(e,{month:t,calendar:n.calendar.identifier}),o=[];for(let i=1;i<=s;i++){const a=n.set({month:i});o.push(r.format(a.toDate("UTC")))}return o}function Qa(e,t){const n=At(e,t,"mon"),s=n.year,r=n.set({month:1,day:4}),o=At(r,t,"mon"),i=n.calendar.toJulianDay(n),a=o.calendar.toJulianDay(o);if(i>=a)return 1+Math.floor((i-a)/7);const c=n.set({year:s-1,month:1,day:4}),l=At(c,t,"mon"),f=l.calendar.toJulianDay(l);return 1+Math.floor((i-f)/7)}function Hm(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var Wm=1900,jm=2099;function _m(e,t,n){const s=e.calendar,r=t?.year??me(new qe(Wm,1,1),s).year,o=n?.year??me(new qe(jm,12,31),s).year;return{from:r,to:o}}var Bm=10;function Um(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,s=parseInt(e.slice(-2),10),r=n+s;return r>t+Bm?(r-100).toString():r.toString()}return e}}function vn(e){const t=e-e%10,n=[];for(let s=0;s<10;s+=1){const r=t+s;n.push(r)}return n}function as(e,t){const n=Dr(e??Si());return t?me(n,t):n}function ks(e,t,n,s){return function(o){const{startDate:i,focusedDate:a}=o,c=ql(i,e);return ze(a,n,s)?{startDate:i,focusedDate:De(a,n,s),endDate:c}:a.compare(i)<0?{startDate:Ii(a,e,t,n,s),focusedDate:De(a,n,s),endDate:c}:a.compare(c)>0?{startDate:sn(a,e,t,n,s),endDate:c,focusedDate:De(a,n,s)}:{startDate:i,endDate:c,focusedDate:De(a,n,s)}}}function Jl(e,t,n,s,r,o){const i=ks(n,s,r,o),a=t.add(n);return i({focusedDate:e.add(n),startDate:sn(Cs(e,a,n,s,r,o),n,s)})}function Xl(e,t,n,s,r,o){const i=ks(n,s,r,o);let a=t.subtract(n);return i({focusedDate:e.subtract(n),startDate:sn(Cs(e,a,n,s,r,o),n,s)})}function qm(e,t,n,s,r,o,i){const a=ks(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.add(Ti(s)),startDate:t});if(s.days)return Jl(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.add({years:1}),startDate:t})}function Gm(e,t,n,s,r,o,i){const a=ks(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.subtract(Ti(s)),startDate:t});if(s.days)return Xl(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var ec=new Map;function Ym(e){let t=ec.get(e);return t!=null||(t="0123456789"+new Intl.NumberFormat(e,{useGrouping:!1}).format(1234567890),ec.set(e,t)),t}var Km=(e,t)=>t?Ym(t).includes(e):/\d/.test(e),Ql=(e,t,n)=>!e||e.length!==1?!0:Km(e,n)||t.includes(e),Zm=(e,t,n)=>e.split("").filter(s=>Ql(s,t,n)).join(""),tc=new Map;function zm(e){let t=tc.get(e);if(t!=null)return t;const s=new Intl.DateTimeFormat(e).formatToParts(new Date).find(r=>r.type==="literal");return t=s?s.value:"/",tc.set(e,t),t}var nc=e=>e!=null&&e.length===4,Jm=e=>e!=null&&parseFloat(e)<=12,Xm=e=>e!=null&&parseFloat(e)<=31;function Qm(e,t,n){const s=ey(t,n);let{year:r,month:o,day:i}=ty(s,e)??{};if(r!=null||o!=null||i!=null){const l=new Date;r||(r=l.getFullYear().toString()),o||(o=(l.getMonth()+1).toString()),i||(i=l.getDate().toString())}if(nc(r)||(r=Um(r)),nc(r)&&Jm(o)&&Xm(i))return new qe(+r,+o,+i);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new qe(l.getFullYear(),l.getMonth()+1,l.getDate())}}function ey(e,t){return new Ve(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:r,value:o})=>r==="literal"?`${o}?`:`((?!=<${r}>)\\d+)?`).join("")}function ty(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(s=>{const r=s.match(/<(.+)>/);return!r||r.length<=0?null:s.match(/<(.+)>/)?.[1]}).reduce((s,r,o)=>(r&&(n&&n.length>o?s[r]=n[o+1]:s[r]=null),s),{})}function sc(e,t,n){const s=Kt(Ll(n));switch(e){case"thisWeek":return[At(s,t),Ga(s,t)];case"thisMonth":return[ft(s),s];case"thisQuarter":return[ft(s).add({months:-((s.month-1)%3)}),s];case"thisYear":return[gs(s),s];case"last3Days":return[s.add({days:-2}),s];case"last7Days":return[s.add({days:-6}),s];case"last14Days":return[s.add({days:-13}),s];case"last30Days":return[s.add({days:-29}),s];case"last90Days":return[s.add({days:-89}),s];case"lastMonth":return[ft(s.add({months:-1})),Bo(s.add({months:-1}))];case"lastQuarter":return[ft(s.add({months:-((s.month-1)%3)-3})),Bo(s.add({months:-((s.month-1)%3)-1}))];case"lastWeek":return[At(s,t).add({weeks:-1}),Ga(s,t).add({weeks:-1})];case"lastYear":return[gs(s.add({years:-1})),rm(s.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var ny=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,sy=e=>e.ids?.root??`datepicker:${e.id}`,ry=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,Yo=e=>e.ids?.content??`datepicker:${e.id}:content`,fo=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,oy=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,iy=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,ay=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,ed=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,td=e=>e.ids?.control??`datepicker:${e.id}:control`,rc=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,nd=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,sd=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,rd=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,od=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,oc=(e,t)=>ph(hn(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),zs=e=>e.getById(nd(e)),hn=e=>e.getById(Yo(e)),ts=e=>hh(id(e),"[data-part=input]"),cy=e=>e.getById(od(e)),ly=e=>e.getById(rd(e)),dy=e=>e.getById(ed(e)),ic=e=>e.getById(sd(e)),id=e=>e.getById(td(e)),ac=e=>{const t=ts(e);if(t.length===0){zs(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(o=>o.value!==""),s=Math.max(n,0),r=t[s];r?.focus({preventScroll:!0}),r?.setSelectionRange(r.value.length,r.value.length)};function Js(e){const[t,n]=e;let s;return!t||!n?s=e:s=t.compare(n)<=0?e:[n,t],s}function dn(e,t){const[n,s]=t;return!n||!s?!1:n.compare(e)<=0&&s.compare(e)>=0}function Hs(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function uy(e,t){return new Ve(e).formatToParts(new Date).map(n=>t[n.type]??n.value).join("")}var cc=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),fy={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.inRange?`In range. ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e,t){return t?`Switch to ${t} view`:`${e} view`},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return ko(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return ko(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function vt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Mi(e){return e===0?"day":e===1?"month":"year"}function Ai(e,t,n){return Mi(sf(vt(e,0),vt(t,0),vt(n,2)))}function hy(e,t){return vt(e,0)>vt(t,0)}function py(e,t){return vt(e,0)<vt(t,0)}function ad(e,t,n){const s=vt(e,0)+1;return Ai(Mi(s),t,n)}function gy(e,t,n){const s=vt(e,0)-1;return Ai(Mi(s),t,n)}var my=["day","month","year"];function yy(e){my.forEach(t=>e(t))}var vy=f1(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale,e.timeZone,e.selectionMode],([e],t)=>{const{startValue:n,endValue:s,locale:r,timeZone:o,selectionMode:i}=t;if(e==="year"){const u=vn(n.year),g=u.at(0).toString(),p=u.at(-1).toString();return{start:g,end:p,formatted:`${g} - ${p}`}}if(e==="month"){const u=new Ve(r,{year:"numeric",timeZone:o,calendar:n.calendar.identifier}),g=u.format(n.toDate(o)),p=u.format(s.toDate(o)),h=i==="range"?`${g} - ${p}`:g;return{start:g,end:p,formatted:h}}const a=new Ve(r,{month:"long",year:"numeric",timeZone:o,calendar:n.calendar.identifier}),c=a.format(n.toDate(o)),l=a.format(s.toDate(o)),f=i==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:f}});function by(e,t){const{state:n,context:s,prop:r,send:o,computed:i,scope:a}=e,c=s.get("startValue"),l=i("endValue"),f=s.get("value"),u=s.get("focusedValue"),g=s.get("hoveredValue"),p=g?Js([f[0],g]):[],h=!!r("disabled"),d=!!r("readOnly"),m=!!r("invalid"),v=i("isInteractive"),C=f.length===0,L=r("min"),O=r("max"),w=r("locale"),S=r("timeZone"),b=r("startOfWeek"),E=n.matches("focused"),k=n.matches("open"),x=r("selectionMode")==="range",y=r("selectionMode")==="multiple",A=r("isDateUnavailable"),D=r("maxSelectedDates"),H=y&&D!=null&&f.length>=D,P=s.get("currentPlacement"),F=P?Qc(P):void 0,B=el({...r("positioning"),placement:P}),j=zm(w),Y=Sc(fy,r("translations"));function Me(M=c){const $=r("fixedWeeks")?6:void 0;return Dm(M,w,$,b)}function Le(M={}){const{format:$}=M;return Fm(w,$,u).map((T,R)=>{const z=R+1,de=u.set({month:z}),ue=ze(de,L,O);return{label:T,value:z,disabled:ue}})}function Wt(){const M=_m(u,L,O);return Hm(M).map(T=>({label:T.toString(),value:T,disabled:!Ur(T,L?.year,O?.year)}))}function _e(M){return Ja(M,A,w,L,O)}function Ae(M){const $=c??as(S,u.calendar);o({type:"FOCUS.SET",value:$.set({month:M})})}function Vn(M){const $=c??as(S,u.calendar);o({type:"FOCUS.SET",value:$.set({year:M})})}function Be(M){const{value:$,disabled:T}=M,R=u.set({year:$}),de=!vn(c.year).includes($),ue=Ur($,L?.year,O?.year),N=x&&dn(R,f),_=x&&f[0]&&Gn(R,f[0]),K=x&&f[1]&&Gn(R,f[1]),te=x&&p.length>0,ae=te&&dn(R,p),ne=te&&p[0]&&Gn(R,p[0]),oe=te&&p[1]&&Gn(R,p[1]),Ue={focused:u.year===M.value,selectable:ue,outsideRange:de,selected:!!f.find(Ke=>Ke&&Ke.year===$),valueText:$.toString(),inRange:N||ae,firstInRange:!!_,lastInRange:!!K,inHoveredRange:!!ae,firstInHoveredRange:!!ne,lastInHoveredRange:!!oe,value:R,get disabled(){return T||!Ue.selectable}};return Ue}function jt(M){const{value:$,disabled:T}=M,R=u.set({month:$}),z=Xa(w,S,u),de=x&&dn(R,f),ue=x&&f[0]&&qn(R,f[0]),N=x&&f[1]&&qn(R,f[1]),_=x&&p.length>0,K=_&&dn(R,p),te=_&&p[0]&&qn(R,p[0]),ae=_&&p[1]&&qn(R,p[1]),ne={focused:u.month===M.value,selectable:!ze(R,L,O),selected:!!f.find(oe=>oe&&oe.month===$&&oe.year===u.year),valueText:z.format(R.toDate(S)),inRange:de||K,firstInRange:!!ue,lastInRange:!!N,inHoveredRange:!!K,firstInHoveredRange:!!te,lastInHoveredRange:!!ae,outsideRange:!1,value:R,get disabled(){return T||!ne.selectable}};return ne}function st(M){const{value:$,disabled:T,visibleRange:R=i("visibleRange")}=M,z=Yl(w,S,u),de=Ti(i("visibleDuration")),ue=r("outsideDaySelectable"),N=R.start.add(de).subtract({days:1}),_=ze($,R.start,N),K=x&&dn($,f),te=x&&f[0]&&Ie($,f[0]),ae=x&&f[1]&&Ie($,f[1]),ne=x&&p.length>0,oe=ne&&dn($,p),Ue=ne&&p[0]&&Ie($,p[0]),Ke=ne&&p[1]&&Ie($,p[1]),ve=f.some(on=>on!=null&&Ie($,on)),Ze={invalid:ze($,L,O),disabled:T||!ue&&_||ze($,L,O)||H&&!ve,selected:ve,unavailable:Ja($,A,w,L,O)&&!T,outsideRange:_,today:em($,S),weekend:cm($,w),value:$,valueText:z.format($.toDate(S)),get focused(){return u!=null&&Ie($,u)&&(!Ze.outsideRange||ue)},get selectable(){return!Ze.disabled&&!Ze.unavailable},inRange:K||oe,firstInRange:te,lastInRange:ae,inHoveredRange:oe,firstInHoveredRange:Ue,lastInHoveredRange:Ke};return Ze}function rn(M){const{view:$="day",id:T}=M;return[$,T].filter(Boolean).join(" ")}return{focused:E,open:k,disabled:h,invalid:m,readOnly:d,inline:!!r("inline"),numOfMonths:r("numOfMonths"),showWeekNumbers:!!r("showWeekNumbers"),selectionMode:r("selectionMode"),maxSelectedDates:D,isMaxSelected:H,view:s.get("view"),getRangePresetValue(M){return sc(M,w,S)},getWeekNumber(M){const $=M[0];return $?Qa($,w):0},getDaysInWeek(M,$=c){return zl(M,$,w,b)},getOffset(M){const $=c.add(M),T=l.add(M),R=Xa(w,S,u);return{visibleRange:{start:$,end:T},weeks:Me($),visibleRangeText:{start:R.format($.toDate(S)),end:R.format(T.toDate(S))}}},getMonthWeeks:Me,isUnavailable:_e,weeks:Me(),weekDays:Nm(c,b,S,w),visibleRangeText:i("visibleRangeText"),value:f,valueAsDate:f.filter(M=>M!=null).map(M=>M.toDate(S)),valueAsString:i("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(S),focusedValueAsString:r("format")(u,{locale:w,timeZone:S}),visibleRange:i("visibleRange"),selectToday(){const M=De(as(S,u.calendar),L,O);o({type:"VALUE.SET",value:[M]})},setValue(M){const $=M.map(T=>De(T,L,O));o({type:"VALUE.SET",value:$})},setTime(M,$=0){const T=Array.from(f);let R=T[$];R&&("hour"in R||(R=He(R)),R=R.set({hour:M.hour??("hour"in R?R.hour:0),minute:M.minute??("minute"in R?R.minute:0),second:M.second??("second"in R?R.second:0),millisecond:M.millisecond??("millisecond"in R?R.millisecond:0)}),T[$]=De(R,L,O),o({type:"VALUE.SET",value:T}))},clearValue(M={}){const{focus:$=!0}=M;o({type:"VALUE.CLEAR",focus:$})},setFocusedValue(M){o({type:"FOCUS.SET",value:M})},setOpen(M){r("inline")||o({type:M?"OPEN":"CLOSE",replaces:"open"})},focusMonth:Ae,focusYear:Vn,getYears:Wt,getMonths:Le,getYearsGrid(M={}){const{columns:$=1}=M,T=vn(c.year).map(R=>({label:R.toString(),value:R,disabled:!Ur(R,L?.year,O?.year)}));return Xi(T,$)},getDecade(){const M=vn(c.year);return{start:M.at(0),end:M.at(-1)}},getMonthsGrid(M={}){const{columns:$=1,format:T}=M;return Xi(Le({format:T}),$)},format(M,$={month:"long",year:"numeric"}){return new Ve(w,{...$,calendar:M.calendar.identifier}).format(M.toDate(S))},setView(M){o({type:"VIEW.SET",view:M})},goToNext(){o({type:"GOTO.NEXT",view:s.get("view")})},goToPrev(){o({type:"GOTO.PREV",view:s.get("view")})},getRootProps(){return t.element({...ee.root.attrs,dir:r("dir"),id:sy(a),"data-state":k?"open":"closed","data-disabled":V(h),"data-readonly":V(d),"data-empty":V(C)})},getLabelProps(M={}){const{index:$=0}=M;return t.label({...ee.label.attrs,id:ny(a,$),dir:r("dir"),htmlFor:rc(a,$),"data-state":k?"open":"closed","data-index":$,"data-disabled":V(h),"data-readonly":V(d),"data-invalid":V(m)})},getControlProps(){return t.element({...ee.control.attrs,dir:r("dir"),id:td(a),"data-disabled":V(h),"data-placeholder-shown":V(C),"data-invalid":V(m)})},getRangeTextProps(){return t.element({...ee.rangeText.attrs,dir:r("dir")})},getContentProps(){return t.element({...ee.content.attrs,hidden:!k,dir:r("dir"),"data-state":k?"open":"closed","data-placement":P,"data-side":F,"data-inline":V(r("inline")),id:Yo(a),tabIndex:-1,role:"application","aria-label":Y.content})},getTableProps(M={}){const{view:$="day",columns:T=$==="day"?7:4}=M,R=rn(M);return t.element({...ee.table.attrs,role:"grid","data-columns":T,"aria-label":i("visibleRangeText").formatted,id:ry(a,R),"aria-readonly":be(d),"aria-disabled":be(h),"aria-multiselectable":be(r("selectionMode")!=="single"),"data-view":$,dir:r("dir"),tabIndex:-1,onKeyDown(z){if(z.defaultPrevented||h)return;const de={Enter(){v&&($==="day"&&_e(u)||$==="month"&&!jt({value:u.month}).selectable||$==="year"&&!Be({value:u.year}).selectable||o({type:"TABLE.ENTER",view:$,columns:T,focus:!0}))},Space(N){de.Enter?.()},ArrowLeft(){o({type:"TABLE.ARROW_LEFT",view:$,columns:T,focus:!0})},ArrowRight(){o({type:"TABLE.ARROW_RIGHT",view:$,columns:T,focus:!0})},ArrowUp(){o({type:"TABLE.ARROW_UP",view:$,columns:T,focus:!0})},ArrowDown(){o({type:"TABLE.ARROW_DOWN",view:$,columns:T,focus:!0})},PageUp(N){o({type:"TABLE.PAGE_UP",larger:N.shiftKey,view:$,columns:T,focus:!0})},PageDown(N){o({type:"TABLE.PAGE_DOWN",larger:N.shiftKey,view:$,columns:T,focus:!0})},Home(){o({type:"TABLE.HOME",view:$,columns:T,focus:!0})},End(){o({type:"TABLE.END",view:$,columns:T,focus:!0})}},ue=de[So(z,{dir:r("dir")})];ue&&(ue(z),z.preventDefault(),z.stopPropagation())},onPointerLeave(){o({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){o({type:"TABLE.POINTER_DOWN",view:$})},onPointerUp(){o({type:"TABLE.POINTER_UP",view:$})}})},getTableHeadProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableHead.attrs,"aria-hidden":!0,dir:r("dir"),"data-view":$,"data-disabled":V(h)})},getTableHeaderProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableHeader.attrs,dir:r("dir"),"data-view":$,"data-disabled":V(h)})},getTableBodyProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableBody.attrs,"data-view":$,"data-disabled":V(h)})},getTableRowProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableRow.attrs,"aria-disabled":be(h),"data-disabled":V(h),"data-view":$})},getWeekNumberHeaderCellProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableCell.attrs,scope:"col","aria-label":Y.weekColumnHeader,"data-view":$,"data-type":"week-number","data-disabled":V(h)})},getWeekNumberCellProps(M){const{weekIndex:$,week:T}=M,R=T[0]?Qa(T[0],w):0;return t.element({...ee.tableCell.attrs,role:"rowheader","aria-label":Y.weekNumberCell?.(R),"data-view":"day","data-week-index":$,"data-type":"week-number","data-disabled":V(h)})},getDayTableCellState:st,getDayTableCellProps(M){const{value:$}=M,T=st(M);return t.element({...ee.tableCell.attrs,role:"gridcell","aria-disabled":be(!T.selectable),"aria-selected":T.selected||T.inRange,"aria-invalid":be(T.invalid),"aria-current":T.today?"date":void 0,"data-value":$.toString()})},getDayTableCellTriggerProps(M){const{value:$}=M,T=st(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":Y.dayCell(T),"aria-disabled":be(!T.selectable),"aria-invalid":be(T.invalid),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$.toString(),"data-view":"day","data-today":V(T.today),"data-focus":V(T.focused),"data-unavailable":V(T.unavailable),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-outside-range":V(T.outsideRange),"data-weekend":V(T.weekend),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"day",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&Qg($,g)||o({type:"CELL.POINTER_MOVE",cell:"day",value:$,focus:z,outsideRange:T.outsideRange})}:void 0})},getMonthTableCellState:jt,getMonthTableCellProps(M){const{value:$,columns:T}=M,R=jt(M);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getMonthTableCellTriggerProps(M){const{value:$}=M,T=jt(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"month","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"month",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&qn(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"month",value:T.value,focus:z})}:void 0})},getYearTableCellState:Be,getYearTableCellProps(M){const{value:$,columns:T}=M,R=Be(M);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getYearTableCellTriggerProps(M){const{value:$}=M,T=Be(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"year","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"year",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable||T.outsideRange)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&Gn(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"year",value:T.value,focus:z})}:void 0})},getNextTriggerProps(M={}){const{view:$="day"}=M,T=h||!i("isNextVisibleRangeValid");return t.button({...ee.nextTrigger.attrs,dir:r("dir"),id:iy(a,$),type:"button","aria-label":Y.nextTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.NEXT",view:$})}})},getPrevTriggerProps(M={}){const{view:$="day"}=M,T=h||!i("isPrevVisibleRangeValid");return t.button({...ee.prevTrigger.attrs,dir:r("dir"),id:oy(a,$),type:"button","aria-label":Y.prevTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.PREV",view:$})}})},getClearTriggerProps(){return t.button({...ee.clearTrigger.attrs,id:ed(a),dir:r("dir"),type:"button","aria-label":Y.clearTrigger,hidden:!f.length,onClick(M){M.defaultPrevented||v&&o({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ee.trigger.attrs,id:nd(a),dir:r("dir"),type:"button","data-placement":P,"data-side":F,"aria-label":Y.trigger(k),"aria-controls":Yo(a),"aria-expanded":k,"data-state":k?"open":"closed","data-placeholder-shown":V(C),"aria-haspopup":"grid",disabled:h,onClick(M){M.defaultPrevented||v&&o({type:"TRIGGER.CLICK"})}})},getViewProps(M={}){const{view:$="day"}=M;return t.element({...ee.view.attrs,"data-view":$,hidden:s.get("view")!==$})},getViewTriggerProps(M={}){const{view:$="day"}=M,T=ad($,r("minView"),r("maxView")),R=T!==$,z=h||!R;return t.button({...ee.viewTrigger.attrs,"data-view":$,dir:r("dir"),id:ay(a,$),type:"button",disabled:z,"data-disabled":V(z),"aria-label":Y.viewTrigger($,R?T:void 0),onClick(de){de.defaultPrevented||v&&o({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(M={}){const{view:$="day"}=M;return t.element({...ee.viewControl.attrs,"data-view":$,dir:r("dir")})},getInputProps(M={}){const{index:$=0,fixOnBlur:T=!0}=M;return t.input({...ee.input.attrs,id:rc(a,$),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:r("dir"),name:r("name"),"data-index":$,"data-state":k?"open":"closed","data-placeholder-shown":V(C),readOnly:d,disabled:h,required:r("required"),"aria-invalid":be(m),"data-invalid":V(m),placeholder:r("placeholder")||uy(w,Y.placeholder(w)),defaultValue:i("valueAsString")[$],onBeforeInput(R){const{data:z}=ai(R);Ql(z,j,w)||R.preventDefault()},onClick(R){R.defaultPrevented||r("openOnClick")&&v&&o({type:"OPEN",src:"input.click"})},onFocus(){o({type:"INPUT.FOCUS",index:$})},onBlur(R){const z=R.currentTarget.value.trim();o({type:"INPUT.BLUR",value:z,index:$,fixOnBlur:T})},onKeyDown(R){if(R.defaultPrevented||!v)return;const de={Enter(ue){Vf(ue)||_e(u)||ue.currentTarget.value.trim()!==""&&o({type:"INPUT.ENTER",value:ue.currentTarget.value,index:$})}}[R.key];de&&(de(R),R.preventDefault())},onInput(R){const z=R.currentTarget.value;o({type:"INPUT.CHANGE",value:Zm(z,j,w),index:$})}})},getMonthSelectProps(){return t.select({...ee.monthSelect.attrs,id:rd(a),"aria-label":Y.monthSelect,disabled:h,dir:r("dir"),defaultValue:c.month,onChange(M){Ae(Number(M.currentTarget.value))}})},getYearSelectProps(){return t.select({...ee.yearSelect.attrs,id:od(a),disabled:h,"aria-label":Y.yearSelect,dir:r("dir"),defaultValue:c.year,onChange(M){Vn(Number(M.currentTarget.value))}})},getPositionerProps(){return t.element({id:sd(a),...ee.positioner.attrs,dir:r("dir"),style:B.floating})},getPresetTriggerProps(M){const $=Array.isArray(M.value)?M.value:sc(M.value,w,S),T=$.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...ee.presetTrigger.attrs,"aria-label":Y.presetTrigger(T),type:"button",onClick(R){R.defaultPrevented||v&&o({type:"PRESET.CLICK",value:$})}})}}}var ho="__live-region-debug__",wy="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;",Cy=100,ky=200,Ey={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function Sy(e={}){const{level:t="polite",document:n=document,root:s,delay:r=0,debug:o=!1}=e,i=n.defaultView??window,a=()=>(typeof s=="function"?s():s)??n.body;let c;function l(){if(!o)return;let m=n.getElementById(ho);return m||(m=n.createElement("div"),m.id=ho,m.dataset.liveAnnouncerDebug="true",m.setAttribute("aria-hidden","true"),m.style.cssText=wy,a().appendChild(m),m)}function f(){const m=n.createElement("span");return m.dataset.liveAnnouncer="true",m.setAttribute("aria-live",t),m.setAttribute("aria-atomic","true"),m.setAttribute("role",t==="assertive"?"alert":"status"),Object.assign(m.style,Ey),a().appendChild(m),u=Date.now()+ky,m}let u=0,g=f();function p(){i.clearTimeout(c),c=void 0}function h(m,v=r){p(),g?.isConnected||(g=f());const C=g;C.textContent="",c=i.setTimeout(()=>{c=void 0,C.textContent=m;const L=l();L&&(L.textContent=m)},Math.max(v,Cy,u-Date.now()))}function d(){p(),g?.remove(),g=null,o&&n.getElementById(ho)?.remove()}return{announce:h,cancel:p,destroy:d,toJSON(){return"live-region"}}}var{and:Ee}=il();function xy(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let s=0;s<n;s++)if(!Lt(e[s],t[s]))return!1;return!0}function Ws(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var $y=al({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",s=e.selectionMode||"single",r=e.numOfMonths||1;let o;if(e.createCalendar){const h=new Intl.DateTimeFormat(t).resolvedOptions().calendar;h!=="gregory"&&h!=="iso8601"&&(o=e.createCalendar(h))}const i=p=>!o||p.calendar.identifier===o.identifier?p:me(p,o),a=e.defaultValue?Hs(e.defaultValue).map(p=>De(i(p),e.min,e.max)):void 0,c=e.value?Hs(e.value).map(p=>De(i(p),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||as(n,o);l=De(i(l),e.min,e.max);const f=e.minView||"day",u=e.maxView||"year",g=Ai(e.defaultView||e.view||f,f,u);return{locale:t,numOfMonths:r,timeZone:n,selectionMode:s,minView:f,maxView:u,outsideDaySelectable:!1,closeOnSelect:!0,format(p,{locale:h,timeZone:d}){return new Ve(h,{timeZone:d,day:"2-digit",month:"2-digit",year:"numeric",calendar:o?.identifier}).format(p.toDate(d))},parse(p,{locale:h,timeZone:d}){return Qm(p,h,d)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],defaultView:g,positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("inline")||(e("open")??e("defaultOpen"))?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:Lt,hash:s=>s.toString(),sync:!0,onChange(s){const r=n(),o=r.get("view"),i=r.get("value"),a=Ws(i,e);e("onFocusChange")?.({value:i,valueAsString:a,view:o,focusedValue:s})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:xy,hash:s=>s.map(r=>r?.toString()??"").join(","),onChange(s){const r=n(),o=Ws(s,e);e("onValueChange")?.({value:s,valueAsString:o,view:r.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:Lt})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(s){e("onViewChange")?.({view:s})}})),startValue:t(()=>{const s=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:za(s,"start",{months:e("numOfMonths")},e("locale")),isEqual:Lt,hash:r=>r.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>ql(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>vy({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!Am(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!Om(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>Ws(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:s,computed:r}){e([()=>t("locale")],()=>{s(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{s(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{s(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{s(["syncInputValue"])}),e([()=>n.hash("value")],()=>{s(["syncInputElement"])}),e([()=>r("valueAsString").toString()],()=>{s(["announceValueText"])}),e([()=>n.get("view")],()=>{s(["focusActiveCell"])}),e([()=>t("open")],()=>{s(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],entry:["resumeRangeSelection"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate"],on:{"CONTROLLED.CLOSE":[{guard:Ee("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["restoreFocusToTrigger"]},{guard:"shouldRestoreFocus",target:"focused",actions:["restoreFocusToInput"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","restoreFocusToInput"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Ee("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","restoreFocusToTrigger"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","restoreFocusToInput"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","restoreFocusToTrigger"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>hy(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:e=>{const{context:t,prop:n,event:s}=e,r=n("maxSelectedDates");if(r==null)return!0;const o=t.get("value"),i=ns(e,s.value??t.get("focusedValue"));return o.some(c=>Lt(c,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const s=id(n);return Po(s,()=>ic(n),{...t("positioning"),defer:!0,onComplete(o){e.set("currentPlacement",o.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",Sy({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:s}){return s("inline")?void 0:dl(()=>hn(e),{type:"popover",defer:!0,getRootNode:e.getRootNode,layerStyleTargets:[()=>ic(e)],exclude:[...ts(e),zs(e),dy(e)],onInteractOutside(o){n.set("restoreFocus",!o.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(o){o.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable",focusVisible:!0})}})}},actions:{setNextView({context:e,prop:t}){const n=ad(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=gy(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const s=e.get("value"),r=t("locale"),o=t("timeZone");let i;if(t("selectionMode")==="range"){const[a,c]=s;a&&c?i=Fs(a,c,r,o):a?i=Fs(a,null,r,o):c?i=Fs(c,null,r,o):i=""}else i=s.map(a=>Fs(a,null,r,o)).filter(Boolean).join(",");n.get("announcer")?.announce(i,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){fh({target:hn(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Hc({doc:e.getDoc(),target:hn(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&re(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){we(()=>{ts(e).forEach((s,r)=>{Ls(s,t("valueAsString")[r]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;re(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;re(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;re(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;re(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const s=t.value.map(r=>De(r,n("min"),n("max")));e.set("value",s)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,s=Array.from(t.get("value")),r=t.get("activeIndex"),o=s[r],i=ns(e,n.value??t.get("focusedValue"));s[r]=js(o,i),t.set("value",Js(s))},resetSelection(e){const{context:t,event:n}=e,s=t.get("value")[0],r=ns(e,n.value??t.get("focusedValue"));t.set("value",[js(s,r)])},toggleSelectedDate(e){const{context:t,event:n}=e,s=ns(e,n.value??t.get("focusedValue")),r=t.get("value"),o=r.findIndex(i=>Lt(i,s));if(o===-1){const i=[...r,s];t.set("value",Hs(i))}else{const i=Array.from(r);i.splice(o,1),t.set("value",Hs(i))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),s=e.get("activeIndex"),r=n[s],o=e.get("focusedValue").copy();n[s]=js(r,o),e.set("value",Js(n));const i=t("valueAsString");e.set("inputValue",i[s])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});re(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});re(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});re(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});re(e,n)},focusNextPage(e){const{context:t,computed:n,prop:s}=e,r=Jl(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));_s(e,r)},focusPreviousPage(e){const{context:t,computed:n,prop:s}=e,r=Xl(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));_s(e,r)},focusSectionStart(e){const{context:t}=e;re(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;re(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=qm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&_s(e,o)},focusPreviousSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=Gm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&_s(e,o)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});re(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});re(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});re(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});re(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,s=t.get("focusedValue").calendar;re(e,as(n("timeZone"),s))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({months:n.columns});re(e,s)},focusNextMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({months:n.columns});re(e,s)},focusPreviousYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({years:n.columns});re(e,s)},focusNextYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({years:n.columns});re(e,s)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMinimumMonthInYear?.(n)??1;re(e,n.set({month:s}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMonthsInYear(n);re(e,n.set({month:s}))},focusFirstYear(e){const{context:t}=e,n=vn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[0]});re(e,s)},focusLastYear(e){const{context:t}=e,n=vn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[n.length-1]});re(e,s)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},resumeRangeSelection({context:e,prop:t}){t("selectionMode")==="range"&&e.get("value").length===1&&e.set("activeIndex",1)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&we(()=>{const s=t.get("view");oc(e,s)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&we(()=>{const s=t.get("view");oc(e,s)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!(t.type.startsWith("TABLE.ARROW")||["TABLE.ENTER","TABLE.HOME","TABLE.END","TABLE.PAGE_UP","TABLE.PAGE_DOWN"].includes(t.type))||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},restoreFocusToTrigger({scope:e,event:t}){const n=hn(e),s=Ly(t);we(()=>{na(e.getActiveElement(),[n])||zs(e)?.focus(s)})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&we(()=>{const[n]=ts(e);(n??zs(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){we(()=>ac(e))},restoreFocusToInput({scope:e}){const t=hn(e);we(()=>{na(e.getActiveElement(),[t])||ac(e)})},syncMonthSelectElement({scope:e,context:t}){const n=ly(e);Ls(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=cy(e);Ls(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const s=ts(e),r=n.index??t.get("activeIndex");Ls(s[r],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!r||!cc(r)||re(e,r)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!r||!cc(r))&&t.value&&(r=e.get("focusedValue").copy()),!r)return;r=De(r,n("min"),n("max"));const o=Array.from(e.get("value"));o[t.index]=js(o[t.index],r);const i=Js(o);e.set("value",i);const a=Ws(i,n);e.set("inputValue",a[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const s=e.get("focusedValue");if(!ze(s,e.get("startValue"),t("endValue")))return;const o=za(s,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",o)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),ns=(e,t)=>{const{context:n,prop:s}=e,r=n.get("view");let o=typeof t=="number"?n.get("focusedValue").set({[r]:t}):t;return yy(i=>{py(i,s("minView"))&&(o=o.set({[i]:i==="day"?1:0}))}),o},js=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let s=t;return"hour"in t||(n?s=Vl(He(t),e.timeZone):s=He(t)),s.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function re(e,t){const{context:n,prop:s,computed:r}=e;if(!t)return;const o=ns(e,t);if(Lt(n.get("focusedValue"),o))return;const a=ks(r("visibleDuration"),s("locale"),s("min"),s("max"))({focusedDate:o,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function _s(e,t){const{context:n}=e;n.set("startValue",t.startDate);const s=n.get("focusedValue");Lt(s,t.focusedDate)||n.set("focusedValue",t.focusedDate)}function Ly(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function cd(e){return Array.isArray(e)?e.map(t=>cd(t)):e instanceof Date?new qe(e.getFullYear(),e.getMonth()+1,e.getDate()):km(e)}const po=e=>W(`chevron-${e}`),go=e=>{try{return/^\d{4}-\d{2}-\d{2}$/.test(e)?cd(e):void 0}catch{return}};function Iy(e,t,n){e.innerHTML=`<div class="date-control"><button class="icon-button date-trigger" type="button" aria-label="Custom date range" title="Custom date range">${W("calendar")}</button></div>
99
+ `);return{text:C.slice(0,1800),shortened:C.length>1800||!!v.partial}}return{clear:h,show(v,C,L,O,w,S){const b=`${C}:${L}:${v.id}`,E=r!==b;E&&h(),r=b,a=v,c=w,l=S,f=O;const k=s.get(b);d(k?.text||v.preview,k?k.shortened?"Content preview":"":"Loading message…"),!(!E||k)&&(i=setTimeout(async()=>{const x=new AbortController;o=x;try{const y=await n.read(C,{item:v.id,revision:L,filter:v.kind==="commit"?"tools":"messages"},x.signal);if(x.signal.aborted||r!==b||y.selected?.id!==v.id)return;const A=m(y.selected);s.set(b,A),s.size>20&&s.delete(s.keys().next().value),d(A.text,A.shortened?"Content preview":"")}catch{!x.signal.aborted&&r===b&&d(v.preview,"Saved excerpt · open for details")}},120))},dispose(){h(),s.clear()}}}const Vg=e=>e.length!==40&&e.length!==64;function Ng(e,t,n){const s=new AbortController,r=document.createElement("div");r.className="section-label",r.textContent="Commits";const o=document.createElement("span");r.append(o);const i=document.createElement("p");i.className="coverage-note commit-coverage",i.textContent="Loading commits…";const a=document.createElement("div"),c=document.createElement("button");c.className="load-more",c.hidden=!0,e.replaceChildren(r,i,a,c);let l,f;async function u(){c.disabled=!0;try{const g=new URLSearchParams({limit:"30",...l?{cursor:l}:{}}),p=await gt(`/api/sessiongraph/session/${encodeURIComponent(t)}/commits?${g}`,"Could not load commits.",{signal:AbortSignal.any([s.signal,AbortSignal.timeout(3e4)])});if(s.signal.aborted)return;f=p.revision,o.textContent=p.total?p.total.toLocaleString():"",i.hidden=p.total>0,i.textContent=p.coverage.state==="pending"?"Commit indexing pending.":p.coverage.state==="unavailable"?"Commit history unavailable.":"No commits found.";for(const h of p.items){const d=document.createElement("button");d.className="relation";const m=document.createElement("span"),v=document.createElement("strong"),C=document.createElement("small");v.textContent=`${h.sha.slice(0,12)} · ${h.operation}`,C.textContent=`${h.occurredAt===null?"Time not recorded":new Date(h.occurredAt).toLocaleString()} · ${h.repositoryPath}`,d.title=`${h.sha}${Vg(h.sha)?" (abbreviated)":""} — inspect execution evidence`,m.append(v,C),d.append(m),d.addEventListener("click",()=>n(h.evidenceEventID,f),{signal:s.signal}),a.append(d)}l=p.nextCursor||void 0,c.hidden=!l,c.textContent="Load more commits"}catch(g){if(s.signal.aborted)return;o.textContent="",i.hidden=!1,i.textContent=g instanceof Error?g.message:"Commit index unavailable.",l=void 0,a.replaceChildren(),c.hidden=!1,c.textContent="Reload commits"}finally{c.disabled=!1}}return c.addEventListener("click",()=>{u()},{signal:s.signal}),u(),()=>s.abort()}function fe(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)}function fn(e,t,n,s,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ps,cn,Oe,ln,Rs,so,Ds;const Ua="__TAURI_TO_IPC_KEY__";function Fg(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class fv{constructor(t){Ps.add(this),cn.set(this,void 0),Oe.set(this,0),ln.set(this,[]),Rs.set(this,void 0),fn(this,cn,t||(()=>{})),this.id=Fg(n=>{const s=n.index;if("end"in n){s==fe(this,Oe,"f")?this.cleanupCallback():fn(this,Rs,s);return}const r=n.message;if(s==fe(this,Oe,"f")){for(fe(this,Ps,"m",so).call(this,r),fn(this,Oe,fe(this,Oe,"f")+1);fe(this,Oe,"f")in fe(this,ln,"f");){const o=fe(this,ln,"f")[fe(this,Oe,"f")];fe(this,Ps,"m",so).call(this,o),delete fe(this,ln,"f")[fe(this,Oe,"f")],fn(this,Oe,fe(this,Oe,"f")+1)}fe(this,Oe,"f")===fe(this,Rs,"f")&&this.cleanupCallback()}else fe(this,ln,"f")[s]=r})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){fn(this,cn,t)}get onmessage(){return fe(this,cn,"f")}[(cn=new WeakMap,Oe=new WeakMap,ln=new WeakMap,Rs=new WeakMap,Ps=new WeakSet,so=function(n){try{fe(this,cn,"f").call(this,n)}catch(s){queueMicrotask(()=>{throw s})}},Ua)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[Ua]()}}async function ki(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}class hv{get rid(){return fe(this,Ds,"f")}constructor(t){Ds.set(this,void 0),fn(this,Ds,t)}async close(){return ki("plugin:resources|close",{rid:this.rid})}async[(Ds=new WeakMap,Symbol.asyncDispose)](){await this.close()}}function is(){return!!(globalThis||window).isTauri}async function Hg(e,t){await ki("plugin:opener|open_url",{url:e,with:t})}function El(e){const t=new URL(e);if(!["https:","http:"].includes(t.protocol)||t.username||t.password)throw new Error("Choose a valid web link.");return t.href}async function Sl(e,t=Hg){await t(El(e))}class Wg{constructor(t=(...n)=>fetch(...n)){this.request=t}request;pages=new Map;pending=new Map;characters=0;generation=0;clear(){this.generation++,this.pages.clear(),this.characters=0;for(const t of this.pending.values())t.controller.abort();this.pending.clear()}read(t,n={},s){if(s?.aborted)return Promise.reject(s.reason);const r=n.filter||"all",o=JSON.stringify([t,n.revision,r,n.item,n.cursor]),i=n.revision?this.pages.get(o):void 0;if(i)return this.pages.delete(o),this.pages.set(o,i),Promise.resolve(i.page);let a=this.pending.get(o);if(!a){const l=new AbortController,f=this.generation,u=new URLSearchParams({filter:r,...n}),g=gt(`/api/sessiongraph/session/${encodeURIComponent(t)}/events?${u}`,"Could not load events.",{signal:AbortSignal.any([l.signal,AbortSignal.timeout(3e4)])},this.request).catch(d=>{throw d instanceof Tt&&d.status===409&&(!d.code||d.code==="STALE_CURSOR")&&this.clear(),d}).then(d=>{if(l.signal.aborted||f!==this.generation)throw new DOMException("Request cancelled","AbortError");if(d.sessionID!==t||n.revision&&d.revision!==n.revision)throw new Error("Saved history changed. Reload the event explorer.");const m=JSON.stringify([t,d.revision,r,n.item,n.cursor]),v=JSON.stringify(d).length;for(this.characters-=this.pages.get(m)?.characters||0,this.pages.delete(m),this.pages.set(m,{page:d,characters:v}),this.characters+=v;this.pages.size>20||this.characters>2e6;){const C=this.pages.keys().next().value;this.characters-=this.pages.get(C).characters,this.pages.delete(C)}return d});a={controller:l,promise:g,readers:0},this.pending.set(o,a);const p=a,h=()=>{this.pending.get(o)===p&&this.pending.delete(o)};g.then(h,h)}const c=a;return c.readers++,new Promise((l,f)=>{const u=()=>{p(),f(s.reason)};let g=!1;const p=()=>{g||(g=!0,s?.removeEventListener("abort",u),--c.readers===0&&this.pending.get(o)===c&&(this.pending.delete(o),c.controller.abort()))};s?.addEventListener("abort",u,{once:!0}),c.promise.then(h=>{g||(p(),l(h))},h=>{g||(p(),f(h))})})}}async function jg(){await ki("plugin:process|restart")}class _g{constructor(t,n,s=Date.now){this.backend=t,this.changed=n,this.now=s}backend;changed;now;state={phase:"hidden"};release;busy=!1;disposed=!1;downloaded=!1;installed=!1;lastCheck=-1/0;set(t){this.disposed||(this.state=t,this.changed(t))}async close(){const t=this.release;this.release=void 0,await t?.close().catch(()=>{})}async check(){if(!(this.disposed||this.busy||this.release||this.now()-this.lastCheck<5*6e4)){this.busy=!0,this.lastCheck=this.now();try{this.release=await this.backend.check()||void 0,this.release&&this.set({phase:"available",version:this.release.version})}catch{}finally{this.busy=!1,this.disposed&&await this.close()}}}async activate(){if(this.disposed||this.busy||!this.release)return;this.busy=!0;const{version:t}=this.release;let n=this.installed?"restart":this.downloaded?"install":"download";try{if(!this.downloaded){let s,r=0;this.set({phase:"downloading",version:t}),await this.release.download(o=>{o.event==="Started"&&(s=o.data.contentLength,r=0),o.event==="Progress"&&(r+=o.data.chunkLength),this.set({phase:"downloading",version:t,progress:s&&s>0?Math.min(99,Math.floor(r/s*100)):void 0})}),this.downloaded=!0,this.set({phase:"ready",version:t});return}if(this.installed||(this.set({phase:"installing",version:t}),await this.release.install(),this.installed=!0),this.disposed)return;n="restart",this.set({phase:"restarting",version:t}),await this.backend.restart()}catch(s){this.set({phase:"error",version:t,retry:n,error:String(s instanceof Error?s.message:s).slice(0,300)})}finally{this.busy=!1,this.disposed&&await this.close()}}dispose(){this.disposed=!0,this.busy||this.close()}}const Bg=W("arrow-down"),Ug=W("refresh-cw");function qg(e){const t=document.createElement("button");t.className="desktop-update glass",t.hidden=!0,t.type="button";const n=document.createElement("span");n.className="sr-only",n.role="status",n.setAttribute("aria-live","polite"),document.querySelector("#app").append(t,n);let s="";const r=l=>{const f=["downloading","installing","restarting"].includes(l.phase),u=l.phase==="ready"||l.phase==="error"&&l.retry!=="download",g=l.retry==="restart"?"Restart failed":l.retry==="install"?"Install failed":/\b(?:signature|verification)\b/i.test(l.error||"")?"Update verification failed":"Download failed",p=l.phase==="downloading"?l.progress===void 0?"Downloading":`${l.progress}%`:l.phase==="installing"?"Installing":l.phase==="restarting"?"Restarting":l.phase==="error"?`${g} · Retry`:u?"Restart":"Update",h=l.phase==="error"?p:l.phase==="restarting"?`Restarting SessionGraph ${l.version}`:u?`Restart to install SessionGraph ${l.version}`:`Update to SessionGraph ${l.version}`;t.hidden=l.phase==="hidden",t.disabled=f,t.dataset.phase=l.phase,t.setAttribute("aria-busy",String(f)),t.setAttribute("aria-label",h),t.title=h;const d=`${u||l.phase==="restarting"?Ug:Bg}<span>${p}</span>`;t.innerHTML!==d&&(t.innerHTML=d);const m=l.phase==="hidden"?"":l.phase==="downloading"?`Downloading SessionGraph ${l.version}`:h;m!==s&&(n.textContent=m,s=m)},o=new _g(e,r);t.addEventListener("click",()=>{o.activate()});const i=()=>{document.visibilityState==="visible"&&navigator.onLine&&o.check()},a=window.setTimeout(i,1e4),c=window.setInterval(i,240*6e4);return document.addEventListener("visibilitychange",i),window.addEventListener("online",i),{check:()=>o.check(),dispose(){clearTimeout(a),clearInterval(c),o.dispose(),t.remove(),n.remove(),document.removeEventListener("visibilitychange",i),window.removeEventListener("online",i)}}}function Gg(){return is()?qg({async check(){const{check:e}=await br(async()=>{const{check:n}=await import("./index-DZcMVUpG.js");return{check:n}},[]),t=await e({timeout:15e3});return t&&{version:t.version,download:n=>t.download(n,{timeout:10*6e4}),install:()=>t.install({restartAfterInstall:!0}),close:()=>t.close()}},async restart(){await jg()}}):{dispose(){}}}var Yg=pn("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),ee=Yg.build();function ro(e,t){return e-t*Math.floor(e/t)}const xl=1721426;function Vs(e,t,n,s){t=Ei(e,t);let r=t-1,o=-2;return n<=2?o=0:Zs(t)&&(o=-1),xl-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+o+s)}function Zs(e){return e%4===0&&(e%100!==0||e%400===0)}function Ei(e,t){return e==="BC"?1-t:t}function Kg(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const Zg={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Sn{fromJulianDay(t){let n=t,s=n-xl,r=Math.floor(s/146097),o=ro(s,146097),i=Math.floor(o/36524),a=ro(o,36524),c=Math.floor(a/1461),l=ro(a,1461),f=Math.floor(l/365),u=r*400+i*100+c*4+f+(i!==4&&f!==4?1:0),[g,p]=Kg(u),h=n-Vs(g,p,1,1),d=2;n<Vs(g,p,3,1)?d=0:Zs(p)&&(d=1);let m=Math.floor(((h+d)*12+373)/367),v=n-Vs(g,p,m,1)+1;return new qe(g,p,m,v)}toJulianDay(t){return Vs(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return Zg[Zs(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Zs(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const zg={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Ie(e,t){return t=me(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Jg(e,t){return t=me(t,e.calendar),e=ft(e),t=ft(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Xg(e,t){return t=me(t,e.calendar),e=gs(e),t=gs(t),e.era===t.era&&e.year===t.year}function Qg(e,t){return Rr(e.calendar,t.calendar)&&Ie(e,t)}function qn(e,t){return Rr(e.calendar,t.calendar)&&Jg(e,t)}function Gn(e,t){return Rr(e.calendar,t.calendar)&&Xg(e,t)}function Rr(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function em(e,t){return Ie(e,Dr(t))}const tm={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function $l(e,t,n){let s=e.calendar.toJulianDay(e),r=n?tm[n]:om(t),o=Math.ceil(s+1-r)%7;return o<0&&(o+=7),o}function Ll(e){return ht(Date.now(),e)}function Dr(e){return Kt(Ll(e))}function Il(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function nm(e,t){return qa(e)-qa(t)}function qa(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let oo=null,sm=!1;function Si(){return oo==null&&(oo=new Intl.DateTimeFormat().resolvedOptions().timeZone),oo}function Tl(){return sm}function ft(e){return e.subtract({days:e.day-1})}function Bo(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function gs(e){return ft(e.subtract({months:e.month-1}))}function rm(e){return Bo(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function At(e,t,n){let s=$l(e,t,n);return e.subtract({days:s})}function Ga(e,t,n){return At(e,t,n).add({days:6})}const Ya=new Map,io=new Map;function Ml(e){if(Intl.Locale){let n=Ya.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Ya.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function om(e){let t=io.get(e);if(!t){if(Intl.Locale){let s=new Intl.Locale(e);if("getWeekInfo"in s&&(t=s.getWeekInfo(),t))return io.set(e,t),t.firstDay}let n=Ml(e);if(e.includes("-fw-")){let s=e.split("-fw-")[1].split("-")[0];s==="mon"?t={firstDay:1}:s==="tue"?t={firstDay:2}:s==="wed"?t={firstDay:3}:s==="thu"?t={firstDay:4}:s==="fri"?t={firstDay:5}:s==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&zg[n]||0};io.set(e,t)}return t.firstDay}function im(e,t,n){let s=e.calendar.getDaysInMonth(e);return Math.ceil(($l(ft(e),t,n)+s)/7)}function Al(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Ol(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const am={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function cm(e,t){let n=e.calendar.toJulianDay(e),s=Math.ceil(n+1)%7;s<0&&(s+=7);let r=Ml(t),[o,i]=am[r]||[6,0];return s===o||s===i}function xn(e){e=me(e,new Sn);let t=Ei(e.era,e.year);return Pl(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Pl(e,t,n,s,r,o,i){let a=new Date;return a.setUTCHours(s,r,o,i),a.setUTCFullYear(e,t-1,n),a.getTime()}function Uo(e,t){if(t==="UTC")return 0;if(e>0&&t===Si()&&!Tl())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:s,day:r,hour:o,minute:i,second:a}=Rl(e,t);return Pl(n,s,r,o,i,a,0)-Math.floor(e/1e3)*1e3}const Ka=new Map;function Rl(e,t){let n=Ka.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Ka.set(t,n));let s=n.formatToParts(new Date(e)),r={};for(let o of s)o.type!=="literal"&&(r[o.type]=o.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const Za=864e5;function lm(e,t,n,s){return(n===s?[n]:[n,s]).filter(o=>dm(e,t,o))}function dm(e,t,n){let s=Rl(n,t);return e.year===s.year&&e.month===s.month&&e.day===s.day&&e.hour===s.hour&&e.minute===s.minute&&e.second===s.second}function dt(e,t,n="compatible"){let s=He(e);if(t==="UTC")return xn(s);if(t===Si()&&n==="compatible"&&!Tl()){s=me(s,new Sn);let c=new Date,l=Ei(s.era,s.year);return c.setFullYear(l,s.month-1,s.day),c.setHours(s.hour,s.minute,s.second,s.millisecond),c.getTime()}let r=xn(s),o=Uo(r-Za,t),i=Uo(r+Za,t),a=lm(s,t,r-o,r-i);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-o,r-i);case"compatible":case"later":return Math.max(r-o,r-i);case"reject":throw new RangeError("No such absolute time found")}}function Dl(e,t,n="compatible"){return new Date(dt(e,t,n))}function ht(e,t){let n=Uo(e,t),s=new Date(e+n),r=s.getUTCFullYear(),o=s.getUTCMonth()+1,i=s.getUTCDate(),a=s.getUTCHours(),c=s.getUTCMinutes(),l=s.getUTCSeconds(),f=s.getUTCMilliseconds();return new ms(r<1?"BC":"AD",r<1?-r+1:r,o,i,t,n,a,c,l,f)}function Kt(e){return new qe(e.calendar,e.era,e.year,e.month,e.day)}function He(e,t){let n=0,s=0,r=0,o=0;if("timeZone"in e)({hour:n,minute:s,second:r,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:s,second:r,millisecond:o}=t),new fr(e.calendar,e.era,e.year,e.month,e.day,n,s,r,o)}function me(e,t){if(Rr(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),s=e.copy();return s.calendar=t,s.era=n.era,s.year=n.year,s.month=n.month,s.day=n.day,Qt(s),s}function Vl(e,t,n){if(e instanceof ms)return e.timeZone===t?e:fm(e,t);let s=dt(e,t,n);return ht(s,t)}function um(e){let t=xn(e)-e.offset;return new Date(t)}function fm(e,t){let n=xn(e)-e.offset;return me(ht(n,t),e.calendar)}const Yn=36e5;function Vr(e,t){let n=e.copy(),s="hour"in n?mm(n,t):0;qo(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Go(n),Nl(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=s,hm(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){let i=n.calendar.isInverseEra?.(n);n.year=r,n.month=i?1:n.calendar.getMonthsInYear(n),n.day=i?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let o=n.calendar.getMonthsInYear(n);return n.month>o&&(n.month=o,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function qo(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Go(e){for(;e.month<1;)qo(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qo(e,1)}function hm(e){for(;e.day<1;)e.month--,Go(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Go(e)}function Nl(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function Qt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Nl(e)}function Fl(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Hl(e,t){return Vr(e,Fl(t))}function xi(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),Qt(n),n}function ur(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),gm(n),n}function pm(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ns(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ns(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ns(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ns(e.hour,24),t}function gm(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ns(e,t){let n=e%t;return n<0&&(n+=t),n}function mm(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,pm(e)}function $i(e,t,n,s){let r=e.copy();switch(t){case"era":{let o=e.calendar.getEras(),i=o.indexOf(e.era);if(i<0)throw new Error("Invalid era: "+e.era);i=pt(i,n,0,o.length-1,s?.round),r.era=o[i],Qt(r);break}case"year":r.calendar.isInverseEra?.(r)&&(n=-n),r.year=pt(e.year,n,-1/0,9999,s?.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e);break;case"month":r.month=pt(e.month,n,1,e.calendar.getMonthsInYear(e),s?.round);break;case"day":r.day=pt(e.day,n,1,e.calendar.getDaysInMonth(e),s?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(r),Qt(r),r}function Wl(e,t,n,s){let r=e.copy();switch(t){case"hour":{let o=e.hour,i=0,a=23;if(s?.hourCycle===12){let c=o>=12;i=c?12:0,a=c?23:11}r.hour=pt(o,n,i,a,s?.round);break}case"minute":r.minute=pt(e.minute,n,0,59,s?.round);break;case"second":r.second=pt(e.second,n,0,59,s?.round);break;case"millisecond":r.millisecond=pt(e.millisecond,n,0,999,s?.round);break;default:throw new Error("Unsupported field "+t)}return r}function pt(e,t,n,s,r=!1){if(r){e+=Math.sign(t),e<n&&(e=s);let o=Math.abs(t);t>0?e=Math.ceil(e/o)*o:e=Math.floor(e/o)*o,e>s&&(e=n)}else e+=t,e<n?e=s-(n-e-1):e>s&&(e=n+(e-s-1));return e}function jl(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Vr(He(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=dt(r,e.timeZone)}else n=xn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let s=ht(n,e.timeZone);return me(s,e.calendar)}function ym(e,t){return jl(e,Fl(t))}function vm(e,t,n,s){switch(t){case"hour":{let r=0,o=23;if(s?.hourCycle===12){let h=e.hour>=12;r=h?12:0,o=h?23:11}let i=He(e),a=me(ur(i,{hour:r}),new Sn),c=[dt(a,e.timeZone,"earlier"),dt(a,e.timeZone,"later")].filter(h=>ht(h,e.timeZone).day===a.day)[0],l=me(ur(i,{hour:o}),new Sn),f=[dt(l,e.timeZone,"earlier"),dt(l,e.timeZone,"later")].filter(h=>ht(h,e.timeZone).day===l.day).pop(),u=xn(e)-e.offset,g=Math.floor(u/Yn),p=u%Yn;return u=pt(g,n,Math.floor(c/Yn),Math.floor(f/Yn),s?.round)*Yn+p,me(ht(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Wl(e,t,n,s);case"era":case"year":case"month":case"day":{let r=$i(He(e),t,n,s),o=dt(r,e.timeZone);return me(ht(o,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function bm(e,t,n){let s=He(e),r=ur(xi(s,t),t);if(r.compare(s)===0)return e;let o=dt(r,e.timeZone,n);return me(ht(o,e.timeZone),e.calendar)}const wm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,Cm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function km(e){let t=e.match(wm);if(!t)throw Cm.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new qe(ao(t[1],0,9999),ao(t[2],1,12),1);return n.day=ao(t[3],1,n.calendar.getDaysInMonth(n)),n}function ao(e,t,n){let s=Number(e);if(s<t||s>n)throw new RangeError(`Value out of range: ${t} <= ${s} <= ${n}`);return s}function Em(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function _l(e){let t=me(e,new Sn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Bl(e){return`${_l(e)}T${Em(e)}`}function Sm(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4),r=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return r!==0&&(o+=`:${String(r).padStart(2,"0")}`),o}function xm(e){return`${Bl(e)}${Sm(e.offset)}[${e.timeZone}]`}function Li(e){let t=typeof e[0]=="object"?e.shift():new Sn,n;if(typeof e[0]=="string")n=e.shift();else{let i=t.getEras();n=i[i.length-1]}let s=e.shift(),r=e.shift(),o=e.shift();return[t,n,s,r,o]}class qe{#e;constructor(...t){let[n,s,r,o,i]=Li(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,Qt(this)}copy(){return this.era?new qe(this.calendar,this.era,this.year,this.month,this.day):new qe(this.calendar,this.year,this.month,this.day)}add(t){return Vr(this,t)}subtract(t){return Hl(this,t)}set(t){return xi(this,t)}cycle(t,n,s){return $i(this,t,n,s)}toDate(t){return Dl(this,t)}toString(){return _l(this)}compare(t){return Il(this,t)}}class fr{#e;constructor(...t){let[n,s,r,o,i]=Li(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Qt(this)}copy(){return this.era?new fr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new fr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Vr(this,t)}subtract(t){return Hl(this,t)}set(t){return xi(ur(this,t),t)}cycle(t,n,s){switch(t){case"era":case"year":case"month":case"day":return $i(this,t,n,s);default:return Wl(this,t,n,s)}}toDate(t,n){return Dl(this,t,n)}toString(){return Bl(this)}compare(t){let n=Il(this,t);return n===0?nm(this,He(t)):n}}class ms{#e;constructor(...t){let[n,s,r,o,i]=Li(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Qt(this)}copy(){return this.era?new ms(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new ms(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return jl(this,t)}subtract(t){return ym(this,t)}set(t,n){return bm(this,t,n)}cycle(t,n,s){return vm(this,t,n,s)}toDate(){return um(this)}toString(){return xm(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Vl(t,this.timeZone).toDate().getTime()}}let co=new Map;class Ve{constructor(t,n={}){this.formatter=Ul(t,n),this.options=n}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let s=this.formatter.formatToParts(t),r=this.formatter.formatToParts(n);return[...s.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return Im()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Tm(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const $m={true:{ja:"h11"},false:{}};function Ul(e,t={}){if(typeof t.hour12=="boolean"&&Lm()){t={...t};let r=$m[String(t.hour12)][e.split("-")[0]],o=t.hour12?"h12":"h23";t.hourCycle=r??o,delete t.hour12}let n=e+(t?Object.entries(t).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(co.has(n))return co.get(n);let s=new Intl.DateTimeFormat(e,t);return co.set(n,s),s}let lo=null;function Lm(){return lo==null&&(lo=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),lo}let uo=null;function Im(){return uo==null&&(uo=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),uo}function Tm(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Ul(e,{...t,timeZone:void 0}),s=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(o=>o.type==="hour").value,10),r=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(o=>o.type==="hour").value,10);if(s===0&&r===23)return"h23";if(s===24&&r===23)return"h24";if(s===0&&r===11)return"h11";if(s===12&&r===11)return"h12";throw new Error("Unexpected hour cycle result")}function Mm(e,t,n,s,r){const o={};for(let a in t){const c=a,l=t[c];l!=null&&(o[c]=Math.floor(l/2),o[c]>0&&l%2===0&&o[c]--)}const i=sn(e,t,n).subtract(o);return Cs(e,i,t,n,s,r)}function sn(e,t,n,s,r){let o=e;return t.years?o=gs(e):t.months?o=ft(e):t.weeks&&(o=At(e,n)),Cs(e,o,t,n,s,r)}function Ii(e,t,n,s,r){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let i=sn(e,t,n).subtract(o);return Cs(e,i,t,n,s,r)}function Cs(e,t,n,s,r,o){return r&&e.compare(r)>=0&&(t=Ol(t,sn(Kt(r),n,s))),o&&e.compare(o)<=0&&(t=Al(t,Ii(Kt(o),n,s))),t}function De(e,t,n){const s=Kt(e),r=t?Kt(t):void 0,o=n?Kt(n):void 0;let i=s;return r&&(i=Ol(i,r)),o&&(i=Al(i,o)),i.compare(s)===0?e:"hour"in e?e.set({year:i.year,month:i.month,day:i.day}):i}function za(e,t,n,s,r,o){switch(t){case"start":return sn(e,n,s,r,o);case"end":return Ii(e,n,s,r,o);default:return Mm(e,n,s,r,o)}}function Lt(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Ie(e,t):He(e).compare(He(t))===0}function Ja(e,t,n,s,r){return e?t?.(e,n)?!0:ze(e,s,r):!1}function ze(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function Am(e,t,n){const s=e.subtract({days:1});return Ie(s,e)||ze(s,t,n)}function Om(e,t,n){const s=e.add({days:1});return Ie(s,e)||ze(s,t,n)}function Ti(e){let t={...e};for(let n in t)t[n]=1;return t}function ql(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Gl(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Yl(e,t,n){const s=n??He(Dr(t));return new Ve(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Gl(s),calendar:s.calendar.identifier,timeZone:t})}function Xa(e,t,n){const s=n??Dr(t);return new Ve(e,{month:"long",year:"numeric",era:Gl(s),calendar:s.calendar.identifier,timeZone:t})}function Pm(e,t,n,s,r){let o=n.formatRangeToParts(e.toDate(r),t.toDate(r)),i=-1;for(let l=0;l<o.length;l++){let f=o[l];if(f.source==="shared"&&f.type==="literal")i=l;else if(f.source==="endRange")break}let a="",c="";for(let l=0;l<o.length;l++)l<i?a+=o[l].value:l>i&&(c+=o[l].value);return s(a,c)}function Fs(e,t,n,s){if(!e)return"";let r=e,o=t??e,i=Yl(n,s);return Ie(r,o)?i.format(r.toDate(s)):Pm(r,o,i,(a,c)=>`${a} – ${c}`,s)}var Rm=["sun","mon","tue","wed","thu","fri","sat"];function Kl(e){return e!=null?Rm[e]:void 0}function Zl(e,t,n){const s=Kl(n);return At(e,t,s)}function zl(e,t,n,s){const r=t.add({weeks:e}),o=[];let i=Zl(r,n,s);for(;o.length<7;){o.push(i);let a=i.add({days:1});if(Ie(i,a))break;i=a}return o}function Dm(e,t,n,s){const r=Kl(s),o=n??im(e,t,r);return[...new Array(o).keys()].map(a=>zl(a,e,t,s))}function Vm(e,t){const n=new Ve(e,{weekday:"long",timeZone:t}),s=new Ve(e,{weekday:"short",timeZone:t}),r=new Ve(e,{weekday:"narrow",timeZone:t});return o=>{const i=o instanceof Date?o:o.toDate(t);return{value:o,short:s.format(i),long:n.format(i),narrow:r.format(i)}}}function Nm(e,t,n,s){const r=Zl(e,s,t),o=[...new Array(7).keys()],i=Vm(s,n);return o.map(a=>i(r.add({days:a})))}function Fm(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const i=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(i.toLocaleString(e,{month:t})),i.setMonth(i.getMonth()+1);return a}const s=n.calendar.getMonthsInYear(n),r=new Ve(e,{month:t,calendar:n.calendar.identifier}),o=[];for(let i=1;i<=s;i++){const a=n.set({month:i});o.push(r.format(a.toDate("UTC")))}return o}function Qa(e,t){const n=At(e,t,"mon"),s=n.year,r=n.set({month:1,day:4}),o=At(r,t,"mon"),i=n.calendar.toJulianDay(n),a=o.calendar.toJulianDay(o);if(i>=a)return 1+Math.floor((i-a)/7);const c=n.set({year:s-1,month:1,day:4}),l=At(c,t,"mon"),f=l.calendar.toJulianDay(l);return 1+Math.floor((i-f)/7)}function Hm(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var Wm=1900,jm=2099;function _m(e,t,n){const s=e.calendar,r=t?.year??me(new qe(Wm,1,1),s).year,o=n?.year??me(new qe(jm,12,31),s).year;return{from:r,to:o}}var Bm=10;function Um(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,s=parseInt(e.slice(-2),10),r=n+s;return r>t+Bm?(r-100).toString():r.toString()}return e}}function vn(e){const t=e-e%10,n=[];for(let s=0;s<10;s+=1){const r=t+s;n.push(r)}return n}function as(e,t){const n=Dr(e??Si());return t?me(n,t):n}function ks(e,t,n,s){return function(o){const{startDate:i,focusedDate:a}=o,c=ql(i,e);return ze(a,n,s)?{startDate:i,focusedDate:De(a,n,s),endDate:c}:a.compare(i)<0?{startDate:Ii(a,e,t,n,s),focusedDate:De(a,n,s),endDate:c}:a.compare(c)>0?{startDate:sn(a,e,t,n,s),endDate:c,focusedDate:De(a,n,s)}:{startDate:i,endDate:c,focusedDate:De(a,n,s)}}}function Jl(e,t,n,s,r,o){const i=ks(n,s,r,o),a=t.add(n);return i({focusedDate:e.add(n),startDate:sn(Cs(e,a,n,s,r,o),n,s)})}function Xl(e,t,n,s,r,o){const i=ks(n,s,r,o);let a=t.subtract(n);return i({focusedDate:e.subtract(n),startDate:sn(Cs(e,a,n,s,r,o),n,s)})}function qm(e,t,n,s,r,o,i){const a=ks(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.add(Ti(s)),startDate:t});if(s.days)return Jl(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.add({years:1}),startDate:t})}function Gm(e,t,n,s,r,o,i){const a=ks(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.subtract(Ti(s)),startDate:t});if(s.days)return Xl(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var ec=new Map;function Ym(e){let t=ec.get(e);return t!=null||(t="0123456789"+new Intl.NumberFormat(e,{useGrouping:!1}).format(1234567890),ec.set(e,t)),t}var Km=(e,t)=>t?Ym(t).includes(e):/\d/.test(e),Ql=(e,t,n)=>!e||e.length!==1?!0:Km(e,n)||t.includes(e),Zm=(e,t,n)=>e.split("").filter(s=>Ql(s,t,n)).join(""),tc=new Map;function zm(e){let t=tc.get(e);if(t!=null)return t;const s=new Intl.DateTimeFormat(e).formatToParts(new Date).find(r=>r.type==="literal");return t=s?s.value:"/",tc.set(e,t),t}var nc=e=>e!=null&&e.length===4,Jm=e=>e!=null&&parseFloat(e)<=12,Xm=e=>e!=null&&parseFloat(e)<=31;function Qm(e,t,n){const s=ey(t,n);let{year:r,month:o,day:i}=ty(s,e)??{};if(r!=null||o!=null||i!=null){const l=new Date;r||(r=l.getFullYear().toString()),o||(o=(l.getMonth()+1).toString()),i||(i=l.getDate().toString())}if(nc(r)||(r=Um(r)),nc(r)&&Jm(o)&&Xm(i))return new qe(+r,+o,+i);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new qe(l.getFullYear(),l.getMonth()+1,l.getDate())}}function ey(e,t){return new Ve(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:r,value:o})=>r==="literal"?`${o}?`:`((?!=<${r}>)\\d+)?`).join("")}function ty(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(s=>{const r=s.match(/<(.+)>/);return!r||r.length<=0?null:s.match(/<(.+)>/)?.[1]}).reduce((s,r,o)=>(r&&(n&&n.length>o?s[r]=n[o+1]:s[r]=null),s),{})}function sc(e,t,n){const s=Kt(Ll(n));switch(e){case"thisWeek":return[At(s,t),Ga(s,t)];case"thisMonth":return[ft(s),s];case"thisQuarter":return[ft(s).add({months:-((s.month-1)%3)}),s];case"thisYear":return[gs(s),s];case"last3Days":return[s.add({days:-2}),s];case"last7Days":return[s.add({days:-6}),s];case"last14Days":return[s.add({days:-13}),s];case"last30Days":return[s.add({days:-29}),s];case"last90Days":return[s.add({days:-89}),s];case"lastMonth":return[ft(s.add({months:-1})),Bo(s.add({months:-1}))];case"lastQuarter":return[ft(s.add({months:-((s.month-1)%3)-3})),Bo(s.add({months:-((s.month-1)%3)-1}))];case"lastWeek":return[At(s,t).add({weeks:-1}),Ga(s,t).add({weeks:-1})];case"lastYear":return[gs(s.add({years:-1})),rm(s.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var ny=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,sy=e=>e.ids?.root??`datepicker:${e.id}`,ry=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,Yo=e=>e.ids?.content??`datepicker:${e.id}:content`,fo=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,oy=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,iy=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,ay=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,ed=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,td=e=>e.ids?.control??`datepicker:${e.id}:control`,rc=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,nd=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,sd=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,rd=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,od=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,oc=(e,t)=>ph(hn(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),zs=e=>e.getById(nd(e)),hn=e=>e.getById(Yo(e)),ts=e=>hh(id(e),"[data-part=input]"),cy=e=>e.getById(od(e)),ly=e=>e.getById(rd(e)),dy=e=>e.getById(ed(e)),ic=e=>e.getById(sd(e)),id=e=>e.getById(td(e)),ac=e=>{const t=ts(e);if(t.length===0){zs(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(o=>o.value!==""),s=Math.max(n,0),r=t[s];r?.focus({preventScroll:!0}),r?.setSelectionRange(r.value.length,r.value.length)};function Js(e){const[t,n]=e;let s;return!t||!n?s=e:s=t.compare(n)<=0?e:[n,t],s}function dn(e,t){const[n,s]=t;return!n||!s?!1:n.compare(e)<=0&&s.compare(e)>=0}function Hs(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function uy(e,t){return new Ve(e).formatToParts(new Date).map(n=>t[n.type]??n.value).join("")}var cc=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),fy={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.inRange?`In range. ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e,t){return t?`Switch to ${t} view`:`${e} view`},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return ko(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return ko(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function vt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Mi(e){return e===0?"day":e===1?"month":"year"}function Ai(e,t,n){return Mi(sf(vt(e,0),vt(t,0),vt(n,2)))}function hy(e,t){return vt(e,0)>vt(t,0)}function py(e,t){return vt(e,0)<vt(t,0)}function ad(e,t,n){const s=vt(e,0)+1;return Ai(Mi(s),t,n)}function gy(e,t,n){const s=vt(e,0)-1;return Ai(Mi(s),t,n)}var my=["day","month","year"];function yy(e){my.forEach(t=>e(t))}var vy=f1(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale,e.timeZone,e.selectionMode],([e],t)=>{const{startValue:n,endValue:s,locale:r,timeZone:o,selectionMode:i}=t;if(e==="year"){const u=vn(n.year),g=u.at(0).toString(),p=u.at(-1).toString();return{start:g,end:p,formatted:`${g} - ${p}`}}if(e==="month"){const u=new Ve(r,{year:"numeric",timeZone:o,calendar:n.calendar.identifier}),g=u.format(n.toDate(o)),p=u.format(s.toDate(o)),h=i==="range"?`${g} - ${p}`:g;return{start:g,end:p,formatted:h}}const a=new Ve(r,{month:"long",year:"numeric",timeZone:o,calendar:n.calendar.identifier}),c=a.format(n.toDate(o)),l=a.format(s.toDate(o)),f=i==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:f}});function by(e,t){const{state:n,context:s,prop:r,send:o,computed:i,scope:a}=e,c=s.get("startValue"),l=i("endValue"),f=s.get("value"),u=s.get("focusedValue"),g=s.get("hoveredValue"),p=g?Js([f[0],g]):[],h=!!r("disabled"),d=!!r("readOnly"),m=!!r("invalid"),v=i("isInteractive"),C=f.length===0,L=r("min"),O=r("max"),w=r("locale"),S=r("timeZone"),b=r("startOfWeek"),E=n.matches("focused"),k=n.matches("open"),x=r("selectionMode")==="range",y=r("selectionMode")==="multiple",A=r("isDateUnavailable"),D=r("maxSelectedDates"),H=y&&D!=null&&f.length>=D,P=s.get("currentPlacement"),F=P?Qc(P):void 0,B=el({...r("positioning"),placement:P}),j=zm(w),Y=Sc(fy,r("translations"));function Me(M=c){const $=r("fixedWeeks")?6:void 0;return Dm(M,w,$,b)}function Le(M={}){const{format:$}=M;return Fm(w,$,u).map((T,R)=>{const z=R+1,de=u.set({month:z}),ue=ze(de,L,O);return{label:T,value:z,disabled:ue}})}function Wt(){const M=_m(u,L,O);return Hm(M).map(T=>({label:T.toString(),value:T,disabled:!Ur(T,L?.year,O?.year)}))}function _e(M){return Ja(M,A,w,L,O)}function Ae(M){const $=c??as(S,u.calendar);o({type:"FOCUS.SET",value:$.set({month:M})})}function Vn(M){const $=c??as(S,u.calendar);o({type:"FOCUS.SET",value:$.set({year:M})})}function Be(M){const{value:$,disabled:T}=M,R=u.set({year:$}),de=!vn(c.year).includes($),ue=Ur($,L?.year,O?.year),N=x&&dn(R,f),_=x&&f[0]&&Gn(R,f[0]),K=x&&f[1]&&Gn(R,f[1]),te=x&&p.length>0,ae=te&&dn(R,p),ne=te&&p[0]&&Gn(R,p[0]),oe=te&&p[1]&&Gn(R,p[1]),Ue={focused:u.year===M.value,selectable:ue,outsideRange:de,selected:!!f.find(Ke=>Ke&&Ke.year===$),valueText:$.toString(),inRange:N||ae,firstInRange:!!_,lastInRange:!!K,inHoveredRange:!!ae,firstInHoveredRange:!!ne,lastInHoveredRange:!!oe,value:R,get disabled(){return T||!Ue.selectable}};return Ue}function jt(M){const{value:$,disabled:T}=M,R=u.set({month:$}),z=Xa(w,S,u),de=x&&dn(R,f),ue=x&&f[0]&&qn(R,f[0]),N=x&&f[1]&&qn(R,f[1]),_=x&&p.length>0,K=_&&dn(R,p),te=_&&p[0]&&qn(R,p[0]),ae=_&&p[1]&&qn(R,p[1]),ne={focused:u.month===M.value,selectable:!ze(R,L,O),selected:!!f.find(oe=>oe&&oe.month===$&&oe.year===u.year),valueText:z.format(R.toDate(S)),inRange:de||K,firstInRange:!!ue,lastInRange:!!N,inHoveredRange:!!K,firstInHoveredRange:!!te,lastInHoveredRange:!!ae,outsideRange:!1,value:R,get disabled(){return T||!ne.selectable}};return ne}function st(M){const{value:$,disabled:T,visibleRange:R=i("visibleRange")}=M,z=Yl(w,S,u),de=Ti(i("visibleDuration")),ue=r("outsideDaySelectable"),N=R.start.add(de).subtract({days:1}),_=ze($,R.start,N),K=x&&dn($,f),te=x&&f[0]&&Ie($,f[0]),ae=x&&f[1]&&Ie($,f[1]),ne=x&&p.length>0,oe=ne&&dn($,p),Ue=ne&&p[0]&&Ie($,p[0]),Ke=ne&&p[1]&&Ie($,p[1]),ve=f.some(on=>on!=null&&Ie($,on)),Ze={invalid:ze($,L,O),disabled:T||!ue&&_||ze($,L,O)||H&&!ve,selected:ve,unavailable:Ja($,A,w,L,O)&&!T,outsideRange:_,today:em($,S),weekend:cm($,w),value:$,valueText:z.format($.toDate(S)),get focused(){return u!=null&&Ie($,u)&&(!Ze.outsideRange||ue)},get selectable(){return!Ze.disabled&&!Ze.unavailable},inRange:K||oe,firstInRange:te,lastInRange:ae,inHoveredRange:oe,firstInHoveredRange:Ue,lastInHoveredRange:Ke};return Ze}function rn(M){const{view:$="day",id:T}=M;return[$,T].filter(Boolean).join(" ")}return{focused:E,open:k,disabled:h,invalid:m,readOnly:d,inline:!!r("inline"),numOfMonths:r("numOfMonths"),showWeekNumbers:!!r("showWeekNumbers"),selectionMode:r("selectionMode"),maxSelectedDates:D,isMaxSelected:H,view:s.get("view"),getRangePresetValue(M){return sc(M,w,S)},getWeekNumber(M){const $=M[0];return $?Qa($,w):0},getDaysInWeek(M,$=c){return zl(M,$,w,b)},getOffset(M){const $=c.add(M),T=l.add(M),R=Xa(w,S,u);return{visibleRange:{start:$,end:T},weeks:Me($),visibleRangeText:{start:R.format($.toDate(S)),end:R.format(T.toDate(S))}}},getMonthWeeks:Me,isUnavailable:_e,weeks:Me(),weekDays:Nm(c,b,S,w),visibleRangeText:i("visibleRangeText"),value:f,valueAsDate:f.filter(M=>M!=null).map(M=>M.toDate(S)),valueAsString:i("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(S),focusedValueAsString:r("format")(u,{locale:w,timeZone:S}),visibleRange:i("visibleRange"),selectToday(){const M=De(as(S,u.calendar),L,O);o({type:"VALUE.SET",value:[M]})},setValue(M){const $=M.map(T=>De(T,L,O));o({type:"VALUE.SET",value:$})},setTime(M,$=0){const T=Array.from(f);let R=T[$];R&&("hour"in R||(R=He(R)),R=R.set({hour:M.hour??("hour"in R?R.hour:0),minute:M.minute??("minute"in R?R.minute:0),second:M.second??("second"in R?R.second:0),millisecond:M.millisecond??("millisecond"in R?R.millisecond:0)}),T[$]=De(R,L,O),o({type:"VALUE.SET",value:T}))},clearValue(M={}){const{focus:$=!0}=M;o({type:"VALUE.CLEAR",focus:$})},setFocusedValue(M){o({type:"FOCUS.SET",value:M})},setOpen(M){r("inline")||o({type:M?"OPEN":"CLOSE",replaces:"open"})},focusMonth:Ae,focusYear:Vn,getYears:Wt,getMonths:Le,getYearsGrid(M={}){const{columns:$=1}=M,T=vn(c.year).map(R=>({label:R.toString(),value:R,disabled:!Ur(R,L?.year,O?.year)}));return Xi(T,$)},getDecade(){const M=vn(c.year);return{start:M.at(0),end:M.at(-1)}},getMonthsGrid(M={}){const{columns:$=1,format:T}=M;return Xi(Le({format:T}),$)},format(M,$={month:"long",year:"numeric"}){return new Ve(w,{...$,calendar:M.calendar.identifier}).format(M.toDate(S))},setView(M){o({type:"VIEW.SET",view:M})},goToNext(){o({type:"GOTO.NEXT",view:s.get("view")})},goToPrev(){o({type:"GOTO.PREV",view:s.get("view")})},getRootProps(){return t.element({...ee.root.attrs,dir:r("dir"),id:sy(a),"data-state":k?"open":"closed","data-disabled":V(h),"data-readonly":V(d),"data-empty":V(C)})},getLabelProps(M={}){const{index:$=0}=M;return t.label({...ee.label.attrs,id:ny(a,$),dir:r("dir"),htmlFor:rc(a,$),"data-state":k?"open":"closed","data-index":$,"data-disabled":V(h),"data-readonly":V(d),"data-invalid":V(m)})},getControlProps(){return t.element({...ee.control.attrs,dir:r("dir"),id:td(a),"data-disabled":V(h),"data-placeholder-shown":V(C),"data-invalid":V(m)})},getRangeTextProps(){return t.element({...ee.rangeText.attrs,dir:r("dir")})},getContentProps(){return t.element({...ee.content.attrs,hidden:!k,dir:r("dir"),"data-state":k?"open":"closed","data-placement":P,"data-side":F,"data-inline":V(r("inline")),id:Yo(a),tabIndex:-1,role:"application","aria-label":Y.content})},getTableProps(M={}){const{view:$="day",columns:T=$==="day"?7:4}=M,R=rn(M);return t.element({...ee.table.attrs,role:"grid","data-columns":T,"aria-label":i("visibleRangeText").formatted,id:ry(a,R),"aria-readonly":be(d),"aria-disabled":be(h),"aria-multiselectable":be(r("selectionMode")!=="single"),"data-view":$,dir:r("dir"),tabIndex:-1,onKeyDown(z){if(z.defaultPrevented||h)return;const de={Enter(){v&&($==="day"&&_e(u)||$==="month"&&!jt({value:u.month}).selectable||$==="year"&&!Be({value:u.year}).selectable||o({type:"TABLE.ENTER",view:$,columns:T,focus:!0}))},Space(N){de.Enter?.()},ArrowLeft(){o({type:"TABLE.ARROW_LEFT",view:$,columns:T,focus:!0})},ArrowRight(){o({type:"TABLE.ARROW_RIGHT",view:$,columns:T,focus:!0})},ArrowUp(){o({type:"TABLE.ARROW_UP",view:$,columns:T,focus:!0})},ArrowDown(){o({type:"TABLE.ARROW_DOWN",view:$,columns:T,focus:!0})},PageUp(N){o({type:"TABLE.PAGE_UP",larger:N.shiftKey,view:$,columns:T,focus:!0})},PageDown(N){o({type:"TABLE.PAGE_DOWN",larger:N.shiftKey,view:$,columns:T,focus:!0})},Home(){o({type:"TABLE.HOME",view:$,columns:T,focus:!0})},End(){o({type:"TABLE.END",view:$,columns:T,focus:!0})}},ue=de[So(z,{dir:r("dir")})];ue&&(ue(z),z.preventDefault(),z.stopPropagation())},onPointerLeave(){o({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){o({type:"TABLE.POINTER_DOWN",view:$})},onPointerUp(){o({type:"TABLE.POINTER_UP",view:$})}})},getTableHeadProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableHead.attrs,"aria-hidden":!0,dir:r("dir"),"data-view":$,"data-disabled":V(h)})},getTableHeaderProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableHeader.attrs,dir:r("dir"),"data-view":$,"data-disabled":V(h)})},getTableBodyProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableBody.attrs,"data-view":$,"data-disabled":V(h)})},getTableRowProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableRow.attrs,"aria-disabled":be(h),"data-disabled":V(h),"data-view":$})},getWeekNumberHeaderCellProps(M={}){const{view:$="day"}=M;return t.element({...ee.tableCell.attrs,scope:"col","aria-label":Y.weekColumnHeader,"data-view":$,"data-type":"week-number","data-disabled":V(h)})},getWeekNumberCellProps(M){const{weekIndex:$,week:T}=M,R=T[0]?Qa(T[0],w):0;return t.element({...ee.tableCell.attrs,role:"rowheader","aria-label":Y.weekNumberCell?.(R),"data-view":"day","data-week-index":$,"data-type":"week-number","data-disabled":V(h)})},getDayTableCellState:st,getDayTableCellProps(M){const{value:$}=M,T=st(M);return t.element({...ee.tableCell.attrs,role:"gridcell","aria-disabled":be(!T.selectable),"aria-selected":T.selected||T.inRange,"aria-invalid":be(T.invalid),"aria-current":T.today?"date":void 0,"data-value":$.toString()})},getDayTableCellTriggerProps(M){const{value:$}=M,T=st(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":Y.dayCell(T),"aria-disabled":be(!T.selectable),"aria-invalid":be(T.invalid),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$.toString(),"data-view":"day","data-today":V(T.today),"data-focus":V(T.focused),"data-unavailable":V(T.unavailable),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-outside-range":V(T.outsideRange),"data-weekend":V(T.weekend),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"day",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&Qg($,g)||o({type:"CELL.POINTER_MOVE",cell:"day",value:$,focus:z,outsideRange:T.outsideRange})}:void 0})},getMonthTableCellState:jt,getMonthTableCellProps(M){const{value:$,columns:T}=M,R=jt(M);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getMonthTableCellTriggerProps(M){const{value:$}=M,T=jt(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"month","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"month",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&qn(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"month",value:T.value,focus:z})}:void 0})},getYearTableCellState:Be,getYearTableCellProps(M){const{value:$,columns:T}=M,R=Be(M);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getYearTableCellTriggerProps(M){const{value:$}=M,T=Be(M);return t.element({...ee.tableCellTrigger.attrs,id:fo(a,$.toString()),role:"button",dir:r("dir"),tabIndex:h?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"year","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"year",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable||T.outsideRange)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&Gn(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"year",value:T.value,focus:z})}:void 0})},getNextTriggerProps(M={}){const{view:$="day"}=M,T=h||!i("isNextVisibleRangeValid");return t.button({...ee.nextTrigger.attrs,dir:r("dir"),id:iy(a,$),type:"button","aria-label":Y.nextTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.NEXT",view:$})}})},getPrevTriggerProps(M={}){const{view:$="day"}=M,T=h||!i("isPrevVisibleRangeValid");return t.button({...ee.prevTrigger.attrs,dir:r("dir"),id:oy(a,$),type:"button","aria-label":Y.prevTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.PREV",view:$})}})},getClearTriggerProps(){return t.button({...ee.clearTrigger.attrs,id:ed(a),dir:r("dir"),type:"button","aria-label":Y.clearTrigger,hidden:!f.length,onClick(M){M.defaultPrevented||v&&o({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ee.trigger.attrs,id:nd(a),dir:r("dir"),type:"button","data-placement":P,"data-side":F,"aria-label":Y.trigger(k),"aria-controls":Yo(a),"aria-expanded":k,"data-state":k?"open":"closed","data-placeholder-shown":V(C),"aria-haspopup":"grid",disabled:h,onClick(M){M.defaultPrevented||v&&o({type:"TRIGGER.CLICK"})}})},getViewProps(M={}){const{view:$="day"}=M;return t.element({...ee.view.attrs,"data-view":$,hidden:s.get("view")!==$})},getViewTriggerProps(M={}){const{view:$="day"}=M,T=ad($,r("minView"),r("maxView")),R=T!==$,z=h||!R;return t.button({...ee.viewTrigger.attrs,"data-view":$,dir:r("dir"),id:ay(a,$),type:"button",disabled:z,"data-disabled":V(z),"aria-label":Y.viewTrigger($,R?T:void 0),onClick(de){de.defaultPrevented||v&&o({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(M={}){const{view:$="day"}=M;return t.element({...ee.viewControl.attrs,"data-view":$,dir:r("dir")})},getInputProps(M={}){const{index:$=0,fixOnBlur:T=!0}=M;return t.input({...ee.input.attrs,id:rc(a,$),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:r("dir"),name:r("name"),"data-index":$,"data-state":k?"open":"closed","data-placeholder-shown":V(C),readOnly:d,disabled:h,required:r("required"),"aria-invalid":be(m),"data-invalid":V(m),placeholder:r("placeholder")||uy(w,Y.placeholder(w)),defaultValue:i("valueAsString")[$],onBeforeInput(R){const{data:z}=ai(R);Ql(z,j,w)||R.preventDefault()},onClick(R){R.defaultPrevented||r("openOnClick")&&v&&o({type:"OPEN",src:"input.click"})},onFocus(){o({type:"INPUT.FOCUS",index:$})},onBlur(R){const z=R.currentTarget.value.trim();o({type:"INPUT.BLUR",value:z,index:$,fixOnBlur:T})},onKeyDown(R){if(R.defaultPrevented||!v)return;const de={Enter(ue){Vf(ue)||_e(u)||ue.currentTarget.value.trim()!==""&&o({type:"INPUT.ENTER",value:ue.currentTarget.value,index:$})}}[R.key];de&&(de(R),R.preventDefault())},onInput(R){const z=R.currentTarget.value;o({type:"INPUT.CHANGE",value:Zm(z,j,w),index:$})}})},getMonthSelectProps(){return t.select({...ee.monthSelect.attrs,id:rd(a),"aria-label":Y.monthSelect,disabled:h,dir:r("dir"),defaultValue:c.month,onChange(M){Ae(Number(M.currentTarget.value))}})},getYearSelectProps(){return t.select({...ee.yearSelect.attrs,id:od(a),disabled:h,"aria-label":Y.yearSelect,dir:r("dir"),defaultValue:c.year,onChange(M){Vn(Number(M.currentTarget.value))}})},getPositionerProps(){return t.element({id:sd(a),...ee.positioner.attrs,dir:r("dir"),style:B.floating})},getPresetTriggerProps(M){const $=Array.isArray(M.value)?M.value:sc(M.value,w,S),T=$.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...ee.presetTrigger.attrs,"aria-label":Y.presetTrigger(T),type:"button",onClick(R){R.defaultPrevented||v&&o({type:"PRESET.CLICK",value:$})}})}}}var ho="__live-region-debug__",wy="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;",Cy=100,ky=200,Ey={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function Sy(e={}){const{level:t="polite",document:n=document,root:s,delay:r=0,debug:o=!1}=e,i=n.defaultView??window,a=()=>(typeof s=="function"?s():s)??n.body;let c;function l(){if(!o)return;let m=n.getElementById(ho);return m||(m=n.createElement("div"),m.id=ho,m.dataset.liveAnnouncerDebug="true",m.setAttribute("aria-hidden","true"),m.style.cssText=wy,a().appendChild(m),m)}function f(){const m=n.createElement("span");return m.dataset.liveAnnouncer="true",m.setAttribute("aria-live",t),m.setAttribute("aria-atomic","true"),m.setAttribute("role",t==="assertive"?"alert":"status"),Object.assign(m.style,Ey),a().appendChild(m),u=Date.now()+ky,m}let u=0,g=f();function p(){i.clearTimeout(c),c=void 0}function h(m,v=r){p(),g?.isConnected||(g=f());const C=g;C.textContent="",c=i.setTimeout(()=>{c=void 0,C.textContent=m;const L=l();L&&(L.textContent=m)},Math.max(v,Cy,u-Date.now()))}function d(){p(),g?.remove(),g=null,o&&n.getElementById(ho)?.remove()}return{announce:h,cancel:p,destroy:d,toJSON(){return"live-region"}}}var{and:Ee}=il();function xy(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let s=0;s<n;s++)if(!Lt(e[s],t[s]))return!1;return!0}function Ws(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var $y=al({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",s=e.selectionMode||"single",r=e.numOfMonths||1;let o;if(e.createCalendar){const h=new Intl.DateTimeFormat(t).resolvedOptions().calendar;h!=="gregory"&&h!=="iso8601"&&(o=e.createCalendar(h))}const i=p=>!o||p.calendar.identifier===o.identifier?p:me(p,o),a=e.defaultValue?Hs(e.defaultValue).map(p=>De(i(p),e.min,e.max)):void 0,c=e.value?Hs(e.value).map(p=>De(i(p),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||as(n,o);l=De(i(l),e.min,e.max);const f=e.minView||"day",u=e.maxView||"year",g=Ai(e.defaultView||e.view||f,f,u);return{locale:t,numOfMonths:r,timeZone:n,selectionMode:s,minView:f,maxView:u,outsideDaySelectable:!1,closeOnSelect:!0,format(p,{locale:h,timeZone:d}){return new Ve(h,{timeZone:d,day:"2-digit",month:"2-digit",year:"numeric",calendar:o?.identifier}).format(p.toDate(d))},parse(p,{locale:h,timeZone:d}){return Qm(p,h,d)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],defaultView:g,positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("inline")||(e("open")??e("defaultOpen"))?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:Lt,hash:s=>s.toString(),sync:!0,onChange(s){const r=n(),o=r.get("view"),i=r.get("value"),a=Ws(i,e);e("onFocusChange")?.({value:i,valueAsString:a,view:o,focusedValue:s})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:xy,hash:s=>s.map(r=>r?.toString()??"").join(","),onChange(s){const r=n(),o=Ws(s,e);e("onValueChange")?.({value:s,valueAsString:o,view:r.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:Lt})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(s){e("onViewChange")?.({view:s})}})),startValue:t(()=>{const s=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:za(s,"start",{months:e("numOfMonths")},e("locale")),isEqual:Lt,hash:r=>r.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>ql(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>vy({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!Am(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!Om(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>Ws(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:s,computed:r}){e([()=>t("locale")],()=>{s(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{s(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{s(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{s(["syncInputValue"])}),e([()=>n.hash("value")],()=>{s(["syncInputElement"])}),e([()=>r("valueAsString").toString()],()=>{s(["announceValueText"])}),e([()=>n.get("view")],()=>{s(["focusActiveCell"])}),e([()=>t("open")],()=>{s(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],entry:["resumeRangeSelection"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate"],on:{"CONTROLLED.CLOSE":[{guard:Ee("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["restoreFocusToTrigger"]},{guard:"shouldRestoreFocus",target:"focused",actions:["restoreFocusToInput"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","restoreFocusToInput"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Ee("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","restoreFocusToTrigger"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Ee("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Ee("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Ee("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Ee("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Ee("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","restoreFocusToInput"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","restoreFocusToTrigger"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>hy(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:e=>{const{context:t,prop:n,event:s}=e,r=n("maxSelectedDates");if(r==null)return!0;const o=t.get("value"),i=ns(e,s.value??t.get("focusedValue"));return o.some(c=>Lt(c,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const s=id(n);return Po(s,()=>ic(n),{...t("positioning"),defer:!0,onComplete(o){e.set("currentPlacement",o.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",Sy({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:s}){return s("inline")?void 0:dl(()=>hn(e),{type:"popover",defer:!0,getRootNode:e.getRootNode,layerStyleTargets:[()=>ic(e)],exclude:[...ts(e),zs(e),dy(e)],onInteractOutside(o){n.set("restoreFocus",!o.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(o){o.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable",focusVisible:!0})}})}},actions:{setNextView({context:e,prop:t}){const n=ad(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=gy(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const s=e.get("value"),r=t("locale"),o=t("timeZone");let i;if(t("selectionMode")==="range"){const[a,c]=s;a&&c?i=Fs(a,c,r,o):a?i=Fs(a,null,r,o):c?i=Fs(c,null,r,o):i=""}else i=s.map(a=>Fs(a,null,r,o)).filter(Boolean).join(",");n.get("announcer")?.announce(i,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){fh({target:hn(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Hc({doc:e.getDoc(),target:hn(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&re(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){we(()=>{ts(e).forEach((s,r)=>{Ls(s,t("valueAsString")[r]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;re(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;re(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;re(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;re(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const s=t.value.map(r=>De(r,n("min"),n("max")));e.set("value",s)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,s=Array.from(t.get("value")),r=t.get("activeIndex"),o=s[r],i=ns(e,n.value??t.get("focusedValue"));s[r]=js(o,i),t.set("value",Js(s))},resetSelection(e){const{context:t,event:n}=e,s=t.get("value")[0],r=ns(e,n.value??t.get("focusedValue"));t.set("value",[js(s,r)])},toggleSelectedDate(e){const{context:t,event:n}=e,s=ns(e,n.value??t.get("focusedValue")),r=t.get("value"),o=r.findIndex(i=>Lt(i,s));if(o===-1){const i=[...r,s];t.set("value",Hs(i))}else{const i=Array.from(r);i.splice(o,1),t.set("value",Hs(i))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),s=e.get("activeIndex"),r=n[s],o=e.get("focusedValue").copy();n[s]=js(r,o),e.set("value",Js(n));const i=t("valueAsString");e.set("inputValue",i[s])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});re(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});re(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});re(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});re(e,n)},focusNextPage(e){const{context:t,computed:n,prop:s}=e,r=Jl(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));_s(e,r)},focusPreviousPage(e){const{context:t,computed:n,prop:s}=e,r=Xl(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));_s(e,r)},focusSectionStart(e){const{context:t}=e;re(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;re(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=qm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&_s(e,o)},focusPreviousSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=Gm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&_s(e,o)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});re(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});re(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});re(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});re(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,s=t.get("focusedValue").calendar;re(e,as(n("timeZone"),s))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({months:n.columns});re(e,s)},focusNextMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({months:n.columns});re(e,s)},focusPreviousYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({years:n.columns});re(e,s)},focusNextYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({years:n.columns});re(e,s)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMinimumMonthInYear?.(n)??1;re(e,n.set({month:s}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMonthsInYear(n);re(e,n.set({month:s}))},focusFirstYear(e){const{context:t}=e,n=vn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[0]});re(e,s)},focusLastYear(e){const{context:t}=e,n=vn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[n.length-1]});re(e,s)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},resumeRangeSelection({context:e,prop:t}){t("selectionMode")==="range"&&e.get("value").length===1&&e.set("activeIndex",1)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&we(()=>{const s=t.get("view");oc(e,s)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&we(()=>{const s=t.get("view");oc(e,s)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!(t.type.startsWith("TABLE.ARROW")||["TABLE.ENTER","TABLE.HOME","TABLE.END","TABLE.PAGE_UP","TABLE.PAGE_DOWN"].includes(t.type))||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},restoreFocusToTrigger({scope:e,event:t}){const n=hn(e),s=Ly(t);we(()=>{na(e.getActiveElement(),[n])||zs(e)?.focus(s)})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&we(()=>{const[n]=ts(e);(n??zs(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){we(()=>ac(e))},restoreFocusToInput({scope:e}){const t=hn(e);we(()=>{na(e.getActiveElement(),[t])||ac(e)})},syncMonthSelectElement({scope:e,context:t}){const n=ly(e);Ls(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=cy(e);Ls(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const s=ts(e),r=n.index??t.get("activeIndex");Ls(s[r],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!r||!cc(r)||re(e,r)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!r||!cc(r))&&t.value&&(r=e.get("focusedValue").copy()),!r)return;r=De(r,n("min"),n("max"));const o=Array.from(e.get("value"));o[t.index]=js(o[t.index],r);const i=Js(o);e.set("value",i);const a=Ws(i,n);e.set("inputValue",a[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const s=e.get("focusedValue");if(!ze(s,e.get("startValue"),t("endValue")))return;const o=za(s,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",o)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),ns=(e,t)=>{const{context:n,prop:s}=e,r=n.get("view");let o=typeof t=="number"?n.get("focusedValue").set({[r]:t}):t;return yy(i=>{py(i,s("minView"))&&(o=o.set({[i]:i==="day"?1:0}))}),o},js=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let s=t;return"hour"in t||(n?s=Vl(He(t),e.timeZone):s=He(t)),s.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function re(e,t){const{context:n,prop:s,computed:r}=e;if(!t)return;const o=ns(e,t);if(Lt(n.get("focusedValue"),o))return;const a=ks(r("visibleDuration"),s("locale"),s("min"),s("max"))({focusedDate:o,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function _s(e,t){const{context:n}=e;n.set("startValue",t.startDate);const s=n.get("focusedValue");Lt(s,t.focusedDate)||n.set("focusedValue",t.focusedDate)}function Ly(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function cd(e){return Array.isArray(e)?e.map(t=>cd(t)):e instanceof Date?new qe(e.getFullYear(),e.getMonth()+1,e.getDate()):km(e)}const po=e=>W(`chevron-${e}`),go=e=>{try{return/^\d{4}-\d{2}-\d{2}$/.test(e)?cd(e):void 0}catch{return}};function Iy(e,t,n){e.innerHTML=`<div class="date-control"><button class="icon-button date-trigger" type="button" aria-label="Custom date range" title="Custom date range">${W("calendar")}</button></div>
100
100
  <div class="date-positioner" popover="manual"><section class="date-popover">
101
101
  <header class="date-heading"><div><span class="eyebrow">FOCUS YOUR TIMELINE</span><h2>Date range</h2></div><button type="button" class="icon-button date-close" aria-label="Close date range">${W("x")}</button></header>
102
102
  <div class="date-fields"><label>From<input id="from-date" aria-label="From date" autocomplete="off" spellcheck="false" placeholder="YYYY-MM-DD"/></label><span aria-hidden="true">→</span><label>To<input id="to-date" aria-label="To date" autocomplete="off" spellcheck="false" placeholder="YYYY-MM-DD"/></label></div>
@@ -110,7 +110,7 @@ ${v.output}`:""].filter(Boolean).join(`
110
110
  <div class="publishing-error" hidden><p role="alert" data-preview-error></p><button class="secondary-button" data-retry>Retry preview</button></div>
111
111
  <div class="publishing-preview"></div><pre class="publishing-json" id="publishing-json" tabindex="0" aria-label="Public graph JSON" hidden></pre>
112
112
  <p role="status" class="publishing-status"></p>
113
- <footer><a class="publishing-link text-button" target="_blank" rel="noopener noreferrer" hidden>View profile ↗</a><button class="text-button" data-remove hidden>Unpublish</button><button class="primary-button" data-publish disabled>Publish graph</button></footer>`,document.body.append(s),s.prepend(jy(s,"publish",()=>t()));const r=P=>s.querySelector(P);r(".publishing-disclosure").textContent=Vy,r("[data-login]").prepend(wo("github"));let o=[],i={...hr},a,c,l=n.preloadedUsername,f=!1,u="checking",g=0,p=!1,h=!1,d=!1,m=0,v=!1,C=!1,L=0,O,w;const S=P=>{r(".publishing-status").textContent=P},b=(P,F="GET",B,j)=>gt(`/api/sessiongraph/publishing/${P}`,"Could not reach publishing.",{method:F,signal:j?AbortSignal.any([j,AbortSignal.timeout(3e4)]):AbortSignal.timeout(3e4),headers:{"Content-Type":"application/json","x-sessiongraph-action":"1"},...B===void 0?{}:{body:JSON.stringify(B)}});function E(){const P=u==="ready";r("[data-publish]").disabled=p||!c||!P||!l||d,r("[data-publish]").textContent=h?"Preparing…":d?"Published":f?"Update graph":"Publish graph",r("[data-publish]").title=P?l?c?"":"Waiting for a preview":"Sign in to publish":"Waiting for account status",r("[data-remove]").hidden=!f,r("[data-remove]").disabled=p||!P,r("[data-login]").hidden=!P||!!l||!!O,r("[data-login]").disabled=p||C,r("[data-login-label]").textContent=C?"Opening sign-in…":"Sign in with GitHub",r("[data-login]").setAttribute("aria-busy",String(C)),r("[data-account]").hidden=!l&&!O,r("[data-account]").textContent=l?`@${l}`:O?"Waiting for browser approval":"",r(".publishing-account-placeholder").hidden=u!=="checking"||!!l||!!O,r("[data-account-retry]").hidden=u!=="failed",r("[data-json]").disabled=!c,r("[data-retry]").disabled=p||h;for(const B of s.querySelectorAll("[data-field]")){const j=B.dataset.field;B.checked=i[j],B.disabled=p||j==="messageTimestamps"&&(!i.timestamps||!i.messageCounts),B.closest("label").title=j==="messageTimestamps"&&B.disabled&&!p?"Enable session times and message counts first":""}const F=r(".publishing-link");F.hidden=!l||!f,l&&(F.href=`https://sessiongraph.ai/@${l}`)}function k(P){r(".publishing-json").hidden=!P,r(".publishing-preview").hidden=P,r("[data-json]").textContent=P?"Back to graph":"View JSON",r("[data-json]").setAttribute("aria-pressed",String(P)),P&&(r(".publishing-json").textContent=c?JSON.stringify(c.graph,null,2):"",r(".publishing-json").focus())}function x(P){r(".publishing-error").hidden=!P,r("[data-preview-error]").textContent=P}async function y(){const P=++g;c=void 0,d=!1;const F=()=>s.open&&P===g;w?.abort();const B=new AbortController;if(w=B,h=!!o.length,x(""),k(!1),r(".publishing-json").textContent="",E(),r(".publishing-preview").setAttribute("aria-busy",String(h)),!o.length){r(".publishing-preview").textContent="Choose sessions on the map to share.";return}a||(r(".publishing-preview").textContent="Preparing preview…");try{const j=await b("preview","POST",{ids:o,settings:i},B.signal);if(!F())return;if(a)a.setData(j.graph);else{if(await new Promise(Me=>requestAnimationFrame(()=>window.setTimeout(Me,0))),!F())return;const{createPublicViewer:Y}=await br(async()=>{const{createPublicViewer:Me}=await import("./public-viewer-B3t-LR4T.js");return{createPublicViewer:Me}},__vite__mapDeps([0,1,2,3]));if(!F())return;a=Y(r(".publishing-preview"),j.graph)}c=j,i=j.graph.settings}catch(j){F()&&(c=void 0,a?.dispose(),a=void 0,r(".publishing-preview").textContent="",x(j.message))}finally{F()&&(h=!1,r(".publishing-preview").setAttribute("aria-busy","false"),E())}}async function A(){const P=L;u="checking",E();try{const F=await n.check();if(!s.open||P!==L)return;({username:l,published:f}=F),u="ready",l&&(O=void 0,r(".publishing-connect").hidden=!0,window.clearInterval(m),m=0)}catch{if(!s.open||P!==L)return;u="failed"}return E(),u==="ready"}async function D(){if(v||!s.open)return;const P=L;v=!0,r("[data-check]").disabled=!0;try{const F=await b("poll","POST",{});if(!s.open||P!==L)return;if(F.username){window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,l=F.username,E();const B=await A();s.open&&P===L&&S(B&&!l?"Sign-in expired. Please try again.":"Signed in.")}}catch(F){if(!s.open||P!==L)return;[400,401].includes(F.status)&&(window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,E()),S(F.message)}finally{v=!1,r("[data-check]").disabled=!1}}r("[data-login]").onclick=async()=>{if(u!=="ready"||l||C||O)return;const P=++L;C=!0,E(),S("Preparing browser sign-in…");let F=null;if(!is())try{F=window.open("about:blank","_blank"),F&&(F.opener=null)}catch{F=null}try{const B=await b("login","POST",{});if(!s.open||P!==L){F?.close();return}const j=El(B.url);if(new URL(j).origin!=="https://sessiongraph.ai"||typeof B.code!="string")throw new Error("Could not prepare browser sign-in. Please try again.");O=j,r("[data-code]").textContent=B.code,r("[data-connect]").href=j,r("[data-connect-url]").value=j,r(".publishing-connect").hidden=!1,window.clearInterval(m),m=window.setInterval(()=>{D()},4e3),r("[data-connect]").focus(),S("Continue in your browser to connect this app."),is()?await H(r("[data-connect]")):F&&(F.location.replace(j),S("Sign in in the browser tab and confirm the matching code, then return here."))}catch(B){F?.close(),P===L&&S(B.message)}finally{P===L&&(C=!1,E())}};async function H(P){if(P.getAttribute("aria-busy")==="true")return;P.setAttribute("aria-busy","true");const F=L,B=P.hasAttribute("data-connect");try{await Sl(P.href),B&&s.open&&F===L&&S("Browser opened. Sign in and confirm the matching code, then return here.")}catch{s.open&&F===L&&S(B?"Could not open your browser. Copy the browser link below and paste it into your browser to continue.":"Could not open your browser. Copy the link and open it in your browser.")}finally{P.removeAttribute("aria-busy")}}s.addEventListener("click",P=>{const F=P.target.closest('a[target="_blank"]');!F||!is()||P.defaultPrevented||P.button!==0||(P.preventDefault(),H(F))}),r("[data-copy-link]").onclick=async()=>{const P=r("[data-connect-url]");try{await navigator.clipboard.writeText(P.value),S("Browser link copied. Paste it into your browser to sign in and confirm the code.")}catch{P.focus(),P.select(),S("Browser link selected. Copy it and paste it into your browser.")}},r("[data-account-retry]").onclick=()=>{A()},r("[data-check]").onclick=()=>{D()};for(const P of s.querySelectorAll("[data-field]"))P.onchange=()=>{i=Py({...i,[P.dataset.field]:P.checked}),S(""),y()};return r("[data-retry]").onclick=()=>{S(""),y()},r("[data-publish]").onclick=async()=>{if(!(p||!c||u!=="ready"||!l||d)){p=!0,E(),S("Publishing…");try{await b("publish","POST",{id:c.id,confirmed:!0}),f=!0,d=!0,x(""),S("Published.")}catch(P){S(""),x(P.message),P.status===401&&(l=null,f=!1)}finally{p=!1,E()}}},r("[data-remove]").onclick=async()=>{if(!(p||u!=="ready"||!l||!f)){p=!0,E();try{await b("unpublish","POST",{}),f=!1,S("Unpublished."),await y()}catch(P){S(P.message),P.status===401&&(l=null,f=!1)}finally{p=!1,E()}}},r("[data-json]").onclick=()=>{c&&k(r(".publishing-json").hidden)},s.addEventListener("close",()=>{s.open||(g++,L++,C=!1,window.clearInterval(m),m=0,w?.abort(),a?.dispose(),a=void 0,c=void 0,e())}),{async open(P){if(s.open)return;g++,L++,window.clearInterval(m),m=0,a?.dispose(),a=void 0,i={...hr},r(".publishing-settings").open=!1,o=[...P],u="checking",c=void 0,d=!1,h=!0,C=!1,S(""),x(""),k(!1),r(".publishing-preview").textContent="Preparing preview…",r(".publishing-connect").hidden=!O,r(".publishing-scope").textContent=`${o.length.toLocaleString()} sessions selected`,E(),s.showModal(),e();const F=L,B=A().then(()=>{s.open&&F===L&&O&&!l&&!m&&(m=window.setInterval(()=>{D()},4e3),D())});await Promise.all([y(),B])},dispose(){g++,L++,w?.abort(),window.clearInterval(m),a?.dispose(),a=void 0,s.close(),s.remove()}}}const By=3e4;function Uy(e=fetch){let t,n,s=!1;async function r(){const i=await e("/api/sessiongraph/publishing/status",{signal:AbortSignal.timeout(3e4)});if(i.status===401)return{username:null,published:!1};if(!i.ok)throw new Error("Could not check sign-in.");const a=await i.json();if(a?.username===null)return{username:null,published:!1};if(typeof a?.username!="string"||!a.username)throw new Error("Could not check sign-in.");return{username:a.username,published:!!a.publication}}const o=()=>t??=r().finally(()=>{t=void 0});return o().then(i=>{s||(n={account:i,checkedAt:Date.now()})},()=>{}),{get preloadedUsername(){return n?.account.username??null},check(){s=!0;const i=n;return n=void 0,i&&Date.now()-i.checkedAt<By?Promise.resolve(i.account):o()}}}const qy=Uy(),We=()=>hs(),I=e=>document.querySelector(e),X=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]),dd=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e),le=e=>e.toLocaleString("en"),Gy=[new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}),new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"})],Yy=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}),Ky=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),ys=(e,t=!1)=>Gy[Number(t)].format(e),gr=e=>Yy.format(e),uc=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`};let q,se={nodes:[],edges:[],lanes:[],start:0,end:0},he=[],Oi=[],ud=new Set,cs=new Map,vs=new Map,fd=new Map,Q,hd=!0,ss,G=new URLSearchParams(location.search).get("session"),Xe,Te,Xs=0,kt="",$n="",Qe="",en=vi.days,Rt="",Dt="",Ln=!0,tn=!1,Qs=0,Ko,Zo,Pi=0,Vt=!1,ce=1,mr=0,ls=0,at=ml([]),zo="",pd=vl([]),er,vo,fc,Kn=0,Zn=!1,Z={...Or},nn=!0,Nr,Ne,bs=!1,Jo="";try{Z=bl(localStorage)}catch{nn=!1}const gd=matchMedia("(prefers-reduced-motion: reduce)");I("#app").innerHTML=`
113
+ <footer><a class="publishing-link text-button" target="_blank" rel="noopener noreferrer" hidden>View profile ↗</a><button class="text-button" data-remove hidden>Unpublish</button><button class="primary-button" data-publish disabled>Publish graph</button></footer>`,document.body.append(s),s.prepend(jy(s,"publish",()=>t()));const r=P=>s.querySelector(P);r(".publishing-disclosure").textContent=Vy,r("[data-login]").prepend(wo("github"));let o=[],i={...hr},a,c,l=n.preloadedUsername,f=!1,u="checking",g=0,p=!1,h=!1,d=!1,m=0,v=!1,C=!1,L=0,O,w;const S=P=>{r(".publishing-status").textContent=P},b=(P,F="GET",B,j)=>gt(`/api/sessiongraph/publishing/${P}`,"Could not reach publishing.",{method:F,signal:j?AbortSignal.any([j,AbortSignal.timeout(3e4)]):AbortSignal.timeout(3e4),headers:{"Content-Type":"application/json","x-sessiongraph-action":"1"},...B===void 0?{}:{body:JSON.stringify(B)}});function E(){const P=u==="ready";r("[data-publish]").disabled=p||!c||!P||!l||d,r("[data-publish]").textContent=h?"Preparing…":d?"Published":f?"Update graph":"Publish graph",r("[data-publish]").title=P?l?c?"":"Waiting for a preview":"Sign in to publish":"Waiting for account status",r("[data-remove]").hidden=!f,r("[data-remove]").disabled=p||!P,r("[data-login]").hidden=!P||!!l||!!O,r("[data-login]").disabled=p||C,r("[data-login-label]").textContent=C?"Opening sign-in…":"Sign in with GitHub",r("[data-login]").setAttribute("aria-busy",String(C)),r("[data-account]").hidden=!l&&!O,r("[data-account]").textContent=l?`@${l}`:O?"Waiting for browser approval":"",r(".publishing-account-placeholder").hidden=u!=="checking"||!!l||!!O,r("[data-account-retry]").hidden=u!=="failed",r("[data-json]").disabled=!c,r("[data-retry]").disabled=p||h;for(const B of s.querySelectorAll("[data-field]")){const j=B.dataset.field;B.checked=i[j],B.disabled=p||j==="messageTimestamps"&&(!i.timestamps||!i.messageCounts),B.closest("label").title=j==="messageTimestamps"&&B.disabled&&!p?"Enable session times and message counts first":""}const F=r(".publishing-link");F.hidden=!l||!f,l&&(F.href=`https://sessiongraph.ai/@${l}`)}function k(P){r(".publishing-json").hidden=!P,r(".publishing-preview").hidden=P,r("[data-json]").textContent=P?"Back to graph":"View JSON",r("[data-json]").setAttribute("aria-pressed",String(P)),P&&(r(".publishing-json").textContent=c?JSON.stringify(c.graph,null,2):"",r(".publishing-json").focus())}function x(P){r(".publishing-error").hidden=!P,r("[data-preview-error]").textContent=P}async function y(){const P=++g;c=void 0,d=!1;const F=()=>s.open&&P===g;w?.abort();const B=new AbortController;if(w=B,h=!!o.length,x(""),k(!1),r(".publishing-json").textContent="",E(),r(".publishing-preview").setAttribute("aria-busy",String(h)),!o.length){r(".publishing-preview").textContent="Choose sessions on the map to share.";return}a||(r(".publishing-preview").textContent="Preparing preview…");try{const j=await b("preview","POST",{ids:o,settings:i},B.signal);if(!F())return;if(a)a.setData(j.graph);else{if(await new Promise(Me=>requestAnimationFrame(()=>window.setTimeout(Me,0))),!F())return;const{createPublicViewer:Y}=await br(async()=>{const{createPublicViewer:Me}=await import("./public-viewer-DVqMq2gi.js");return{createPublicViewer:Me}},__vite__mapDeps([0,1,2,3]));if(!F())return;a=Y(r(".publishing-preview"),j.graph)}c=j,i=j.graph.settings}catch(j){F()&&(c=void 0,a?.dispose(),a=void 0,r(".publishing-preview").textContent="",x(j.message))}finally{F()&&(h=!1,r(".publishing-preview").setAttribute("aria-busy","false"),E())}}async function A(){const P=L;u="checking",E();try{const F=await n.check();if(!s.open||P!==L)return;({username:l,published:f}=F),u="ready",l&&(O=void 0,r(".publishing-connect").hidden=!0,window.clearInterval(m),m=0)}catch{if(!s.open||P!==L)return;u="failed"}return E(),u==="ready"}async function D(){if(v||!s.open)return;const P=L;v=!0,r("[data-check]").disabled=!0;try{const F=await b("poll","POST",{});if(!s.open||P!==L)return;if(F.username){window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,l=F.username,E();const B=await A();s.open&&P===L&&S(B&&!l?"Sign-in expired. Please try again.":"Signed in.")}}catch(F){if(!s.open||P!==L)return;[400,401].includes(F.status)&&(window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,E()),S(F.message)}finally{v=!1,r("[data-check]").disabled=!1}}r("[data-login]").onclick=async()=>{if(u!=="ready"||l||C||O)return;const P=++L;C=!0,E(),S("Preparing browser sign-in…");let F=null;if(!is())try{F=window.open("about:blank","_blank"),F&&(F.opener=null)}catch{F=null}try{const B=await b("login","POST",{});if(!s.open||P!==L){F?.close();return}const j=El(B.url);if(new URL(j).origin!=="https://sessiongraph.ai"||typeof B.code!="string")throw new Error("Could not prepare browser sign-in. Please try again.");O=j,r("[data-code]").textContent=B.code,r("[data-connect]").href=j,r("[data-connect-url]").value=j,r(".publishing-connect").hidden=!1,window.clearInterval(m),m=window.setInterval(()=>{D()},4e3),r("[data-connect]").focus(),S("Continue in your browser to connect this app."),is()?await H(r("[data-connect]")):F&&(F.location.replace(j),S("Sign in in the browser tab and confirm the matching code, then return here."))}catch(B){F?.close(),P===L&&S(B.message)}finally{P===L&&(C=!1,E())}};async function H(P){if(P.getAttribute("aria-busy")==="true")return;P.setAttribute("aria-busy","true");const F=L,B=P.hasAttribute("data-connect");try{await Sl(P.href),B&&s.open&&F===L&&S("Browser opened. Sign in and confirm the matching code, then return here.")}catch{s.open&&F===L&&S(B?"Could not open your browser. Copy the browser link below and paste it into your browser to continue.":"Could not open your browser. Copy the link and open it in your browser.")}finally{P.removeAttribute("aria-busy")}}s.addEventListener("click",P=>{const F=P.target.closest('a[target="_blank"]');!F||!is()||P.defaultPrevented||P.button!==0||(P.preventDefault(),H(F))}),r("[data-copy-link]").onclick=async()=>{const P=r("[data-connect-url]");try{await navigator.clipboard.writeText(P.value),S("Browser link copied. Paste it into your browser to sign in and confirm the code.")}catch{P.focus(),P.select(),S("Browser link selected. Copy it and paste it into your browser.")}},r("[data-account-retry]").onclick=()=>{A()},r("[data-check]").onclick=()=>{D()};for(const P of s.querySelectorAll("[data-field]"))P.onchange=()=>{i=Py({...i,[P.dataset.field]:P.checked}),S(""),y()};return r("[data-retry]").onclick=()=>{S(""),y()},r("[data-publish]").onclick=async()=>{if(!(p||!c||u!=="ready"||!l||d)){p=!0,E(),S("Publishing…");try{await b("publish","POST",{id:c.id,confirmed:!0}),f=!0,d=!0,x(""),S("Published.")}catch(P){S(""),x(P.message),P.status===401&&(l=null,f=!1)}finally{p=!1,E()}}},r("[data-remove]").onclick=async()=>{if(!(p||u!=="ready"||!l||!f)){p=!0,E();try{await b("unpublish","POST",{}),f=!1,S("Unpublished."),await y()}catch(P){S(P.message),P.status===401&&(l=null,f=!1)}finally{p=!1,E()}}},r("[data-json]").onclick=()=>{c&&k(r(".publishing-json").hidden)},s.addEventListener("close",()=>{s.open||(g++,L++,C=!1,window.clearInterval(m),m=0,w?.abort(),a?.dispose(),a=void 0,c=void 0,e())}),{async open(P){if(s.open)return;g++,L++,window.clearInterval(m),m=0,a?.dispose(),a=void 0,i={...hr},r(".publishing-settings").open=!1,o=[...P],u="checking",c=void 0,d=!1,h=!0,C=!1,S(""),x(""),k(!1),r(".publishing-preview").textContent="Preparing preview…",r(".publishing-connect").hidden=!O,r(".publishing-scope").textContent=`${o.length.toLocaleString()} sessions selected`,E(),s.showModal(),e();const F=L,B=A().then(()=>{s.open&&F===L&&O&&!l&&!m&&(m=window.setInterval(()=>{D()},4e3),D())});await Promise.all([y(),B])},dispose(){g++,L++,w?.abort(),window.clearInterval(m),a?.dispose(),a=void 0,s.close(),s.remove()}}}const By=3e4;function Uy(e=fetch){let t,n,s=!1;async function r(){const i=await e("/api/sessiongraph/publishing/status",{signal:AbortSignal.timeout(3e4)});if(i.status===401)return{username:null,published:!1};if(!i.ok)throw new Error("Could not check sign-in.");const a=await i.json();if(a?.username===null)return{username:null,published:!1};if(typeof a?.username!="string"||!a.username)throw new Error("Could not check sign-in.");return{username:a.username,published:!!a.publication}}const o=()=>t??=r().finally(()=>{t=void 0});return o().then(i=>{s||(n={account:i,checkedAt:Date.now()})},()=>{}),{get preloadedUsername(){return n?.account.username??null},check(){s=!0;const i=n;return n=void 0,i&&Date.now()-i.checkedAt<By?Promise.resolve(i.account):o()}}}const qy=Uy(),We=()=>hs(),I=e=>document.querySelector(e),X=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]),dd=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e),le=e=>e.toLocaleString("en"),Gy=[new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}),new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"})],Yy=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}),Ky=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),ys=(e,t=!1)=>Gy[Number(t)].format(e),gr=e=>Yy.format(e),uc=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`};let q,se={nodes:[],edges:[],lanes:[],start:0,end:0},he=[],Oi=[],ud=new Set,cs=new Map,vs=new Map,fd=new Map,Q,hd=!0,ss,G=new URLSearchParams(location.search).get("session"),Xe,Te,Xs=0,kt="",$n="",Qe="",en=vi.days,Rt="",Dt="",Ln=!0,tn=!1,Qs=0,Ko,Zo,Pi=0,Vt=!1,ce=1,mr=0,ls=0,at=ml([]),zo="",pd=vl([]),er,vo,fc,Kn=0,Zn=!1,Z={...Or},nn=!0,Nr,Ne,bs=!1,Jo="";try{Z=bl(localStorage)}catch{nn=!1}const gd=matchMedia("(prefers-reduced-motion: reduce)");I("#app").innerHTML=`
114
114
  <main class="map" aria-label="Session map">
115
115
  <h1 class="sr-only">SessionGraph — Explore &amp; visualize all your LLM sessions</h1>
116
116
  <div id="scene"></div>
@@ -162,7 +162,7 @@ ${v.output}`:""].filter(Boolean).join(`
162
162
  <p id="welcome-tagline">Explore your coding agent history as an interactive graph.</p>
163
163
  <button type="button" class="primary-button" aria-describedby="welcome-permission" autofocus>Start ${W("arrow-right")}</button>
164
164
  <small id="welcome-permission">After you click Start, your system may ask for permission to access your files.</small>
165
- </div>`;document.body.append(Ge);let Ri=!1,hc=!1;function Di(){if(Ri){Et.open(!0);return}Ge.open||(Ge.showModal(),xt())}Ge.addEventListener("cancel",e=>e.preventDefault());Ge.addEventListener("keydown",e=>e.stopPropagation());Ge.querySelector("button").addEventListener("click",()=>{Ri=!0,Ge.close(),Et.open(!0)});const In=new Pu(I("#session-list"),{key:e=>"session"in e?`session:${e.session.id}`:`date:${e.year}:${e.label}`,estimate:e=>"session"in e?Z.density==="compact"?66:76:42,render:e=>{const t=document.createElement("template");if("session"in e){const n=e.session,s=Zt(n);t.innerHTML=`<button class="session-card ${G===n.id?"selected":""}" data-session="${X(n.id)}" aria-pressed="${G===n.id}" title="${X(n.title)}"><span class="session-dot" style="--node-color:${fd.get(n.id)}"></span><span class="session-card-body"><span class="session-title">${X(n.title)}</span><span class="session-meta">${n.forkID?W("git-fork"):n.parentID?W("network"):""}<span class="source-badge" data-source="${X(n.source||"opencode")}">${Cn(n.source)}${X(Fe(n.source))}</span><span title="${n.activity?.lastMessageAt?"Latest saved message":"Session created; message time unavailable"}">${Ky.format(s)}</span></span></span></button>`}else t.innerHTML=`<div class="list-date">${e.label}<span>${e.year}</span></div>`;return t.content.firstElementChild}});Gg();hg();const md=Iy(I(".custom-dates"),(e,t)=>{en=0,Rt=e,Dt=t,Ye(!0)},ge),xt=()=>{const e=!!document.querySelector("dialog[open]");e&&Vt&&ge(),Q?.setSuspended(e)},Vi=new Wg,et=Dg(I("#tooltip"),I("#scene"),Vi);let Xo;const On=Rg(I("#inspector"),Vi,{select:e=>{const t=e?.sessionID===G?e:null;et.clear(),Q?.selectEvent(t?.id||null),t&&!Vt&&(ce=1,Rn(),Q?.focusEvent(Te?.items.find(n=>n.id===t.id)||t))}});function Ni(e){const t=q?.sessions.find(n=>n.id===G);t&&(et.clear(),ge(),pe("inspector",!0),On.open(t,e,e?Te?.revision:void 0,Te?.items.find(n=>n.id===e)?.kind==="commit"?"tools":"messages"))}const Pn=Ag({publishing:Wr,change:yd,getArchived:()=>tn,changeArchived:e=>{tn=e,Ye()},visibility:xt,previewSound:()=>{yr.play("select")},getSources:()=>Et.sources(),importSources:e=>Et.select(e)}),yr=new Og(Z,Pn.audioStatus);function Es(){Q?.applyPreferences(Z),yr.configure(Z);const e=document.documentElement.dataset.density!==Z.density;document.documentElement.dataset.density=Z.density,e&&In.resetHeights(),document.documentElement.dataset.motion=String(Mg(Z,gd.matches)),document.documentElement.style.setProperty("--panel-opacity",`${Z.panelOpacity}%`);const t=I("#mute-audio"),n=ku(Z.muted);t.setAttribute("aria-pressed",String(Z.muted)),t.setAttribute("aria-label",n.label),t.title=n.label,t.innerHTML=W(n.glyph),Pn.render(Z,nn||bs,Ne?.state||"saved",Ne?.error),We()}function yd(e){const t=e.autoImport!==void 0&&e.autoImport!==Z.autoImport;Z=Pr({...Z,...e});try{nn=wl(localStorage,Z)}catch{nn=!1}Es(),q&&Z.grouping!==bn&&Ye(!0),Fi({preferences:{...Z},...t?{autoImport:Z.autoImport}:{}})}function Fi(e){Ne?.save(e)}function Qo(){return{sourceID:$n,projectID:kt,directory:Qe,days:en,fromDate:Rt,toDate:Dt,includeChildren:Ln,includeArchived:tn}}I("#open-settings").addEventListener("click",()=>Pn.open());I("#mute-audio").addEventListener("click",()=>yd({muted:!Z.muted}));const Zy=()=>Es();gd.addEventListener("change",Zy);const zy=e=>{if(e.key===Ci)try{Z={...bl(localStorage),autoImport:Z.autoImport},Es(),q&&Z.grouping!==bn&&Ye(!0)}catch{}};window.addEventListener("storage",zy);Es();Ne=new wg(async e=>{await gt("/api/sessiongraph/settings","Could not save settings.",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"settings"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3),keepalive:!0})},e=>{Pn.render(Z,nn||bs,e,Ne?.error),e==="error"&&Ht(Ne?.error||"Could not save settings."),e==="saved"&&Nr?.check()});const Jy=pg(xt),Et=mg(e=>_i(e),xt,Ht);Nr=new bg({eligible:()=>Z.autoImport&&!Ne?.pending&&document.visibilityState==="visible"&&!!(q&&!q.onboarding&&q.sources?.some(e=>e.selected)),busy:()=>Et.busy||!!document.querySelector("dialog[open]"),refresh:()=>Et.refresh(!0)});const Fr=new AbortController,Ss=()=>{document.visibilityState==="visible"&&(Ne?.state==="error"&&Ne.flush(),Nr?.check())};window.addEventListener("focus",Ss,{signal:Fr.signal});document.addEventListener("visibilitychange",Ss,{signal:Fr.signal});window.setInterval(Ss,yg);I("#manage-sources").addEventListener("click",()=>Pn.open("sources"));document.addEventListener("sessiongraph-import-status",e=>{const t=e.detail;Nr?.activity(),Pn.importStatus(t),q&&(q.importing=t.running),he.length||Hr(),I("#refresh").classList.toggle("spinning",t.running),I(".connection").title=t.running?`Importing ${Fe(t.source)} · ${t.imported} sessions saved`:t.failed?t.errors[0]||"Import failed.":"Local library · SQLite"},{signal:Fr.signal});const Hi=Ou(Dn,xt,e=>{Jy.open(e)});I("#search").addEventListener("click",Hi.open);function pe(e,t){Vt&&(e==="timeline"?!t:t)&&ge();const n=I(`#${e}`);n.hidden=!t,I(`#toggle-${e}`).setAttribute("aria-expanded",String(t)),t&&innerWidth<760&&e!=="timeline"&&pe(e==="explorer"?"inspector":"explorer",!1)}pe("explorer",innerWidth>=760);let bo=[];for(const e of["explorer","timeline","inspector"])I(`#toggle-${e}`).addEventListener("click",()=>pe(e,I(`#${e}`).hidden));I("#close-explorer").addEventListener("click",()=>{pe("explorer",!1),I("#toggle-explorer").focus()});I("#close-timeline").addEventListener("click",()=>{ge(),pe("timeline",!1),I("#toggle-timeline").focus()});function Ht(e){I("#toast").textContent=e,I("#toast").hidden=!1,window.setTimeout(()=>{I("#toast").hidden=!0},3500)}function Wi(){Xo?.(),pe("inspector",!1),On.close(),et.clear(),I("#session-inspector").replaceChildren(),I("#toggle-inspector").hidden=!0}Wi();async function Xy(){try{const{TimelineScene:e}=await br(async()=>{const{TimelineScene:t}=await import("./scene-CnihjOu5.js");return{TimelineScene:t}},__vite__mapDeps([1,2]));Q=new e(I("#scene"),{onSelect:t=>{t?(yr.play("select"),Dn(t)):qi()},onPlaybackInterrupt:ge,onEvent:t=>{yr.play("select"),Ni(t)},onEventHover:(t,n,s,r)=>{ss=void 0,t&&G&&Te?et.show(t,G,Te.revision,n,s,r):et.clear()},onHover:(t,n,s)=>{const r=I("#tooltip");r.classList.contains("message-tooltip")&&(et.clear(),ss=void 0),r.hidden!==!t&&(r.hidden=!t),t&&(ss!==t.session&&(ss=t.session,r.innerHTML=`<strong>${X(t.session.title)}</strong><span>${X(Fe(t.session.source))} · ${t.session.activity?.lastMessageAt?`Last message ${gr(t.session.activity.lastMessageAt)}`:"Message time unavailable"}<br>Started ${gr(t.session.created)}</span>`),r.style.left=`${Math.min(n+18,I("#scene").clientWidth-280)}px`,r.style.top=`${Math.max(8,Math.min(s-32,I("#scene").clientHeight-110))}px`)}},{panels:[I("#explorer"),I("#inspector"),I("#timeline")]}),Q.applyPreferences(Z),Q.setSuspended(!!document.querySelector("dialog[open]")),q&&(Q.setGraph(se,!0),G&&(Q.select(G),Q.focus(G)),Xe&&Q.setFiles(Xe.files),Te&&Q.setEvents(Te.items))}catch(e){console.error("[sessiongraph] Graphics initialization failed",e),Ht("3D requires WebGL. You can still browse sessions in the list.")}finally{hd=!1,q&&Hr()}}I("#scene").addEventListener("scene-error",e=>Ht(e.detail));async function ji(e,t,n="Could not load session details."){const s=AbortSignal.timeout(18e4);return gt(e,n,{signal:t?AbortSignal.any([t,s]):s})}async function _i(e=!1){const t=I("#refresh");t.disabled=!0,t.classList.add("spinning");try{const n=Ne?.revision,s=await ji("/api/sessiongraph",void 0,"Could not load the library."),r=q,o=G?cs.get(G):void 0,i=!!(r&&se.nodes.length);if(q=s,!Ne?.pending&&n===Ne?.revision){Z={...Pr(s.preferences||Z),autoImport:s.autoImport===!0};try{nn=wl(localStorage,Z)}catch{nn=!1}if(!bs){const c=kg(s.viewState);({sourceID:$n,projectID:kt,directory:Qe,days:en,fromDate:Rt,toDate:Dt,includeChildren:Ln,includeArchived:tn}=c),I("#children").checked=Ln,Jo=JSON.stringify(c),s.preferences||Fi({preferences:{...Z}})}Es()}if(bs=!0,I("#connection-label").textContent="Local library",I(".connection").classList.add("connected"),I(".connection").title=`Connected · ${le(q.sessions.length)} sessions`,!e&&q.onboarding&&!Ri&&Di(),!q.onboarding&&!hc&&(hc=!0,requestAnimationFrame(()=>{window.setTimeout(()=>{Xy()},0)})),r&&Z.grouping===bn&&JSON.stringify(r.sessions)===JSON.stringify(s.sessions)&&JSON.stringify(r.projects)===JSON.stringify(s.projects)){Hr();return}Vi.clear(),cs=new Map(q.sessions.map(c=>[c.id,c])),I("#source").innerHTML='<option value="">All sources</option>'+(q.sources||[]).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${c.sessions.toLocaleString()}</option>`).join(""),I("#source").value=$n,Hi.setData(q);const a=new Map;if(q.sessions.forEach(c=>a.set(c.projectID,(a.get(c.projectID)||0)+1)),I("#project").innerHTML='<option value="">All projects</option>'+[...q.projects].filter(c=>a.has(c.id)).sort((c,l)=>(a.get(l.id)||0)-(a.get(c.id)||0)).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${le(a.get(c.id)||0)}</option>`).join(""),I("#project").value=kt,Bi(),G&&!r){const c=q.sessions.find(u=>u.id===G),{min:l,max:f}=gl(Qo());c&&(c.created<l||c.created>f)&&(en=0,Rt="",Dt=""),c?.archived&&(tn=!0)}if(Ye(!i,i),G&&!r)Dn(G);else if(G){const c=cs.get(G);if(c&&JSON.stringify(o)!==JSON.stringify(c)){const l=I(".detail-scroll")?.scrollTop||0;Xe=void 0,Te=void 0,Cd(c,!1),I(".detail-scroll").scrollTop=l,vr(c.id),Gi(c)}}else Wi();!e&&q.warnings.length&&Ht(q.warnings.join(" "))}catch(n){const s=n instanceof Tt?n.message:"Could not load the library.";if(e&&q){I(".connection").title=s;return}I("#connection-label").textContent="Connection unavailable",I(".connection").title="Connection unavailable",I(".connection").classList.remove("connected"),I("#graph-message").hidden=!1;const r=n instanceof Tt&&n.code==="LIBRARY_VERSION";I("#graph-message").innerHTML=`${W("terminal")}<h3>Local library unavailable</h3><p role="alert">${X(s)}</p>${r?"":`<button class="primary-button" id="retry">Retry ${W("arrow-right")}</button>`}`,I("#retry")?.addEventListener("click",()=>{_i().then(Ss)}),q||(I("#session-list").innerHTML='<p class="empty-list">Your sessions will appear here once connected.</p>',I("#list-count").textContent="Offline"),We()}finally{t.disabled=!1,t.classList.remove("spinning")}}function Bi(){const e=q?.sessions.filter(s=>!kt||s.projectID===kt)||[],t=[...new Set(e.map(s=>s.directory))].sort((s,r)=>It(s).localeCompare(It(r))),n=new Set(q?.projects.flatMap(s=>s.worktrees));I("#directory").innerHTML='<option value="">All directories</option>'+t.map(s=>`<option value="${X(s)}">${n.has(s)?"⑂ ":""}${X(It(s))}</option>`).join(""),t.includes(Qe)||(Qe=""),I("#directory").value=Qe}let bn;function Ye(e=!1,t=!1){if(!q)return;bn!==Z.grouping&&(e=!0,t=!1),bn=Z.grouping,t||(ge(),ce=1);const n=document.activeElement?.closest("[data-session]")?.dataset.session,{min:s,max:r}=gl(Qo());he=q.sessions.filter(a=>Tg(a,$n)&&(!kt||a.projectID===kt)&&(!Qe||a.directory===Qe)&&(Ln||!a.parentID||!!a.forkID)&&(tn||!a.archived)&&a.created>=s&&a.created<=r),Oi=[...he].sort((a,c)=>Zt(c)-Zt(a)),ud=new Set(he.map(a=>a.id)),Hi.setScope(he.map(a=>a.id)),se=mc(he,q.projects,t?se:void 0,bn),fd=new Map(se.nodes.map(a=>[a.session.id,a.color])),Q?.setCutoff(ce),Q?.setGraph(se,e,t),Hr(),document.querySelectorAll("[data-days]").forEach(a=>{const c=!Rt&&!Dt&&a.dataset.days===String(en);a.classList.toggle("active",c),a.setAttribute("aria-pressed",String(c))}),Qy(t),t&&n&&In.getElement(vs.get(n))?.focus({preventScroll:!0}),ev(),G&&!he.some(a=>a.id===G)?qi():G&&Xe&&Q?.setFiles(Xe.files),G&&Te&&Q?.setEvents(Te.items),We();const o=Qo(),i=JSON.stringify(o);bs&&i!==Jo&&(Jo=i,Fi({viewState:o}))}function Hr(){Ui();const e=I("#graph-message");e.hidden=!!(he.length&&Q),he.length?Q||(e.innerHTML=hd?"<h3>Preparing the map…</h3>":`${W("box")}<h3>WebGL is unavailable.</h3><p>You can explore every session and its file details in the list.</p>`):e.innerHTML=q?.importing?'<div class="loading-orbit"><span></span><span></span><span></span></div><h3>Importing your sessions…</h3><p>Your map will appear when the import finishes.</p>':q&&!q.sessions.length?`${W("folder")}<p>Choose a source with saved conversations to get started.</p><button class="primary-button" id="empty-sources">Choose sources ${W("arrow-right")}</button>`:`${W("search")}<h3>No matching sessions</h3><button class="text-button" id="clear-filters">Reset filters ${W("rotate-ccw")}</button>`,I("#clear-filters")?.addEventListener("click",()=>vd()),I("#empty-sources")?.addEventListener("click",()=>{q?.onboarding?Di():Et.open()}),We()}function Ui(e=!1){const t=!!(he.length&&Q);(e||!t)&&(window.clearTimeout(Kn),Kn=0,Zn=!1),I(".playback-share").classList.toggle("ready",Zn&&t),I("#share-playback").disabled=!Zn||!t,t&&!Zn&&!Kn&&(Kn=window.setTimeout(()=>{Kn=0,Zn=!0,Ui()},1e3))}function vd(e){$n="",I("#source").value="",kt="",Qe="",en=e?0:vi.days,Rt="",Dt="",Ln=!0,tn=e?.archived===!0,I("#project").value="",I("#children").checked=!0,md.setRange("",""),Bi(),Ye(!0)}function Qy(e=!1){I("#list-count").textContent=le(he.length);const t=[];vs=new Map;let n="";for(const s of Oi){const r=Zt(s),o=ys(r,!0);o!==n&&t.push({label:ys(r),year:new Date(r).getFullYear()}),n=o,vs.set(s.id,t.length),t.push({session:s})}In.setItems(t,e),I("#session-list").querySelector(".empty-list")?.remove(),t.length||I("#session-list").insertAdjacentHTML("beforeend",'<p class="empty-list">No sessions match your filters.</p>')}function bd(e){for(const t of[e,G]){const n=t?In.getElement(vs.get(t)):void 0;n&&(n.classList.toggle("selected",t===G),n.setAttribute("aria-pressed",String(t===G)))}}function ev(){at=ml(he),pd=vl(he),zo="";const e=Lg(he.map(Zt),se.start,se.end),t=Math.max(...e,1);I("#histogram").innerHTML=e.map(n=>`<span style="height:${Math.max(4,n/t*100)}%;opacity:${n?.8:.15}" title="${n} session endpoints"></span>`).join(""),I("#date-label").textContent=se.start?`${ys(se.start,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear())} — ${ys(se.end,!0)}`:"No sessions",se.start&&md.setRange(Rt||uc(se.start),Dt||uc(se.end)),Rn()}function Rn(e=!1){I("#scrubber").value=String(Math.round(ce*1e3)),I("#timeline-cursor").style.left=`${ce*100}%`,I("#histogram").style.setProperty("--progress",`${ce*100}%`);const t=se.start+(se.end-se.start)*ce;I("#playback-date").textContent=se.start?ys(t,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear()):"—";const n=se.nodes.length?$g(t,se.end-se.start):"—";I("#playback-period").textContent!==n&&(I("#playback-period").textContent=n);const s=at.at(t,ce>=1),r=pd(t,ce>=1),o=`${s.tokens}:${s.sessions}:${r}`;o!==zo&&(zo=o,I("#playback-summary").hidden=he.length===0,I("#playback-sessions").textContent=le(r),I("#playback-tokens").textContent=at.recorded?dd(s.tokens):"—",I("#playback-summary").title=`${le(r)} sessions started. ${at.recorded?`${le(s.tokens)} burnt tokens`:"Token usage unavailable"}. Token totals are added at the latest saved message, including cache where reported. ${le(at.missing)} sessions have no recorded total.${at.partial?` ${le(at.partial)} recorded totals are partial.`:""}${at.untimed?` ${le(at.untimed)} totals have no message timestamp and are included only at the end.`:""}`),Q?.setCutoff(ce,e)}function ge(){if(Vt=!1,ls=0,I("#app").classList.remove("playback-mode"),er){const e=er;er=void 0,pe("explorer",e.explorer),pe("inspector",e.inspector&&!!G)}Q?.setPlaying(!1),cancelAnimationFrame(Pi),I("#play").innerHTML=W("play"),I("#play").setAttribute("aria-label","Play timeline"),We()}function wd(e){if(!Vt)return;const t=Math.max(0,e-mr);mr=e,document.hidden||(ce<1?ce=Math.min(1,ce+t*Z.playbackSpeed/bi):ls+=t),Rn(),Q?.setPlaybackOutro(ce>=1?Math.min(1,ls/ps):null),ce>=1&&ls>=ps+yl?ge():Pi=requestAnimationFrame(wd)}function qi(){const e=G;Ko?.abort(),Zo?.abort(),I("#file-legend").hidden=!0,Qs++,Xs++,G=null,Xe=void 0,Te=void 0,Q?.select(null),history.replaceState(null,"",location.pathname),Wi(),bd(e)}const ds=3;function tv(e,t,n){const s=t.forkID?[{id:t.forkID,label:"Forked from",kind:"git-fork"}]:t.parentID?[{id:t.parentID,label:"Parent",kind:"network"}]:[],r=q.sessions.filter(c=>c.forkID===t.id||!c.forkID&&c.parentID===t.id),o=[...s,...r.map(c=>({id:c.id,label:c.forkID?"Fork":"Child",kind:c.forkID?"git-fork":"network"}))];if(!o.length){e.hidden=!0;return}const i=c=>(c?o:o.slice(0,ds)).map(l=>{const f=cs.get(l.id);return`<button class="relation" data-related="${X(l.id)}" ${f?"":"disabled"}>${W(l.kind)}<span><small>${l.label}</small><strong>${X(f?.title||"Session no longer available")}</strong></span>${W("arrow-up-right")}</button>`}).join(""),a=c=>c?"Show fewer connections":`Show all ${le(o.length)} connections`;e.innerHTML=`<div class="section-label">Connections<span>${le(o.length)}</span></div><div id="connection-list">${i(n)}</div>
165
+ </div>`;document.body.append(Ge);let Ri=!1,hc=!1;function Di(){if(Ri){Et.open(!0);return}Ge.open||(Ge.showModal(),xt())}Ge.addEventListener("cancel",e=>e.preventDefault());Ge.addEventListener("keydown",e=>e.stopPropagation());Ge.querySelector("button").addEventListener("click",()=>{Ri=!0,Ge.close(),Et.open(!0)});const In=new Pu(I("#session-list"),{key:e=>"session"in e?`session:${e.session.id}`:`date:${e.year}:${e.label}`,estimate:e=>"session"in e?Z.density==="compact"?66:76:42,render:e=>{const t=document.createElement("template");if("session"in e){const n=e.session,s=Zt(n);t.innerHTML=`<button class="session-card ${G===n.id?"selected":""}" data-session="${X(n.id)}" aria-pressed="${G===n.id}" title="${X(n.title)}"><span class="session-dot" style="--node-color:${fd.get(n.id)}"></span><span class="session-card-body"><span class="session-title">${X(n.title)}</span><span class="session-meta">${n.forkID?W("git-fork"):n.parentID?W("network"):""}<span class="source-badge" data-source="${X(n.source||"opencode")}">${Cn(n.source)}${X(Fe(n.source))}</span><span title="${n.activity?.lastMessageAt?"Latest saved message":"Session created; message time unavailable"}">${Ky.format(s)}</span></span></span></button>`}else t.innerHTML=`<div class="list-date">${e.label}<span>${e.year}</span></div>`;return t.content.firstElementChild}});Gg();hg();const md=Iy(I(".custom-dates"),(e,t)=>{en=0,Rt=e,Dt=t,Ye(!0)},ge),xt=()=>{const e=!!document.querySelector("dialog[open]");e&&Vt&&ge(),Q?.setSuspended(e)},Vi=new Wg,et=Dg(I("#tooltip"),I("#scene"),Vi);let Xo;const On=Rg(I("#inspector"),Vi,{select:e=>{const t=e?.sessionID===G?e:null;et.clear(),Q?.selectEvent(t?.id||null),t&&!Vt&&(ce=1,Rn(),Q?.focusEvent(Te?.items.find(n=>n.id===t.id)||t))}});function Ni(e){const t=q?.sessions.find(n=>n.id===G);t&&(et.clear(),ge(),pe("inspector",!0),On.open(t,e,e?Te?.revision:void 0,Te?.items.find(n=>n.id===e)?.kind==="commit"?"tools":"messages"))}const Pn=Ag({publishing:Wr,change:yd,getArchived:()=>tn,changeArchived:e=>{tn=e,Ye()},visibility:xt,previewSound:()=>{yr.play("select")},getSources:()=>Et.sources(),importSources:e=>Et.select(e)}),yr=new Og(Z,Pn.audioStatus);function Es(){Q?.applyPreferences(Z),yr.configure(Z);const e=document.documentElement.dataset.density!==Z.density;document.documentElement.dataset.density=Z.density,e&&In.resetHeights(),document.documentElement.dataset.motion=String(Mg(Z,gd.matches)),document.documentElement.style.setProperty("--panel-opacity",`${Z.panelOpacity}%`);const t=I("#mute-audio"),n=ku(Z.muted);t.setAttribute("aria-pressed",String(Z.muted)),t.setAttribute("aria-label",n.label),t.title=n.label,t.innerHTML=W(n.glyph),Pn.render(Z,nn||bs,Ne?.state||"saved",Ne?.error),We()}function yd(e){const t=e.autoImport!==void 0&&e.autoImport!==Z.autoImport;Z=Pr({...Z,...e});try{nn=wl(localStorage,Z)}catch{nn=!1}Es(),q&&Z.grouping!==bn&&Ye(!0),Fi({preferences:{...Z},...t?{autoImport:Z.autoImport}:{}})}function Fi(e){Ne?.save(e)}function Qo(){return{sourceID:$n,projectID:kt,directory:Qe,days:en,fromDate:Rt,toDate:Dt,includeChildren:Ln,includeArchived:tn}}I("#open-settings").addEventListener("click",()=>Pn.open());I("#mute-audio").addEventListener("click",()=>yd({muted:!Z.muted}));const Zy=()=>Es();gd.addEventListener("change",Zy);const zy=e=>{if(e.key===Ci)try{Z={...bl(localStorage),autoImport:Z.autoImport},Es(),q&&Z.grouping!==bn&&Ye(!0)}catch{}};window.addEventListener("storage",zy);Es();Ne=new wg(async e=>{await gt("/api/sessiongraph/settings","Could not save settings.",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"settings"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3),keepalive:!0})},e=>{Pn.render(Z,nn||bs,e,Ne?.error),e==="error"&&Ht(Ne?.error||"Could not save settings."),e==="saved"&&Nr?.check()});const Jy=pg(xt),Et=mg(e=>_i(e),xt,Ht);Nr=new bg({eligible:()=>Z.autoImport&&!Ne?.pending&&document.visibilityState==="visible"&&!!(q&&!q.onboarding&&q.sources?.some(e=>e.selected)),busy:()=>Et.busy||!!document.querySelector("dialog[open]"),refresh:()=>Et.refresh(!0)});const Fr=new AbortController,Ss=()=>{document.visibilityState==="visible"&&(Ne?.state==="error"&&Ne.flush(),Nr?.check())};window.addEventListener("focus",Ss,{signal:Fr.signal});document.addEventListener("visibilitychange",Ss,{signal:Fr.signal});window.setInterval(Ss,yg);I("#manage-sources").addEventListener("click",()=>Pn.open("sources"));document.addEventListener("sessiongraph-import-status",e=>{const t=e.detail;Nr?.activity(),Pn.importStatus(t),q&&(q.importing=t.running),he.length||Hr(),I("#refresh").classList.toggle("spinning",t.running),I(".connection").title=t.running?`Importing ${Fe(t.source)} · ${t.imported} sessions saved`:t.failed?t.errors[0]||"Import failed.":"Local library · SQLite"},{signal:Fr.signal});const Hi=Ou(Dn,xt,e=>{Jy.open(e)});I("#search").addEventListener("click",Hi.open);function pe(e,t){Vt&&(e==="timeline"?!t:t)&&ge();const n=I(`#${e}`);n.hidden=!t,I(`#toggle-${e}`).setAttribute("aria-expanded",String(t)),t&&innerWidth<760&&e!=="timeline"&&pe(e==="explorer"?"inspector":"explorer",!1)}pe("explorer",innerWidth>=760);let bo=[];for(const e of["explorer","timeline","inspector"])I(`#toggle-${e}`).addEventListener("click",()=>pe(e,I(`#${e}`).hidden));I("#close-explorer").addEventListener("click",()=>{pe("explorer",!1),I("#toggle-explorer").focus()});I("#close-timeline").addEventListener("click",()=>{ge(),pe("timeline",!1),I("#toggle-timeline").focus()});function Ht(e){I("#toast").textContent=e,I("#toast").hidden=!1,window.setTimeout(()=>{I("#toast").hidden=!0},3500)}function Wi(){Xo?.(),pe("inspector",!1),On.close(),et.clear(),I("#session-inspector").replaceChildren(),I("#toggle-inspector").hidden=!0}Wi();async function Xy(){try{const{TimelineScene:e}=await br(async()=>{const{TimelineScene:t}=await import("./scene-B94ITHcm.js");return{TimelineScene:t}},__vite__mapDeps([1,2]));Q=new e(I("#scene"),{onSelect:t=>{t?(yr.play("select"),Dn(t)):qi()},onPlaybackInterrupt:ge,onEvent:t=>{yr.play("select"),Ni(t)},onEventHover:(t,n,s,r)=>{ss=void 0,t&&G&&Te?et.show(t,G,Te.revision,n,s,r):et.clear()},onHover:(t,n,s)=>{const r=I("#tooltip");r.classList.contains("message-tooltip")&&(et.clear(),ss=void 0),r.hidden!==!t&&(r.hidden=!t),t&&(ss!==t.session&&(ss=t.session,r.innerHTML=`<strong>${X(t.session.title)}</strong><span>${X(Fe(t.session.source))} · ${t.session.activity?.lastMessageAt?`Last message ${gr(t.session.activity.lastMessageAt)}`:"Message time unavailable"}<br>Started ${gr(t.session.created)}</span>`),r.style.left=`${Math.min(n+18,I("#scene").clientWidth-280)}px`,r.style.top=`${Math.max(8,Math.min(s-32,I("#scene").clientHeight-110))}px`)}},{panels:[I("#explorer"),I("#inspector"),I("#timeline")]}),Q.applyPreferences(Z),Q.setSuspended(!!document.querySelector("dialog[open]")),q&&(Q.setGraph(se,!0),G&&(Q.select(G),Q.focus(G)),Xe&&Q.setFiles(Xe.files),Te&&Q.setEvents(Te.items))}catch(e){console.error("[sessiongraph] Graphics initialization failed",e),Ht("3D requires WebGL. You can still browse sessions in the list.")}finally{hd=!1,q&&Hr()}}I("#scene").addEventListener("scene-error",e=>Ht(e.detail));async function ji(e,t,n="Could not load session details."){const s=AbortSignal.timeout(18e4);return gt(e,n,{signal:t?AbortSignal.any([t,s]):s})}async function _i(e=!1){const t=I("#refresh");t.disabled=!0,t.classList.add("spinning");try{const n=Ne?.revision,s=await ji("/api/sessiongraph",void 0,"Could not load the library."),r=q,o=G?cs.get(G):void 0,i=!!(r&&se.nodes.length);if(q=s,!Ne?.pending&&n===Ne?.revision){Z={...Pr(s.preferences||Z),autoImport:s.autoImport===!0};try{nn=wl(localStorage,Z)}catch{nn=!1}if(!bs){const c=kg(s.viewState);({sourceID:$n,projectID:kt,directory:Qe,days:en,fromDate:Rt,toDate:Dt,includeChildren:Ln,includeArchived:tn}=c),I("#children").checked=Ln,Jo=JSON.stringify(c),s.preferences||Fi({preferences:{...Z}})}Es()}if(bs=!0,I("#connection-label").textContent="Local library",I(".connection").classList.add("connected"),I(".connection").title=`Connected · ${le(q.sessions.length)} sessions`,!e&&q.onboarding&&!Ri&&Di(),!q.onboarding&&!hc&&(hc=!0,requestAnimationFrame(()=>{window.setTimeout(()=>{Xy()},0)})),r&&Z.grouping===bn&&JSON.stringify(r.sessions)===JSON.stringify(s.sessions)&&JSON.stringify(r.projects)===JSON.stringify(s.projects)){Hr();return}Vi.clear(),cs=new Map(q.sessions.map(c=>[c.id,c])),I("#source").innerHTML='<option value="">All sources</option>'+(q.sources||[]).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${c.sessions.toLocaleString()}</option>`).join(""),I("#source").value=$n,Hi.setData(q);const a=new Map;if(q.sessions.forEach(c=>a.set(c.projectID,(a.get(c.projectID)||0)+1)),I("#project").innerHTML='<option value="">All projects</option>'+[...q.projects].filter(c=>a.has(c.id)).sort((c,l)=>(a.get(l.id)||0)-(a.get(c.id)||0)).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${le(a.get(c.id)||0)}</option>`).join(""),I("#project").value=kt,Bi(),G&&!r){const c=q.sessions.find(u=>u.id===G),{min:l,max:f}=gl(Qo());c&&(c.created<l||c.created>f)&&(en=0,Rt="",Dt=""),c?.archived&&(tn=!0)}if(Ye(!i,i),G&&!r)Dn(G);else if(G){const c=cs.get(G);if(c&&JSON.stringify(o)!==JSON.stringify(c)){const l=I(".detail-scroll")?.scrollTop||0;Xe=void 0,Te=void 0,Cd(c,!1),I(".detail-scroll").scrollTop=l,vr(c.id),Gi(c)}}else Wi();!e&&q.warnings.length&&Ht(q.warnings.join(" "))}catch(n){const s=n instanceof Tt?n.message:"Could not load the library.";if(e&&q){I(".connection").title=s;return}I("#connection-label").textContent="Connection unavailable",I(".connection").title="Connection unavailable",I(".connection").classList.remove("connected"),I("#graph-message").hidden=!1;const r=n instanceof Tt&&n.code==="LIBRARY_VERSION";I("#graph-message").innerHTML=`${W("terminal")}<h3>Local library unavailable</h3><p role="alert">${X(s)}</p>${r?"":`<button class="primary-button" id="retry">Retry ${W("arrow-right")}</button>`}`,I("#retry")?.addEventListener("click",()=>{_i().then(Ss)}),q||(I("#session-list").innerHTML='<p class="empty-list">Your sessions will appear here once connected.</p>',I("#list-count").textContent="Offline"),We()}finally{t.disabled=!1,t.classList.remove("spinning")}}function Bi(){const e=q?.sessions.filter(s=>!kt||s.projectID===kt)||[],t=[...new Set(e.map(s=>s.directory))].sort((s,r)=>It(s).localeCompare(It(r))),n=new Set(q?.projects.flatMap(s=>s.worktrees));I("#directory").innerHTML='<option value="">All directories</option>'+t.map(s=>`<option value="${X(s)}">${n.has(s)?"⑂ ":""}${X(It(s))}</option>`).join(""),t.includes(Qe)||(Qe=""),I("#directory").value=Qe}let bn;function Ye(e=!1,t=!1){if(!q)return;bn!==Z.grouping&&(e=!0,t=!1),bn=Z.grouping,t||(ge(),ce=1);const n=document.activeElement?.closest("[data-session]")?.dataset.session,{min:s,max:r}=gl(Qo());he=q.sessions.filter(a=>Tg(a,$n)&&(!kt||a.projectID===kt)&&(!Qe||a.directory===Qe)&&(Ln||!a.parentID||!!a.forkID)&&(tn||!a.archived)&&a.created>=s&&a.created<=r),Oi=[...he].sort((a,c)=>Zt(c)-Zt(a)),ud=new Set(he.map(a=>a.id)),Hi.setScope(he.map(a=>a.id)),se=mc(he,q.projects,t?se:void 0,bn),fd=new Map(se.nodes.map(a=>[a.session.id,a.color])),Q?.setCutoff(ce),Q?.setGraph(se,e,t),Hr(),document.querySelectorAll("[data-days]").forEach(a=>{const c=!Rt&&!Dt&&a.dataset.days===String(en);a.classList.toggle("active",c),a.setAttribute("aria-pressed",String(c))}),Qy(t),t&&n&&In.getElement(vs.get(n))?.focus({preventScroll:!0}),ev(),G&&!he.some(a=>a.id===G)?qi():G&&Xe&&Q?.setFiles(Xe.files),G&&Te&&Q?.setEvents(Te.items),We();const o=Qo(),i=JSON.stringify(o);bs&&i!==Jo&&(Jo=i,Fi({viewState:o}))}function Hr(){Ui();const e=I("#graph-message");e.hidden=!!(he.length&&Q),he.length?Q||(e.innerHTML=hd?"<h3>Preparing the map…</h3>":`${W("box")}<h3>WebGL is unavailable.</h3><p>You can explore every session and its file details in the list.</p>`):e.innerHTML=q?.importing?'<div class="loading-orbit"><span></span><span></span><span></span></div><h3>Importing your sessions…</h3><p>Your map will appear when the import finishes.</p>':q&&!q.sessions.length?`${W("folder")}<p>Choose a source with saved conversations to get started.</p><button class="primary-button" id="empty-sources">Choose sources ${W("arrow-right")}</button>`:`${W("search")}<h3>No matching sessions</h3><button class="text-button" id="clear-filters">Reset filters ${W("rotate-ccw")}</button>`,I("#clear-filters")?.addEventListener("click",()=>vd()),I("#empty-sources")?.addEventListener("click",()=>{q?.onboarding?Di():Et.open()}),We()}function Ui(e=!1){const t=!!(he.length&&Q);(e||!t)&&(window.clearTimeout(Kn),Kn=0,Zn=!1),I(".playback-share").classList.toggle("ready",Zn&&t),I("#share-playback").disabled=!Zn||!t,t&&!Zn&&!Kn&&(Kn=window.setTimeout(()=>{Kn=0,Zn=!0,Ui()},1e3))}function vd(e){$n="",I("#source").value="",kt="",Qe="",en=e?0:vi.days,Rt="",Dt="",Ln=!0,tn=e?.archived===!0,I("#project").value="",I("#children").checked=!0,md.setRange("",""),Bi(),Ye(!0)}function Qy(e=!1){I("#list-count").textContent=le(he.length);const t=[];vs=new Map;let n="";for(const s of Oi){const r=Zt(s),o=ys(r,!0);o!==n&&t.push({label:ys(r),year:new Date(r).getFullYear()}),n=o,vs.set(s.id,t.length),t.push({session:s})}In.setItems(t,e),I("#session-list").querySelector(".empty-list")?.remove(),t.length||I("#session-list").insertAdjacentHTML("beforeend",'<p class="empty-list">No sessions match your filters.</p>')}function bd(e){for(const t of[e,G]){const n=t?In.getElement(vs.get(t)):void 0;n&&(n.classList.toggle("selected",t===G),n.setAttribute("aria-pressed",String(t===G)))}}function ev(){at=ml(he),pd=vl(he),zo="";const e=Lg(he.map(Zt),se.start,se.end),t=Math.max(...e,1);I("#histogram").innerHTML=e.map(n=>`<span style="height:${Math.max(4,n/t*100)}%;opacity:${n?.8:.15}" title="${n} session endpoints"></span>`).join(""),I("#date-label").textContent=se.start?`${ys(se.start,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear())} — ${ys(se.end,!0)}`:"No sessions",se.start&&md.setRange(Rt||uc(se.start),Dt||uc(se.end)),Rn()}function Rn(e=!1){I("#scrubber").value=String(Math.round(ce*1e3)),I("#timeline-cursor").style.left=`${ce*100}%`,I("#histogram").style.setProperty("--progress",`${ce*100}%`);const t=se.start+(se.end-se.start)*ce;I("#playback-date").textContent=se.start?ys(t,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear()):"—";const n=se.nodes.length?$g(t,se.end-se.start):"—";I("#playback-period").textContent!==n&&(I("#playback-period").textContent=n);const s=at.at(t,ce>=1),r=pd(t,ce>=1),o=`${s.tokens}:${s.sessions}:${r}`;o!==zo&&(zo=o,I("#playback-summary").hidden=he.length===0,I("#playback-sessions").textContent=le(r),I("#playback-tokens").textContent=at.recorded?dd(s.tokens):"—",I("#playback-summary").title=`${le(r)} sessions started. ${at.recorded?`${le(s.tokens)} burnt tokens`:"Token usage unavailable"}. Token totals are added at the latest saved message, including cache where reported. ${le(at.missing)} sessions have no recorded total.${at.partial?` ${le(at.partial)} recorded totals are partial.`:""}${at.untimed?` ${le(at.untimed)} totals have no message timestamp and are included only at the end.`:""}`),Q?.setCutoff(ce,e)}function ge(){if(Vt=!1,ls=0,I("#app").classList.remove("playback-mode"),er){const e=er;er=void 0,pe("explorer",e.explorer),pe("inspector",e.inspector&&!!G)}Q?.setPlaying(!1),cancelAnimationFrame(Pi),I("#play").innerHTML=W("play"),I("#play").setAttribute("aria-label","Play timeline"),We()}function wd(e){if(!Vt)return;const t=Math.max(0,e-mr);mr=e,document.hidden||(ce<1?ce=Math.min(1,ce+t*Z.playbackSpeed/bi):ls+=t),Rn(),Q?.setPlaybackOutro(ce>=1?Math.min(1,ls/ps):null),ce>=1&&ls>=ps+yl?ge():Pi=requestAnimationFrame(wd)}function qi(){const e=G;Ko?.abort(),Zo?.abort(),I("#file-legend").hidden=!0,Qs++,Xs++,G=null,Xe=void 0,Te=void 0,Q?.select(null),history.replaceState(null,"",location.pathname),Wi(),bd(e)}const ds=3;function tv(e,t,n){const s=t.forkID?[{id:t.forkID,label:"Forked from",kind:"git-fork"}]:t.parentID?[{id:t.parentID,label:"Parent",kind:"network"}]:[],r=q.sessions.filter(c=>c.forkID===t.id||!c.forkID&&c.parentID===t.id),o=[...s,...r.map(c=>({id:c.id,label:c.forkID?"Fork":"Child",kind:c.forkID?"git-fork":"network"}))];if(!o.length){e.hidden=!0;return}const i=c=>(c?o:o.slice(0,ds)).map(l=>{const f=cs.get(l.id);return`<button class="relation" data-related="${X(l.id)}" ${f?"":"disabled"}>${W(l.kind)}<span><small>${l.label}</small><strong>${X(f?.title||"Session no longer available")}</strong></span>${W("arrow-up-right")}</button>`}).join(""),a=c=>c?"Show fewer connections":`Show all ${le(o.length)} connections`;e.innerHTML=`<div class="section-label">Connections<span>${le(o.length)}</span></div><div id="connection-list">${i(n)}</div>
166
166
  ${o.length>ds?`<button class="load-more" id="toggle-connections" type="button" aria-controls="connection-list" aria-expanded="${n}">${a(n)}</button>`:""}`,e.querySelector("#toggle-connections")?.addEventListener("click",c=>{const l=c.currentTarget,f=l.getAttribute("aria-expanded")!=="true";e.querySelector("#connection-list").innerHTML=i(f),l.setAttribute("aria-expanded",String(f)),l.textContent=a(f),f||l.scrollIntoView({block:"nearest"}),We()})}function Cd(e,t=!0){const n=q.projects.find(c=>c.id===e.projectID),s=e.forkID?"Fork":e.parentID?"Child session":"Session",r=n?.worktrees.includes(e.directory),o=t?!0:I("#session-inspector").querySelector(".session-info")?.open??!0,i=!t&&I("#toggle-connections")?.getAttribute("aria-expanded")==="true",a=[["folder","Project",n?.name||"Unknown"],["cpu","Model",e.model],["bot","Agent",e.agent||"Unknown"],["coins",e.usage?.partial?"Recorded tokens (partial)":"Recorded tokens",e.tokens===null?"Not recorded":dd(e.tokens)],["dollar-sign",e.usage?.costEstimated?"Cost (harness estimate)":"Recorded cost",e.cost===null?"Not recorded":`$${e.cost.toFixed(2)}`]];I("#session-inspector").innerHTML=`
167
167
  <div class="panel-heading"><span class="panel-title">${s}</span><button id="close-inspector" class="icon-button" aria-label="Close session details">${W("x")}</button></div>
168
168
  <div class="detail-scroll">
@@ -183,4 +183,4 @@ ${v.output}`:""].filter(Boolean).join(`
183
183
  ${e.partial||!e.snapshotSteps||s.length>80?`<details class="file-coverage"><summary>File coverage</summary><p class="coverage-note">${[e.partial?"Some changes may be missing.":"",e.snapshotSteps?"":"Snapshots unavailable.",s.length>80?"80 files shown on the map.":""].filter(Boolean).join(" ")}</p></details>`:""}
184
184
  ${e.nextCursor?'<p class="coverage-note" id="history-loading" role="status">Loading full history…</p>':""}</section>
185
185
  ${e.locations.length?`<details class="more-details detail-section"><summary>Directory moves ${W("chevron-down")}</summary>${e.locations.map(l=>`<div class="location-entry"><span>${gr(l.time)}</span><code>${X(l.directory)}</code></div>`).join("")}</details>`:""}
186
- `,o.innerHTML=e.tools.length?`<details class="more-details detail-section"${i?" open":""}><summary>Tools used <span>${le(e.tools.reduce((l,f)=>l+f.count,0))}</span>${W("chevron-down")}</summary><div class="tools-list">${e.tools.slice(0,12).map(l=>`<div><span>${X(l.name)}</span><strong>${l.count}</strong></div>`).join("")}</div></details>`:"",r.querySelector("#toggle-files")?.addEventListener("click",l=>{const f=l.currentTarget,u=f.getAttribute("aria-expanded")!=="true";I("#changed-file-list").innerHTML=c(u?s:s.slice(0,ds)),f.setAttribute("aria-expanded",String(u)),f.textContent=u?"Show fewer files":`Show all ${le(s.length)} files`,u||f.scrollIntoView({block:"nearest"}),We()}),Q?.setFiles(s),We()}async function vr(e){const t=++Qs;Ko?.abort();const n=new AbortController;Ko=n;let s,r;const o=new Set;try{do{const i=await ji(`/api/sessiongraph/session/${encodeURIComponent(e)}${s?`?cursor=${encodeURIComponent(s)}`:""}`,n.signal);if(n.signal.aborted||t!==Qs||G!==e)return;if(r&&i.revision!==r.revision)throw new Error("History changed. Retry to load the latest version.");if(r=r?nv(r,i):i,Xe=r,!s||!i.nextCursor?pc(r):I("#history-loading")&&(I("#history-loading").textContent=`Loading full history… ${le(r.messagesScanned)} messages`),s=i.nextCursor||void 0,s&&o.has(s))throw new Error("History could not be loaded. Please retry.");s&&o.add(s)}while(s)}catch(i){if(n.signal.aborted||t!==Qs||G!==e)return;if(Xe){pc(Xe);const a=I("#history-loading");a&&(a.innerHTML='History loading interrupted. <button class="text-button" id="retry-detail">Retry</button>'),I("#retry-detail")?.addEventListener("click",()=>{vr(e)})}else I("#file-detail").innerHTML=`<section class="detail-section"><div class="section-label">Changed files</div><p class="coverage-note">${X(i instanceof Error?i.message:"Details unavailable.")}</p><button class="load-more" id="retry-detail">Retry file details</button></section>`,I("#retry-detail").addEventListener("click",()=>vr(e))}}function Dn(e){const t=cs.get(e);if(!t)return;const n=G;On.close(),et.clear(),ud.has(e)||vd(t),ge(),ce=1,Rn(),G=e,Xe=void 0,Te=void 0,I("#file-legend").hidden=!0,history.replaceState(null,"",`?session=${encodeURIComponent(e)}`),Q?.select(e),Cd(t),Q?.focus(e),bd(n),vr(e),Gi(t,!0)}I("#session-list").addEventListener("click",e=>{const t=e.target.closest("[data-session]");t?.dataset.session&&Dn(t.dataset.session)});I("#inspector").addEventListener("click",e=>{const t=e.target.closest("[data-history]")?.dataset.history;if(t){et.clear(),ge(),pe("inspector",!0),On.open({id:t,source:t.split(":")[0]});return}const n=e.target.closest("[data-related]");n?.dataset.related&&Dn(n.dataset.related)});I("#project").addEventListener("change",e=>{kt=e.target.value,Qe="",Bi(),Ye(!0)});I("#source").addEventListener("change",e=>{$n=e.target.value,Ye(!0)});I("#directory").addEventListener("change",e=>{Qe=e.target.value,Ye(!0)});I("#children").addEventListener("change",e=>{Ln=e.target.checked,Ye()});document.querySelectorAll("[data-days]").forEach(e=>e.addEventListener("click",()=>{en=e.dataset.days==="ytd"?"ytd":Number(e.dataset.days),Rt="",Dt="",Ye(!0)}));I("#reset-camera").addEventListener("click",()=>{ge(),Q?.reset()});I("#refresh").addEventListener("click",()=>{q?.onboarding?Di():Et.refresh()});I("#scrubber").addEventListener("input",e=>{ge(),ce=Number(e.target.value)/1e3,Rn(!0)});I("#play").addEventListener("click",()=>{if(he.length){if(Vt)return ge();ce>=1&&(ce=0),Rn(),er={explorer:!I("#explorer").hidden,inspector:!I("#inspector").hidden},pe("explorer",!1),pe("inspector",!1),pe("timeline",!0),et.clear(),ss=void 0,I("#app").classList.add("playback-mode"),Ui(!0),Vt=!0,ls=0,Q?.setPlaying(!0),mr=performance.now(),I("#play").innerHTML=W("pause"),I("#play").setAttribute("aria-label","Pause timeline"),We(),Pi=requestAnimationFrame(wd)}});document.addEventListener("visibilitychange",()=>{mr=performance.now()},{signal:Fr.signal});async function sv(){const e=I("#share-playback");e.disabled=!0;try{if(!vo){const{createPlaybackShare:t}=await br(async()=>{const{createPlaybackShare:n}=await import("./share-BWJVjZdG.js");return{createPlaybackShare:n}},__vite__mapDeps([4,1,2]));vo=t(xt,()=>{Wr()})}se.nodes.length&&vo.open(se,Z)}catch{Ht("Could not open video sharing. Please try again.")}finally{e.disabled=!he.length||!Q}}async function Wr(){try{fc??=_y(xt,()=>{sv()},qy),await fc.open(he.map(e=>e.id))}catch{Ht("Could not open publishing. Please try again.")}}I("#share-playback").addEventListener("click",Wr);I("#open-publishing").addEventListener("click",Wr);I("#help").addEventListener("click",()=>{I("#help-dialog").showModal(),xt()});I("#help-dialog").addEventListener("close",xt);I("#help-dialog [data-close-help]").addEventListener("click",()=>I("#help-dialog").close());document.addEventListener("keydown",e=>{if(!e.defaultPrevented&&!document.querySelector("dialog[open]")){if(Vt&&e.key==="Escape"){e.preventDefault(),ge();return}if(!On.handleKey(e)){if(e.key==="Escape"){G?qi():pe("explorer",!1);return}if(!(e.target.matches("input, select, textarea")||e.metaKey||e.ctrlKey||e.altKey)){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&!e.target.closest('[contenteditable="true"]')){const t=e.target;if(t.matches("canvas, body, .session-card")||t.closest(".session-card")){const n=Oi,s=n.findIndex(i=>i.id===G),r=e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:1,o=n[Math.max(0,Math.min(n.length-1,s+r))];if(o&&(e.preventDefault(),Dn(o.id),t.closest(".session-card"))){const i=vs.get(o.id);In.scrollToIndex(i),In.getElement(i)?.focus({preventScroll:!0})}return}}if(e.key.toLowerCase()==="f"&&(ge(),Q?.reset()),e.key.toLowerCase()==="h"){ge();const t=["explorer","timeline","inspector"].filter(n=>!I(`#${n}`).hidden);t.length?(bo=t,t.forEach(n=>pe(n,!1))):(bo.length?bo:["explorer","timeline"]).forEach(n=>{(n!=="inspector"||G)&&pe(n,!0)})}}}}});_i().then(()=>{q?.importing?Et.resume():Ss()});export{ku as A,hg as B,fv as C,Or as D,gl as E,lc as F,pv as G,ps as H,Og as I,yl as J,Co as K,Nn as L,uv as M,rv as N,Mg as O,bi as P,xu as Q,hv as R,av as S,ov as T,dv as U,Pu as V,iv as W,br as _,wo as a,ml as b,vl as c,Zt as d,cv as e,wi as f,lv as g,$g as h,is as i,ki as j,gv as k,it as l,ut as m,W as n,Sl as o,Ay as p,Ig as q,Cu as r,jy as s,Lg as t,Eu as u,Hy as v,Au as w,Fe as x,wu as y,Eg as z};
186
+ `,o.innerHTML=e.tools.length?`<details class="more-details detail-section"${i?" open":""}><summary>Tools used <span>${le(e.tools.reduce((l,f)=>l+f.count,0))}</span>${W("chevron-down")}</summary><div class="tools-list">${e.tools.slice(0,12).map(l=>`<div><span>${X(l.name)}</span><strong>${l.count}</strong></div>`).join("")}</div></details>`:"",r.querySelector("#toggle-files")?.addEventListener("click",l=>{const f=l.currentTarget,u=f.getAttribute("aria-expanded")!=="true";I("#changed-file-list").innerHTML=c(u?s:s.slice(0,ds)),f.setAttribute("aria-expanded",String(u)),f.textContent=u?"Show fewer files":`Show all ${le(s.length)} files`,u||f.scrollIntoView({block:"nearest"}),We()}),Q?.setFiles(s),We()}async function vr(e){const t=++Qs;Ko?.abort();const n=new AbortController;Ko=n;let s,r;const o=new Set;try{do{const i=await ji(`/api/sessiongraph/session/${encodeURIComponent(e)}${s?`?cursor=${encodeURIComponent(s)}`:""}`,n.signal);if(n.signal.aborted||t!==Qs||G!==e)return;if(r&&i.revision!==r.revision)throw new Error("History changed. Retry to load the latest version.");if(r=r?nv(r,i):i,Xe=r,!s||!i.nextCursor?pc(r):I("#history-loading")&&(I("#history-loading").textContent=`Loading full history… ${le(r.messagesScanned)} messages`),s=i.nextCursor||void 0,s&&o.has(s))throw new Error("History could not be loaded. Please retry.");s&&o.add(s)}while(s)}catch(i){if(n.signal.aborted||t!==Qs||G!==e)return;if(Xe){pc(Xe);const a=I("#history-loading");a&&(a.innerHTML='History loading interrupted. <button class="text-button" id="retry-detail">Retry</button>'),I("#retry-detail")?.addEventListener("click",()=>{vr(e)})}else I("#file-detail").innerHTML=`<section class="detail-section"><div class="section-label">Changed files</div><p class="coverage-note">${X(i instanceof Error?i.message:"Details unavailable.")}</p><button class="load-more" id="retry-detail">Retry file details</button></section>`,I("#retry-detail").addEventListener("click",()=>vr(e))}}function Dn(e){const t=cs.get(e);if(!t)return;const n=G;On.close(),et.clear(),ud.has(e)||vd(t),ge(),ce=1,Rn(),G=e,Xe=void 0,Te=void 0,I("#file-legend").hidden=!0,history.replaceState(null,"",`?session=${encodeURIComponent(e)}`),Q?.select(e),Cd(t),Q?.focus(e),bd(n),vr(e),Gi(t,!0)}I("#session-list").addEventListener("click",e=>{const t=e.target.closest("[data-session]");t?.dataset.session&&Dn(t.dataset.session)});I("#inspector").addEventListener("click",e=>{const t=e.target.closest("[data-history]")?.dataset.history;if(t){et.clear(),ge(),pe("inspector",!0),On.open({id:t,source:t.split(":")[0]});return}const n=e.target.closest("[data-related]");n?.dataset.related&&Dn(n.dataset.related)});I("#project").addEventListener("change",e=>{kt=e.target.value,Qe="",Bi(),Ye(!0)});I("#source").addEventListener("change",e=>{$n=e.target.value,Ye(!0)});I("#directory").addEventListener("change",e=>{Qe=e.target.value,Ye(!0)});I("#children").addEventListener("change",e=>{Ln=e.target.checked,Ye()});document.querySelectorAll("[data-days]").forEach(e=>e.addEventListener("click",()=>{en=e.dataset.days==="ytd"?"ytd":Number(e.dataset.days),Rt="",Dt="",Ye(!0)}));I("#reset-camera").addEventListener("click",()=>{ge(),Q?.reset()});I("#refresh").addEventListener("click",()=>{q?.onboarding?Di():Et.refresh()});I("#scrubber").addEventListener("input",e=>{ge(),ce=Number(e.target.value)/1e3,Rn(!0)});I("#play").addEventListener("click",()=>{if(he.length){if(Vt)return ge();ce>=1&&(ce=0),Rn(),er={explorer:!I("#explorer").hidden,inspector:!I("#inspector").hidden},pe("explorer",!1),pe("inspector",!1),pe("timeline",!0),et.clear(),ss=void 0,I("#app").classList.add("playback-mode"),Ui(!0),Vt=!0,ls=0,Q?.setPlaying(!0),mr=performance.now(),I("#play").innerHTML=W("pause"),I("#play").setAttribute("aria-label","Pause timeline"),We(),Pi=requestAnimationFrame(wd)}});document.addEventListener("visibilitychange",()=>{mr=performance.now()},{signal:Fr.signal});async function sv(){const e=I("#share-playback");e.disabled=!0;try{if(!vo){const{createPlaybackShare:t}=await br(async()=>{const{createPlaybackShare:n}=await import("./share-DnZuWOzh.js");return{createPlaybackShare:n}},__vite__mapDeps([4,1,2]));vo=t(xt,()=>{Wr()})}se.nodes.length&&vo.open(se,Z)}catch{Ht("Could not open video sharing. Please try again.")}finally{e.disabled=!he.length||!Q}}async function Wr(){try{fc??=_y(xt,()=>{sv()},qy),await fc.open(he.map(e=>e.id))}catch{Ht("Could not open publishing. Please try again.")}}I("#share-playback").addEventListener("click",Wr);I("#open-publishing").addEventListener("click",Wr);I("#help").addEventListener("click",()=>{I("#help-dialog").showModal(),xt()});I("#help-dialog").addEventListener("close",xt);I("#help-dialog [data-close-help]").addEventListener("click",()=>I("#help-dialog").close());document.addEventListener("keydown",e=>{if(!e.defaultPrevented&&!document.querySelector("dialog[open]")){if(Vt&&e.key==="Escape"){e.preventDefault(),ge();return}if(!On.handleKey(e)){if(e.key==="Escape"){G?qi():pe("explorer",!1);return}if(!(e.target.matches("input, select, textarea")||e.metaKey||e.ctrlKey||e.altKey)){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&!e.target.closest('[contenteditable="true"]')){const t=e.target;if(t.matches("canvas, body, .session-card")||t.closest(".session-card")){const n=Oi,s=n.findIndex(i=>i.id===G),r=e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:1,o=n[Math.max(0,Math.min(n.length-1,s+r))];if(o&&(e.preventDefault(),Dn(o.id),t.closest(".session-card"))){const i=vs.get(o.id);In.scrollToIndex(i),In.getElement(i)?.focus({preventScroll:!0})}return}}if(e.key.toLowerCase()==="f"&&(ge(),Q?.reset()),e.key.toLowerCase()==="h"){ge();const t=["explorer","timeline","inspector"].filter(n=>!I(`#${n}`).hidden);t.length?(bo=t,t.forEach(n=>pe(n,!1))):(bo.length?bo:["explorer","timeline"]).forEach(n=>{(n!=="inspector"||G)&&pe(n,!0)})}}}}});_i().then(()=>{q?.importing?Et.resume():Ss()});export{ku as A,hg as B,fv as C,Or as D,gl as E,lc as F,pv as G,ps as H,Og as I,yl as J,Co as K,Nn as L,uv as M,rv as N,Mg as O,bi as P,xu as Q,hv as R,av as S,ov as T,dv as U,Pu as V,iv as W,br as _,wo as a,ml as b,vl as c,Zt as d,cv as e,wi as f,lv as g,$g as h,is as i,ki as j,gv as k,it as l,ut as m,W as n,Sl as o,Ay as p,Ig as q,Cu as r,jy as s,Lg as t,Eu as u,Hy as v,Au as w,Fe as x,wu as y,Eg as z};
@@ -1 +1 @@
1
- import{j as a,R as i,C as o}from"./index-Dm6VCxBu.js";class l extends i{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,n){const d=new o;e&&(d.onmessage=e);const r=await a("plugin:updater|download",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)});await this.downloadedBytes?.close().catch(()=>{}),this.downloadedBytes=new i(r)}async install(e){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await a("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid,...e}),this.downloadedBytes=void 0}async downloadAndInstall(e,n){const d=new o;e&&(d.onmessage=e),await a("plugin:updater|download_and_install",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)})}async close(){await this.downloadedBytes?.close(),await super.close()}}async function w(s){const e=await a("plugin:updater|check",{...s,headers:t(s?.headers)});return e?new l(e):null}function t(s){return s?Array.from(new Headers(s).entries()):void 0}export{l as Update,w as check};
1
+ import{j as a,R as i,C as o}from"./index-DCSeQKMi.js";class l extends i{constructor(e){super(e.rid),this.available=!0,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body,this.rawJson=e.rawJson}async download(e,n){const d=new o;e&&(d.onmessage=e);const r=await a("plugin:updater|download",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)});await this.downloadedBytes?.close().catch(()=>{}),this.downloadedBytes=new i(r)}async install(e){if(!this.downloadedBytes)throw new Error("Update.install called before Update.download");await a("plugin:updater|install",{updateRid:this.rid,bytesRid:this.downloadedBytes.rid,...e}),this.downloadedBytes=void 0}async downloadAndInstall(e,n){const d=new o;e&&(d.onmessage=e),await a("plugin:updater|download_and_install",{onEvent:d,rid:this.rid,...n,headers:t(n?.headers)})}async close(){await this.downloadedBytes?.close(),await super.close()}}async function w(s){const e=await a("plugin:updater|check",{...s,headers:t(s?.headers)});return e?new l(e):null}function t(s){return s?Array.from(new Headers(s).entries()):void 0}export{l as Update,w as check};
@@ -1 +1 @@
1
- import{R as a,j as i,C as R}from"./index-Dm6VCxBu.js";var w;(function(n){n[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Document=6]="Document",n[n.Download=7]="Download",n[n.Picture=8]="Picture",n[n.Public=9]="Public",n[n.Video=10]="Video",n[n.Resource=11]="Resource",n[n.Temp=12]="Temp",n[n.AppConfig=13]="AppConfig",n[n.AppData=14]="AppData",n[n.AppLocalData=15]="AppLocalData",n[n.AppCache=16]="AppCache",n[n.AppLog=17]="AppLog",n[n.Desktop=18]="Desktop",n[n.Executable=19]="Executable",n[n.Font=20]="Font",n[n.Home=21]="Home",n[n.Runtime=22]="Runtime",n[n.Template=23]="Template"})(w||(w={}));var d;(function(n){n[n.Start=0]="Start",n[n.Current=1]="Current",n[n.End=2]="End"})(d||(d={}));function u(n){return{isFile:n.isFile,isDirectory:n.isDirectory,isSymlink:n.isSymlink,size:n.size,mtime:n.mtime!==null?new Date(n.mtime):null,atime:n.atime!==null?new Date(n.atime):null,birthtime:n.birthtime!==null?new Date(n.birthtime):null,readonly:n.readonly,fileAttributes:n.fileAttributes,dev:n.dev,ino:n.ino,mode:n.mode,nlink:n.nlink,uid:n.uid,gid:n.gid,rdev:n.rdev,blksize:n.blksize,blocks:n.blocks}}function U(n){const e=new Uint8ClampedArray(n),t=e.byteLength;let o=0;for(let r=0;r<t;r++){const s=e[r];o*=256,o+=s}return o}class g extends a{async read(e){if(e.byteLength===0)return 0;const t=await i("plugin:fs|read",{rid:this.rid,len:e.byteLength}),o=U(t.slice(-8)),r=t instanceof ArrayBuffer?new Uint8Array(t):t;return e.set(r.slice(0,r.length-8)),o===0?null:o}async seek(e,t){return await i("plugin:fs|seek",{rid:this.rid,offset:e,whence:t})}async stat(){const e=await i("plugin:fs|fstat",{rid:this.rid});return u(e)}async truncate(e){await i("plugin:fs|ftruncate",{rid:this.rid,len:e})}async write(e){return await i("plugin:fs|write",{rid:this.rid,data:e})}}async function b(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|create",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function p(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|open",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function S(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|copy_file",{fromPath:n instanceof URL?n.toString():n,toPath:e instanceof URL?e.toString():e,options:t})}async function A(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|mkdir",{path:n instanceof URL?n.toString():n,options:e})}async function T(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|read_dir",{path:n instanceof URL?n.toString():n,options:e})}async function E(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_file",{path:n instanceof URL?n.toString():n,options:e});return t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}async function _(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_text_file",{path:n instanceof URL?n.toString():n,options:e}),o=t instanceof ArrayBuffer?t:Uint8Array.from(t);return new TextDecoder(e?.encoding??"utf-8").decode(o)}async function x(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=n instanceof URL?n.toString():n;return await Promise.resolve({path:t,rid:null,async next(){const o=new TextDecoder(e?.encoding??"utf-8");if(this.rid===null){const l=o.encoding;this.rid=await i("plugin:fs|read_text_file_lines",{path:t,options:e!=null?{...e,encoding:l}:void 0})}let r;try{r=await i("plugin:fs|read_text_file_lines_next",{rid:this.rid})}catch(l){throw this.rid=null,l}const s=r instanceof ArrayBuffer?new Uint8Array(r):Uint8Array.from(r),f=s[s.byteLength-1]===1;return f?(this.rid=null,{value:null,done:f}):{value:o.decode(s.slice(0,s.byteLength-1)),done:f}},async return(){if(this.rid!==null){const o=this.rid;this.rid=null,await new a(o).close()}return{value:null,done:!0}},[Symbol.asyncIterator](){return this}})}async function v(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|remove",{path:n instanceof URL?n.toString():n,options:e})}async function M(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|rename",{oldPath:n instanceof URL?n.toString():n,newPath:e instanceof URL?e.toString():e,options:t})}async function C(n,e){const t=await i("plugin:fs|stat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function k(n,e){const t=await i("plugin:fs|lstat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function F(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|truncate",{path:n instanceof URL?n.toString():n,len:e,options:t})}async function z(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");if(e instanceof ReadableStream){const o=await p(n,{read:!1,create:!0,write:!0,...t,truncate:!t?.append}),r=e.getReader();try{for(;;){const{done:s,value:f}=await r.read();if(s)break;await o.write(f)}}finally{r.releaseLock(),await o.close()}}else await i("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function I(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const o=new TextEncoder;await i("plugin:fs|write_text_file",o.encode(e),{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function H(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|exists",{path:n instanceof URL?n.toString():n,options:e})}class y extends a{}async function L(n,e,t){const o=Array.isArray(n)?n:[n];for(const c of o)if(c instanceof URL&&c.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=new R;r.onmessage=e;const s=await i("plugin:fs|watch",{paths:o.map(c=>c instanceof URL?c.toString():c),options:t,onEvent:r}),f=new y(s);return()=>{f.close()}}async function J(n,e,t){return await L(n,e,{delayMs:2e3,...t})}async function N(n,e,t){return await L(n,e,{...t,delayMs:void 0})}async function O(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|size",{path:n instanceof URL?n.toString():n,options:e})}async function V(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|start_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}async function h(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|stop_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}export{w as BaseDirectory,g as FileHandle,d as SeekMode,S as copyFile,b as create,H as exists,k as lstat,A as mkdir,p as open,T as readDir,E as readFile,_ as readTextFile,x as readTextFileLines,v as remove,M as rename,O as size,V as startAccessingSecurityScopedResource,C as stat,h as stopAccessingSecurityScopedResource,F as truncate,J as watch,N as watchImmediate,z as writeFile,I as writeTextFile};
1
+ import{R as a,j as i,C as R}from"./index-DCSeQKMi.js";var w;(function(n){n[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Document=6]="Document",n[n.Download=7]="Download",n[n.Picture=8]="Picture",n[n.Public=9]="Public",n[n.Video=10]="Video",n[n.Resource=11]="Resource",n[n.Temp=12]="Temp",n[n.AppConfig=13]="AppConfig",n[n.AppData=14]="AppData",n[n.AppLocalData=15]="AppLocalData",n[n.AppCache=16]="AppCache",n[n.AppLog=17]="AppLog",n[n.Desktop=18]="Desktop",n[n.Executable=19]="Executable",n[n.Font=20]="Font",n[n.Home=21]="Home",n[n.Runtime=22]="Runtime",n[n.Template=23]="Template"})(w||(w={}));var d;(function(n){n[n.Start=0]="Start",n[n.Current=1]="Current",n[n.End=2]="End"})(d||(d={}));function u(n){return{isFile:n.isFile,isDirectory:n.isDirectory,isSymlink:n.isSymlink,size:n.size,mtime:n.mtime!==null?new Date(n.mtime):null,atime:n.atime!==null?new Date(n.atime):null,birthtime:n.birthtime!==null?new Date(n.birthtime):null,readonly:n.readonly,fileAttributes:n.fileAttributes,dev:n.dev,ino:n.ino,mode:n.mode,nlink:n.nlink,uid:n.uid,gid:n.gid,rdev:n.rdev,blksize:n.blksize,blocks:n.blocks}}function U(n){const e=new Uint8ClampedArray(n),t=e.byteLength;let o=0;for(let r=0;r<t;r++){const s=e[r];o*=256,o+=s}return o}class g extends a{async read(e){if(e.byteLength===0)return 0;const t=await i("plugin:fs|read",{rid:this.rid,len:e.byteLength}),o=U(t.slice(-8)),r=t instanceof ArrayBuffer?new Uint8Array(t):t;return e.set(r.slice(0,r.length-8)),o===0?null:o}async seek(e,t){return await i("plugin:fs|seek",{rid:this.rid,offset:e,whence:t})}async stat(){const e=await i("plugin:fs|fstat",{rid:this.rid});return u(e)}async truncate(e){await i("plugin:fs|ftruncate",{rid:this.rid,len:e})}async write(e){return await i("plugin:fs|write",{rid:this.rid,data:e})}}async function b(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|create",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function p(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|open",{path:n instanceof URL?n.toString():n,options:e});return new g(t)}async function S(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|copy_file",{fromPath:n instanceof URL?n.toString():n,toPath:e instanceof URL?e.toString():e,options:t})}async function A(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|mkdir",{path:n instanceof URL?n.toString():n,options:e})}async function T(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|read_dir",{path:n instanceof URL?n.toString():n,options:e})}async function E(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_file",{path:n instanceof URL?n.toString():n,options:e});return t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}async function _(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=await i("plugin:fs|read_text_file",{path:n instanceof URL?n.toString():n,options:e}),o=t instanceof ArrayBuffer?t:Uint8Array.from(t);return new TextDecoder(e?.encoding??"utf-8").decode(o)}async function x(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const t=n instanceof URL?n.toString():n;return await Promise.resolve({path:t,rid:null,async next(){const o=new TextDecoder(e?.encoding??"utf-8");if(this.rid===null){const l=o.encoding;this.rid=await i("plugin:fs|read_text_file_lines",{path:t,options:e!=null?{...e,encoding:l}:void 0})}let r;try{r=await i("plugin:fs|read_text_file_lines_next",{rid:this.rid})}catch(l){throw this.rid=null,l}const s=r instanceof ArrayBuffer?new Uint8Array(r):Uint8Array.from(r),f=s[s.byteLength-1]===1;return f?(this.rid=null,{value:null,done:f}):{value:o.decode(s.slice(0,s.byteLength-1)),done:f}},async return(){if(this.rid!==null){const o=this.rid;this.rid=null,await new a(o).close()}return{value:null,done:!0}},[Symbol.asyncIterator](){return this}})}async function v(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|remove",{path:n instanceof URL?n.toString():n,options:e})}async function M(n,e,t){if(n instanceof URL&&n.protocol!=="file:"||e instanceof URL&&e.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|rename",{oldPath:n instanceof URL?n.toString():n,newPath:e instanceof URL?e.toString():e,options:t})}async function C(n,e){const t=await i("plugin:fs|stat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function k(n,e){const t=await i("plugin:fs|lstat",{path:n instanceof URL?n.toString():n,options:e});return u(t)}async function F(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|truncate",{path:n instanceof URL?n.toString():n,len:e,options:t})}async function z(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");if(e instanceof ReadableStream){const o=await p(n,{read:!1,create:!0,write:!0,...t,truncate:!t?.append}),r=e.getReader();try{for(;;){const{done:s,value:f}=await r.read();if(s)break;await o.write(f)}}finally{r.releaseLock(),await o.close()}}else await i("plugin:fs|write_file",e,{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function I(n,e,t){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");const o=new TextEncoder;await i("plugin:fs|write_text_file",o.encode(e),{headers:{path:encodeURIComponent(n instanceof URL?n.toString():n),options:JSON.stringify(t)}})}async function H(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|exists",{path:n instanceof URL?n.toString():n,options:e})}class y extends a{}async function L(n,e,t){const o=Array.isArray(n)?n:[n];for(const c of o)if(c instanceof URL&&c.protocol!=="file:")throw new TypeError("Must be a file URL.");const r=new R;r.onmessage=e;const s=await i("plugin:fs|watch",{paths:o.map(c=>c instanceof URL?c.toString():c),options:t,onEvent:r}),f=new y(s);return()=>{f.close()}}async function J(n,e,t){return await L(n,e,{delayMs:2e3,...t})}async function N(n,e,t){return await L(n,e,{...t,delayMs:void 0})}async function O(n,e){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");return await i("plugin:fs|size",{path:n instanceof URL?n.toString():n,options:e})}async function V(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|start_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}async function h(n){if(n instanceof URL&&n.protocol!=="file:")throw new TypeError("Must be a file URL.");await i("plugin:fs|stop_accessing_security_scoped_resource",{path:n instanceof URL?n.toString():n})}export{w as BaseDirectory,g as FileHandle,d as SeekMode,S as copyFile,b as create,H as exists,k as lstat,A as mkdir,p as open,T as readDir,E as readFile,_ as readTextFile,x as readTextFileLines,v as remove,M as rename,O as size,V as startAccessingSecurityScopedResource,C as stat,h as stopAccessingSecurityScopedResource,F as truncate,J as watch,N as watchImmediate,z as writeFile,I as writeTextFile};
@@ -1,4 +1,4 @@
1
- import{v as ge,k as te,l as k,m as Ee,n as L,q as Le,r as Me,u as De,D as Te,I as Ie,c as he,b as ye,V as Pe,w as ve,x as ke,y as Ne,h as Be,z as Fe,A as je,B as He,E as qe,F as Se,G as Oe,t as Re,d as Ge,P as Ke,H as we,J as _e}from"./index-Dm6VCxBu.js";import{TimelineScene as Ue}from"./scene-CnihjOu5.js";import"./three-DDiuFd7k.js";function We(s){const h=s.settings.tokens?s.sessions.filter(l=>typeof l.tokens=="number"):[],m=h.reduce((l,i)=>l+i.tokens,0);return{sessionCount:s.sessions.length,tokenCount:h.length&&Number.isSafeInteger(m)?m:null,tokensPartial:h.length>0&&h.length<s.sessions.length}}function Xe(s){const h=We(s),m=[`${h.sessionCount.toLocaleString()} sessions`];if(s.settings.tokens&&m.push(h.tokenCount===null?"Tokens unknown":`${h.tokenCount.toLocaleString()} tokens`),s.settings.messageCounts){const l=s.sessions.filter(i=>i.messages?.count!=null);m.push(l.length?`${l.reduce((i,x)=>i+x.messages.count,0).toLocaleString()} messages`:"Messages unknown")}return m.join(" · ")}const A=s=>s==null?"unknown":s.toLocaleString(),z=s=>s===null?"unknown":new Date(s).toLocaleString(),se=(s,h=!1)=>new Date(s).toLocaleDateString("en",{month:"short",day:"numeric",...h?{year:"numeric"}:{}}),Ye=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1});let Ve=0;function Ze(s,h,m={}){let l=ge(h),i=te(l),x=new Map(i.lanes.flatMap(e=>e.nodes.map(t=>[Number(t.session.projectID),e.label])));s.classList.add("public-viewer"),s.dataset.graphAudio="";const ne=`public-graph-help-${++Ve}`;s.classList.toggle("public-viewer-full",!!m.fullscreen),s.innerHTML=`
1
+ import{v as ge,k as te,l as k,m as Ee,n as L,q as Le,r as Me,u as De,D as Te,I as Ie,c as he,b as ye,V as Pe,w as ve,x as ke,y as Ne,h as Be,z as Fe,A as je,B as He,E as qe,F as Se,G as Oe,t as Re,d as Ge,P as Ke,H as we,J as _e}from"./index-DCSeQKMi.js";import{TimelineScene as Ue}from"./scene-B94ITHcm.js";import"./three-DDiuFd7k.js";function We(s){const h=s.settings.tokens?s.sessions.filter(l=>typeof l.tokens=="number"):[],m=h.reduce((l,i)=>l+i.tokens,0);return{sessionCount:s.sessions.length,tokenCount:h.length&&Number.isSafeInteger(m)?m:null,tokensPartial:h.length>0&&h.length<s.sessions.length}}function Xe(s){const h=We(s),m=[`${h.sessionCount.toLocaleString()} sessions`];if(s.settings.tokens&&m.push(h.tokenCount===null?"Tokens unknown":`${h.tokenCount.toLocaleString()} tokens`),s.settings.messageCounts){const l=s.sessions.filter(i=>i.messages?.count!=null);m.push(l.length?`${l.reduce((i,x)=>i+x.messages.count,0).toLocaleString()} messages`:"Messages unknown")}return m.join(" · ")}const A=s=>s==null?"unknown":s.toLocaleString(),z=s=>s===null?"unknown":new Date(s).toLocaleString(),se=(s,h=!1)=>new Date(s).toLocaleDateString("en",{month:"short",day:"numeric",...h?{year:"numeric"}:{}}),Ye=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1});let Ve=0;function Ze(s,h,m={}){let l=ge(h),i=te(l),x=new Map(i.lanes.flatMap(e=>e.nodes.map(t=>[Number(t.session.projectID),e.label])));s.classList.add("public-viewer"),s.dataset.graphAudio="";const ne=`public-graph-help-${++Ve}`;s.classList.toggle("public-viewer-full",!!m.fullscreen),s.innerHTML=`
2
2
  <div class="public-canvas" aria-label="Interactive public session graph"></div>
3
3
  <nav class="public-view-controls" aria-label="Graph controls">
4
4
  ${k("center-focus","Fit view",{"data-fit":!0},"Fit view (F)")}
@@ -1,4 +1,4 @@
1
- import{R as De,W as Ae,H as Ce,T as Ee,M as ve,C as V,S as xe,a as k,G as X,P as he,I as ge,b as F,D,c as L,A as H,d as Z,e as j,B as E,F as I,f as re,g as U,V as v,h as O,i as ne,j as Fe,k as Ge,l as Ue,O as Oe,E as ze,U as Xe,m as Le,n as He,o as _e,p as Ve,q as Ne,r as se,s as $e,t as We,u as ue,v as je,w as qe,x as ae,y as de,z as Ye,L as Ze,J as we,K as Me,N as Ke}from"./three-DDiuFd7k.js";import{K as te,L as P,D as Re,M as le,N as B,a as Qe,O as Je,Q as oe,T as et,U as tt,W as it}from"./index-Dm6VCxBu.js";class st extends De{target=new Ae(1,1,{type:Ce});copy=new Ee(this.target.texture);setSamples(e){this.target.samples!==e&&(this.target.samples=e,this.target.dispose())}setSize(e,t){this.target.setSize(e,t)}render(e,t,s,o,i){if(!this.target.samples){super.render(e,t,s,o,i);return}super.render(e,t,this.target,o,i),this.copy.render(e,t,s,o,i)}dispose(){this.copy.dispose(),this.target.dispose()}}const ot=new Intl.DateTimeFormat("en",{month:"short"}),rt=new Intl.DateTimeFormat("en",{month:"short",year:"numeric"});function nt(u){if(u.calendarTime===!1||!(u.end>u.start))return[];const e=new Date(u.start),t=new Date(u.end);if(!Number.isFinite(+e)||!Number.isFinite(+t))return[];const s=h=>h.getFullYear()*12+h.getMonth(),o=s(e),i=s(t),r=Math.ceil((i-o+1)/24),a=[1,2,3,6,12].find(h=>h>=r)??Math.ceil(r/12)*12,n=o===i||e.getFullYear()!==t.getFullYear()?rt:ot,l=[];for(let h=Math.ceil(o/a)*a;h<=i;h+=a){const c=new Date(0);c.setFullYear(Math.floor(h/12),h%12,1),c.setHours(0,0,0,0),+c>=u.start&&+c<=u.end&&l.push({x:te(+c,u),label:n.format(c)})}return!l.length&&o===i&&l.push({x:te(u.start,u),label:n.format(e)}),l}const Te=`
1
+ import{R as De,W as Ae,H as Ce,T as Ee,M as ve,C as V,S as xe,a as k,G as X,P as he,I as ge,b as F,D,c as L,A as H,d as Z,e as j,B as E,F as I,f as re,g as U,V as v,h as O,i as ne,j as Fe,k as Ge,l as Ue,O as Oe,E as ze,U as Xe,m as Le,n as He,o as _e,p as Ve,q as Ne,r as se,s as $e,t as We,u as ue,v as je,w as qe,x as ae,y as de,z as Ye,L as Ze,J as we,K as Me,N as Ke}from"./three-DDiuFd7k.js";import{K as te,L as P,D as Re,M as le,N as B,a as Qe,O as Je,Q as oe,T as et,U as tt,W as it}from"./index-DCSeQKMi.js";class st extends De{target=new Ae(1,1,{type:Ce});copy=new Ee(this.target.texture);setSamples(e){this.target.samples!==e&&(this.target.samples=e,this.target.dispose())}setSize(e,t){this.target.setSize(e,t)}render(e,t,s,o,i){if(!this.target.samples){super.render(e,t,s,o,i);return}super.render(e,t,this.target,o,i),this.copy.render(e,t,s,o,i)}dispose(){this.copy.dispose(),this.target.dispose()}}const ot=new Intl.DateTimeFormat("en",{month:"short"}),rt=new Intl.DateTimeFormat("en",{month:"short",year:"numeric"});function nt(u){if(u.calendarTime===!1||!(u.end>u.start))return[];const e=new Date(u.start),t=new Date(u.end);if(!Number.isFinite(+e)||!Number.isFinite(+t))return[];const s=h=>h.getFullYear()*12+h.getMonth(),o=s(e),i=s(t),r=Math.ceil((i-o+1)/24),a=[1,2,3,6,12].find(h=>h>=r)??Math.ceil(r/12)*12,n=o===i||e.getFullYear()!==t.getFullYear()?rt:ot,l=[];for(let h=Math.ceil(o/a)*a;h<=i;h+=a){const c=new Date(0);c.setFullYear(Math.floor(h/12),h%12,1),c.setHours(0,0,0,0),+c>=u.start&&+c<=u.end&&l.push({x:te(+c,u),label:n.format(c)})}return!l.length&&o===i&&l.push({x:te(u.start,u),label:n.format(e)}),l}const Te=`
2
2
  attribute float nodeIndex;
3
3
  uniform float uSelected;
4
4
  uniform float uHovered;
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BcuycrLl.js","assets/index-Dm6VCxBu.js","assets/index-ZvQzUBK1.css","assets/index-DHztibvv.js"])))=>i.map(i=>d[i]);
2
- import{p as z,i as j,_ as H,s as K,a as V,o as J,b as Q,c as Y,t as Z,d as ee,S as L,e as te,f as ae,g as se,h as oe}from"./index-Dm6VCxBu.js";import{TimelineScene as re}from"./scene-CnihjOu5.js";import"./three-DDiuFd7k.js";const ne="#b0e9d6",ie="#dbe7e3",O=128,le=10,de="M102 24 86 40H36a14 14 0 0 0 0 28h40a14 14 0 0 1 0 28H22",ce=[[102,24],[36,40],[22,96]],ue=10;let U;function he(e,l,a,n,i=ne){U??=new Path2D(de),e.save(),e.translate(l,a),e.scale(n/O,n/O),e.strokeStyle=e.fillStyle=i,e.lineWidth=le,e.lineCap=e.lineJoin="round",e.stroke(U);for(const[y,h]of ce)e.beginPath(),e.arc(y,h,ue,0,Math.PI*2),e.fill();e.restore()}function pe(e){const l=z(e.lanes.length),a=new Map(e.lanes.flatMap(s=>s.nodes.map(t=>[t.session.id,s.key]))),n=new Map;for(const s of e.nodes.map(t=>t.session).sort((t,r)=>t.created-r.created||t.id.localeCompare(r.id))){const t=a.get(s.id);t!==void 0&&!n.has(t)&&n.set(t,n.size)}const i=new Map(e.nodes.map((s,t)=>[s.session.id,`session-${t}`])),y=new Map(e.lanes.flatMap((s,t)=>s.nodes.map(r=>[r.session.id,`project-${t}`]))),h=e.nodes.map(s=>{const t=s.session,r={id:i.get(t.id),title:"Session",projectID:y.get(t.id),directory:"",created:t.created,updated:t.created,activity:t.activity&&{firstMessageAt:t.activity.firstMessageAt,lastMessageAt:t.activity.lastMessageAt,userMessages:t.activity.userMessages,untimedUserMessages:t.activity.untimedUserMessages},archived:!1,model:"",provider:"",agent:"",cost:null,source:t.source==="continue"?"continue":t.source==="opencode"||!t.source?"opencode":"unknown",tokens:t.tokens};return t.parentID&&i.has(t.parentID)&&(r.parentID=i.get(t.parentID)),t.forkID&&i.has(t.forkID)&&(r.forkID=i.get(t.forkID)),{session:r,position:[...s.position],startPosition:[...s.startPosition],color:s.color,radius:s.radius}}),d=new Map(h.map(s=>[s.session.id,s]));return{start:e.start,end:e.end,timeFrame:e.timeFrame&&{...e.timeFrame},nodes:h,edges:e.edges.map(s=>({from:i.get(s.from),to:i.get(s.to),kind:s.kind})),lanes:e.lanes.map((s,t)=>({key:`project-${t}`,label:l[n.get(s.key)],color:s.color,kind:"directory",y:s.y,z:s.z,nodes:s.nodes.map(r=>d.get(i.get(r.session.id)))}))}}const $={mp4:{label:"MP4",description:"MP4 video",mime:"video/mp4",filename:"sessiongraph-playback.mp4"}},T=`My coding sessions, visualized with SessionGraph.
3
- https://github.com/arvindell/sessiongraph`,ye=`https://x.com/intent/tweet?text=${encodeURIComponent(T)}`,G=e=>e instanceof Error&&e.name==="AbortError";async function me(e,l,a){const{label:n,description:i,mime:y,filename:h}=$[a];try{if(j()){const[{save:d},{writeFile:s}]=await Promise.all([H(()=>import("./index-BcuycrLl.js"),__vite__mapDeps([0,1,2])),H(()=>import("./index-DHztibvv.js"),__vite__mapDeps([3,1,2]))]),t=await d({title:`Save SessionGraph ${n}`,defaultPath:h,filters:[{name:i,extensions:[a]}]});if(!t)return"cancelled";await s(t,new Uint8Array(await e.arrayBuffer()))}else{const d=window.showSaveFilePicker;if(d){const t=await(await d.call(window,{suggestedName:h,types:[{description:i,accept:{[y]:[`.${a}`]}}]})).createWritable();try{await t.write(e),await t.close()}catch(r){throw await t.abort().catch(()=>{}),r}}else{const s=document.createElement("a");return s.href=l,s.download=h,document.body.append(s),s.click(),s.remove(),"downloaded"}}return"saved"}catch(d){if(G(d))return"cancelled";throw d}}const g=960,P=600,q='"Katagami Sans", sans-serif',fe=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e);function ve(e,l,a,n,i,y){const s=P-122,t=Math.max(1,...n);e.save(),he(e,24,14,28),e.fillStyle=ie,e.font=`600 14px ${q}`,e.textAlign="left",e.textBaseline="middle",e.fillText("SessionGraph",58,28),e.restore();for(let u=0;u<n.length;u++){const m=Math.max(2,n[u]/t*22);e.fillStyle=u/n.length<=a?"#91bfae":"#253d39",e.fillRect(260+u/n.length*440,s-m,440/n.length-2,m)}e.fillStyle="#d6f4e8",e.fillRect(260+440*a,s-27,1,31);const r=l.start+(l.end-l.start)*a,k=i.at(r,a===1).tokens;e.textAlign="center",e.fillStyle="#a0baae",e.font='12px "IBM Plex Mono", monospace',e.fillText(oe(r,l.end-l.start),g/2,s+23),e.fillStyle="#e7f5ee",e.font=`36px ${q}`,e.fillText(y(r,a===1).toLocaleString("en"),g/2-105,s+66),e.fillText(i.recorded?fe(k):"—",g/2+105,s+66),e.font=`12px ${q}`,e.fillStyle="#92b0a3",e.fillText("Sessions",g/2-105,s+87),e.fillText("Burnt tokens",g/2+105,s+87),e.textAlign="left"}async function be(e,l,a,n){a.throwIfAborted();const{label:i,mime:y}=$.mp4,h=Q(e.nodes.map(p=>p.session)),d=Y(e.nodes.map(p=>p.session)),s=Z(e.nodes.map(p=>ee(p.session)),e.start,e.end),t=document.createElement("div");t.className="share-render-host",t.setAttribute("aria-hidden","true"),t.style.cssText=`position:fixed;left:-12000px;top:0;width:${g}px;height:${P}px;pointer-events:none;visibility:hidden`,document.body.append(t);const r=document.createElement("canvas");r.width=g,r.height=P;const k=r.getContext("2d",{willReadFrequently:!0});let u,m;try{if(!k)throw new Error("Canvas export is unavailable.");u=new re(t,{onSelect(){},onHover(){},onPlaybackInterrupt(){},onEvent(){},onEventHover(){}},{manual:!0}),u.applyPreferences({...l,quality:"balanced",motion:"on",labels:!0,focusDimming:!1,trails:l.trails==="selected"?"all":l.trails}),u.setGraph(e,!0),u.prepareCapture(),await document.fonts.ready,a.throwIfAborted(),m=new Worker(new URL("/assets/mp4-worker-Dc_1QUwS.js",import.meta.url),{type:"module"});const p=(v,A=[])=>new Promise((b,w)=>{a.throwIfAborted();const f=()=>{clearTimeout(M),a.removeEventListener("abort",C),m.onmessage=null,m.onerror=null},C=()=>{f(),w(a.reason)},M=setTimeout(()=>{f(),w(new Error(`${i} encoding timed out. Please try again.`))},6e4);a.addEventListener("abort",C,{once:!0}),m.onmessage=E=>{f(),E.data.error?w(new Error(E.data.error)):b(E.data)},m.onerror=()=>{f(),w(new Error(`Could not start the ${i} encoder.`))},m.postMessage(v,A)});await p({init:!0,width:g,height:P});for(let v=0;v<L;v++){a.throwIfAborted();const A=te(v);u.captureFrame(A,1/ae,k,se(v)),ve(k,e,A,s,h,d);const b=k.getImageData(0,0,g,P).data.buffer;await p({rgba:b,width:g,height:P},[b]),n((v+1)/L)}const I=await p({finish:!0});return new Blob([I.bytes],{type:y})}finally{m?.terminate(),u?.dispose(),t.remove()}}function ke(e,l){const a=document.createElement("dialog");a.className="share-dialog",a.setAttribute("aria-labelledby","share-title"),a.innerHTML=`<p>Create a private MP4 video. Project and session names are hidden, and nothing is uploaded.</p>
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index--OQ4NiAJ.js","assets/index-DCSeQKMi.js","assets/index-ZvQzUBK1.css","assets/index-ZwvTaIqn.js"])))=>i.map(i=>d[i]);
2
+ import{p as z,i as j,_ as H,s as K,a as V,o as J,b as Q,c as Y,t as Z,d as ee,S as L,e as te,f as ae,g as se,h as oe}from"./index-DCSeQKMi.js";import{TimelineScene as re}from"./scene-B94ITHcm.js";import"./three-DDiuFd7k.js";const ne="#b0e9d6",ie="#dbe7e3",O=128,le=10,de="M102 24 86 40H36a14 14 0 0 0 0 28h40a14 14 0 0 1 0 28H22",ce=[[102,24],[36,40],[22,96]],ue=10;let U;function he(e,l,a,n,i=ne){U??=new Path2D(de),e.save(),e.translate(l,a),e.scale(n/O,n/O),e.strokeStyle=e.fillStyle=i,e.lineWidth=le,e.lineCap=e.lineJoin="round",e.stroke(U);for(const[y,h]of ce)e.beginPath(),e.arc(y,h,ue,0,Math.PI*2),e.fill();e.restore()}function pe(e){const l=z(e.lanes.length),a=new Map(e.lanes.flatMap(s=>s.nodes.map(t=>[t.session.id,s.key]))),n=new Map;for(const s of e.nodes.map(t=>t.session).sort((t,r)=>t.created-r.created||t.id.localeCompare(r.id))){const t=a.get(s.id);t!==void 0&&!n.has(t)&&n.set(t,n.size)}const i=new Map(e.nodes.map((s,t)=>[s.session.id,`session-${t}`])),y=new Map(e.lanes.flatMap((s,t)=>s.nodes.map(r=>[r.session.id,`project-${t}`]))),h=e.nodes.map(s=>{const t=s.session,r={id:i.get(t.id),title:"Session",projectID:y.get(t.id),directory:"",created:t.created,updated:t.created,activity:t.activity&&{firstMessageAt:t.activity.firstMessageAt,lastMessageAt:t.activity.lastMessageAt,userMessages:t.activity.userMessages,untimedUserMessages:t.activity.untimedUserMessages},archived:!1,model:"",provider:"",agent:"",cost:null,source:t.source==="continue"?"continue":t.source==="opencode"||!t.source?"opencode":"unknown",tokens:t.tokens};return t.parentID&&i.has(t.parentID)&&(r.parentID=i.get(t.parentID)),t.forkID&&i.has(t.forkID)&&(r.forkID=i.get(t.forkID)),{session:r,position:[...s.position],startPosition:[...s.startPosition],color:s.color,radius:s.radius}}),d=new Map(h.map(s=>[s.session.id,s]));return{start:e.start,end:e.end,timeFrame:e.timeFrame&&{...e.timeFrame},nodes:h,edges:e.edges.map(s=>({from:i.get(s.from),to:i.get(s.to),kind:s.kind})),lanes:e.lanes.map((s,t)=>({key:`project-${t}`,label:l[n.get(s.key)],color:s.color,kind:"directory",y:s.y,z:s.z,nodes:s.nodes.map(r=>d.get(i.get(r.session.id)))}))}}const $={mp4:{label:"MP4",description:"MP4 video",mime:"video/mp4",filename:"sessiongraph-playback.mp4"}},T=`My coding sessions, visualized with SessionGraph.
3
+ https://sessiongraph.ai`,ye=`https://x.com/intent/tweet?text=${encodeURIComponent(T)}`,G=e=>e instanceof Error&&e.name==="AbortError";async function me(e,l,a){const{label:n,description:i,mime:y,filename:h}=$[a];try{if(j()){const[{save:d},{writeFile:s}]=await Promise.all([H(()=>import("./index--OQ4NiAJ.js"),__vite__mapDeps([0,1,2])),H(()=>import("./index-ZwvTaIqn.js"),__vite__mapDeps([3,1,2]))]),t=await d({title:`Save SessionGraph ${n}`,defaultPath:h,filters:[{name:i,extensions:[a]}]});if(!t)return"cancelled";await s(t,new Uint8Array(await e.arrayBuffer()))}else{const d=window.showSaveFilePicker;if(d){const t=await(await d.call(window,{suggestedName:h,types:[{description:i,accept:{[y]:[`.${a}`]}}]})).createWritable();try{await t.write(e),await t.close()}catch(r){throw await t.abort().catch(()=>{}),r}}else{const s=document.createElement("a");return s.href=l,s.download=h,document.body.append(s),s.click(),s.remove(),"downloaded"}}return"saved"}catch(d){if(G(d))return"cancelled";throw d}}const g=960,P=600,q='"Katagami Sans", sans-serif',fe=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e);function ve(e,l,a,n,i,y){const s=P-122,t=Math.max(1,...n);e.save(),he(e,24,14,28),e.fillStyle=ie,e.font=`600 14px ${q}`,e.textAlign="left",e.textBaseline="middle",e.fillText("SessionGraph",58,28),e.restore();for(let u=0;u<n.length;u++){const m=Math.max(2,n[u]/t*22);e.fillStyle=u/n.length<=a?"#91bfae":"#253d39",e.fillRect(260+u/n.length*440,s-m,440/n.length-2,m)}e.fillStyle="#d6f4e8",e.fillRect(260+440*a,s-27,1,31);const r=l.start+(l.end-l.start)*a,k=i.at(r,a===1).tokens;e.textAlign="center",e.fillStyle="#a0baae",e.font='12px "IBM Plex Mono", monospace',e.fillText(oe(r,l.end-l.start),g/2,s+23),e.fillStyle="#e7f5ee",e.font=`36px ${q}`,e.fillText(y(r,a===1).toLocaleString("en"),g/2-105,s+66),e.fillText(i.recorded?fe(k):"—",g/2+105,s+66),e.font=`12px ${q}`,e.fillStyle="#92b0a3",e.fillText("Sessions",g/2-105,s+87),e.fillText("Burnt tokens",g/2+105,s+87),e.textAlign="left"}async function be(e,l,a,n){a.throwIfAborted();const{label:i,mime:y}=$.mp4,h=Q(e.nodes.map(p=>p.session)),d=Y(e.nodes.map(p=>p.session)),s=Z(e.nodes.map(p=>ee(p.session)),e.start,e.end),t=document.createElement("div");t.className="share-render-host",t.setAttribute("aria-hidden","true"),t.style.cssText=`position:fixed;left:-12000px;top:0;width:${g}px;height:${P}px;pointer-events:none;visibility:hidden`,document.body.append(t);const r=document.createElement("canvas");r.width=g,r.height=P;const k=r.getContext("2d",{willReadFrequently:!0});let u,m;try{if(!k)throw new Error("Canvas export is unavailable.");u=new re(t,{onSelect(){},onHover(){},onPlaybackInterrupt(){},onEvent(){},onEventHover(){}},{manual:!0}),u.applyPreferences({...l,quality:"balanced",motion:"on",labels:!0,focusDimming:!1,trails:l.trails==="selected"?"all":l.trails}),u.setGraph(e,!0),u.prepareCapture(),await document.fonts.ready,a.throwIfAborted(),m=new Worker(new URL("/assets/mp4-worker-Dc_1QUwS.js",import.meta.url),{type:"module"});const p=(v,A=[])=>new Promise((b,w)=>{a.throwIfAborted();const f=()=>{clearTimeout(M),a.removeEventListener("abort",C),m.onmessage=null,m.onerror=null},C=()=>{f(),w(a.reason)},M=setTimeout(()=>{f(),w(new Error(`${i} encoding timed out. Please try again.`))},6e4);a.addEventListener("abort",C,{once:!0}),m.onmessage=E=>{f(),E.data.error?w(new Error(E.data.error)):b(E.data)},m.onerror=()=>{f(),w(new Error(`Could not start the ${i} encoder.`))},m.postMessage(v,A)});await p({init:!0,width:g,height:P});for(let v=0;v<L;v++){a.throwIfAborted();const A=te(v);u.captureFrame(A,1/ae,k,se(v)),ve(k,e,A,s,h,d);const b=k.getImageData(0,0,g,P).data.buffer;await p({rgba:b,width:g,height:P},[b]),n((v+1)/L)}const I=await p({finish:!0});return new Blob([I.bytes],{type:y})}finally{m?.terminate(),u?.dispose(),t.remove()}}function ke(e,l){const a=document.createElement("dialog");a.className="share-dialog",a.setAttribute("aria-labelledby","share-title"),a.innerHTML=`<p>Create a private MP4 video. Project and session names are hidden, and nothing is uploaded.</p>
4
4
  <div class="share-preview"><video aria-label="SessionGraph playback with hidden project and session names" muted loop playsinline controls hidden></video><div class="share-progress"><progress max="100" value="0" aria-label="Creating video"></progress><span role="status">Creating video… 0%</span></div></div>
5
5
  <p class="share-notice" role="status" hidden></p>
6
6
  <div class="share-actions"><button class="text-button share-close">Cancel</button><button class="secondary-button share-retry" hidden>Try again</button><a class="secondary-button share-x" target="_blank" rel="noopener noreferrer" hidden>Share in X</a><button class="secondary-button share-system" aria-label="Open share tray" aria-controls="playback-share-tray" aria-expanded="false" hidden>Share…</button><button class="primary-button share-save" hidden>Save MP4</button></div>
package/dist/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="icon" sizes="any" href="/favicon.ico" />
13
13
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
14
14
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
15
- <script type="module" crossorigin src="/assets/index-Dm6VCxBu.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-DCSeQKMi.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/assets/index-ZvQzUBK1.css">
17
17
  </head>
18
18
  <body>
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "sessiongraph",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/"
8
8
  },
9
9
  "description": "Explore & visualize all your LLM sessions",
10
+ "homepage": "https://sessiongraph.ai",
10
11
  "repository": {
11
12
  "type": "git",
12
13
  "url": "git+https://github.com/arvindell/sessiongraph.git"
@@ -26,11 +27,11 @@
26
27
  "README.md"
27
28
  ],
28
29
  "optionalDependencies": {
29
- "sessiongraph-app-darwin-arm64": "1.0.17",
30
- "sessiongraph-app-darwin-x64": "1.0.17",
31
- "sessiongraph-app-linux-arm64": "1.0.17",
32
- "sessiongraph-app-linux-x64": "1.0.17",
33
- "sessiongraph-app-win32-x64": "1.0.17"
30
+ "sessiongraph-app-darwin-arm64": "1.0.18",
31
+ "sessiongraph-app-darwin-x64": "1.0.18",
32
+ "sessiongraph-app-linux-arm64": "1.0.18",
33
+ "sessiongraph-app-linux-x64": "1.0.18",
34
+ "sessiongraph-app-win32-x64": "1.0.18"
34
35
  },
35
36
  "type": "module",
36
37
  "engines": {
@@ -83,5 +84,5 @@
83
84
  "zod": "4.6.7"
84
85
  },
85
86
  "packageManager": "pnpm@11.10.0",
86
- "sessionGraphCommit": "d94bd0dc3d479e954713ffb65e342755d90019fe"
87
+ "sessionGraphCommit": "84ff9a1241da9f53e668e5162f41d00b83357ec7"
87
88
  }