sessiongraph 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,192 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-viewer-B1aKDYpa.js","assets/scene-BCuZ73oU.js","assets/three-DDiuFd7k.js","assets/public-viewer-CyDoUT6s.css","assets/share-mJrTMarx.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const xd="modulepreload",$d=function(e){return"/"+e},Ki={},ws=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let c=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=i?.nonce||i?.getAttribute("nonce");o=c(n.map(l=>{if(l=$d(l),l in Ki)return;Ki[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const g=document.createElement("link");if(g.rel=u?"stylesheet":xd,u||(g.as="script"),g.crossOrigin="",g.href=l,a&&g.setAttribute("nonce",a),document.head.appendChild(g),u)return new Promise((h,y)=>{g.addEventListener("load",h),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&r(a.reason);return t().catch(r)})},Ld=[["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"}]],Id=[["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"}]],Td=[["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"}]],Md=[["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"}]],Ad=[["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"}]],Od=[["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"}]],Pd=[["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"}]],Dd=[["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"}]],Rd=[["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"}]],Vd=[["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"}]],Nd=[["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"}]],Fd=[["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"}]],Hd=[["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"}]],Wd=[["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"}]],jd=[["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"}]],_d=[["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"}]],Bd=[["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"}]],qd=[["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"}]],Ud=[["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"}]],Gd=[["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"}]],Yd=[["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"}]],Kd=[["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"}]],Zd=[["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"}]],zd=[["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"}]],Jd=[["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"}]],Xd=[["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"}]],Qd=[["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"}]],eu=[["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"}]],tu=[["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"}]],nu=[["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"}]],su=[["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"}]],ou=[["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"}]],ru=[["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"}]],iu=[["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"}]],au=[["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"}]],cu=[["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"}]],lu=[["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"}]],du=[["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"}]],uu=[["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"}]],Zi=[["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"}]],fu=[["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"}]],hu=[["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"}]],pu=[["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"}]],gu=[["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"}]],mu=[["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"}]],yu=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],vu=[["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"}]],bu=[["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"}]],wu=[["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"}]],Cu={apple:Ld,windows:ru,github:Xd,search:fu,"chevron-down":Id,"chevron-left":Md,"chevron-right":Od,"arrow-down":Td,"arrow-left":Ad,"arrow-right":Pd,"arrow-up-right":Dd,bot:Rd,calendar:Vd,x:Nd,clock:Hd,coins:Wd,terminal:jd,copy:_d,cpu:Bd,database:qd,"dollar-sign":Ud,"file-code-2":Gd,"sliders-horizontal":Yd,folder:Kd,"git-branch":Zd,"git-commit":zd,"git-fork":Jd,"circle-help":Qd,network:eu,keyboard:tu,"loader-circle":nu,lock:su,message:ou,orbit:iu,box:au,"panel-right":cu,panels:lu,pause:du,play:uu,"refresh-cw":Zi,"rotate-ccw":Zi,"settings-2":hu,"share-2":pu,sparkles:gu,crosshair:mu,"center-focus":Fd,check:yu,user:vu,"volume-2":bu,"volume-x":wu},ft=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function W(e,t=""){const n=Cu[e].map(([s,o])=>`<${s}${Object.entries(o).filter(([r])=>r!=="key").map(([r,i])=>` ${r.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}="${ft(String(i))}"`).join("")}></${s}>`).join("");return`<svg class="ui-icon${t?` ${ft(t)}`:""}" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true" focusable="false">${n}</svg>`}function Cr(e){const t=document.createElement("template");return t.innerHTML=W(e),t.content.firstElementChild}function ku(e,t="",n=!0){return`<details class="session-info graph-session-info"${n?" open":""}><summary>Session info ${W("chevron-down")}</summary><dl>
3
+ ${e.map(([s,o,r])=>`<div><dt>${W(s)}${ft(o)}</dt><dd>${ft(r)}</dd></div>`).join("")}
4
+ </dl>${t}</details>`}function at(e,t,n={},s=t,o=""){const r=Object.entries(n).flatMap(([i,a])=>a===!1?[]:[a===!0?i:`${i}="${ft(a)}"`]);return`<button type="button" class="graph-button${o?" graph-button-labeled":""}" aria-label="${ft(t)}" title="${ft(s)}" ${r.join(" ")}>${W(e)}${o?`<span>${ft(o)}</span>`:""}</button>`}const mc={search:["search","/","Search"],fit:["center-focus","F","Fit view"],panels:["panels","H","Panels"],clear:["x","Esc","Clear selection"]};function Eu(e,t){return`<aside class="graph-shortcuts ${ft(t)}" aria-label="Keyboard shortcuts">${e.map(n=>{const[s,o,r]=mc[n];return`<span>${W(s)}<kbd>${o}</kbd>${r}</span>`}).join("")}</aside>`}function Su(e){return{glyph:e?"volume-x":"volume-2",label:e?"Unmute sound":"Mute sound"}}function xu(e,t,n=""){const s=t.map(o=>mc[o]);return`<dialog class="graph-help" id="${e}" aria-labelledby="${e}-title">${at("x","Close help",{"data-close-help":!0})}<h2 id="${e}-title">Explore the map</h2>
5
+ <div class="graph-help-rows"><div><span>Orbit</span><kbd>Drag</kbd></div><div><span>Zoom</span><kbd>Scroll / pinch</kbd></div><div><span>Pan</span><kbd>Right-drag</kbd></div>
6
+ ${s.map(([o,r,i])=>`<div><span>${W(o)}${i}</span><kbd>${r}</kbd></div>`).join("")}</div>
7
+ <p>Time runs left to right. Select a session to inspect its details, or click empty space to clear the selection.</p>${n}</dialog>`}const zi=["#b0e9d6","#8eaff4","#d7a1f1","#eac594","#8cdbdf","#e7a3b8","#a8ca91"];function Fn(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/4294967295}function It(e){return rs(e).split("/").at(-1)||"/"}const rs=e=>(/^(?:[a-z]:[\\/]|\\\\)/i.test(e)?e.replace(/\\/g,"/"):e).replace(/\/+$/,"")||(e.startsWith("/")?"/":""),$u=e=>e.directory?JSON.stringify(["directory",rs(e.directory)]):JSON.stringify(["project",e.source||"opencode",e.projectID||e.id]),Zt=e=>Math.max(e.created,e.activity?.lastMessageAt||e.created),kr=(e,t)=>{const n=t.timeFrame||t;return(e-n.start)/Math.max(1,n.end-n.start)*300-150},lv=(e,t)=>kr(t.start+(t.end-t.start)*e,t),ti=(e,t)=>[t,e.position[1],e.position[2]],Lu=(e,t)=>ti(e,Math.max(e.startPosition[0],Math.min(t,e.position[0]))),dv=(e,t,n,s=0,o=[1,0,0])=>{const r=Lu(e,t);return[r[0]+o[0]*(n+s),r[1]+o[1]*(n+s),r[2]+o[2]*(n+s)]},uv=(e,t)=>[ti(e,Math.max(e.startPosition[0],Math.min(t.startPosition[0],e.position[0]))),t.startPosition];function yc(e,t,n,s){if(!e.length)return{nodes:[],edges:[],lanes:[],start:0,end:0};const o=C=>{if(!s)return $u(C);const E=s==="repository"?C.checkout?.repository:C.checkout?.worktree;return E?JSON.stringify([s,E]):C.directory?JSON.stringify(["directory",rs(C.directory)]):JSON.stringify([s,null])},r=[...e].sort((C,E)=>C.created-E.created||C.id.localeCompare(E.id)),i=r[0].created,a=r.reduce((C,E)=>Math.max(C,Zt(E)),i+36e5),c=n?.nodes.length?n.timeFrame||{start:n.start,end:n.end}:{start:i,end:a},l=new Map;for(const C of r){const E=o(C),b=l.get(E)||[];b.push(C),l.set(E,b)}const u=[...l].sort((C,E)=>E[1].length-C[1].length||C[0].localeCompare(E[0])),d=new Map(n?.lanes.map((C,E)=>[C.key,C.slot??E]));let g=Math.max(-1,...d.values())+1;for(const[C]of u)d.has(C)||d.set(C,g++);u.sort((C,E)=>d.get(C[0])-d.get(E[0]));const h=[],y=[],f=new Set(t.flatMap(C=>C.worktrees.map(rs)));u.forEach(([C,E])=>{const b=d.get(C),k=b*2.399963,P=b===0?0:15+Math.sqrt(b)*14,T=Math.cos(k)*P,m=Math.sin(k)*P*.7,$=zi[b%zi.length],D=t.find(F=>F.id===E[0].projectID),H=E[0].directory,O={key:C,slot:b,color:$,label:s==="repository"?E[0].checkout?.repositoryLabel||(H?It(H):"Unknown repository"):s==="worktree"?E[0].checkout?It(E[0].checkout.worktree):H?It(H):"Unknown worktree":H?It(H):D?.name||E[0].projectID||"Unknown directory",kind:s==="worktree"&&E[0].checkout||!s&&H&&f.has(rs(H))?"worktree":"directory",y:T,z:m,nodes:[]};for(const F of E){const B=kr(Zt(F),c),j=kr(F.created,c),Y=Fn(F.id),Le=!!(F.parentID||F.forkID)?12:6,Wt=Math.sin((j+150)/65+b*.7)*3.5,_e=typeof F.tokens=="number"&&Number.isFinite(F.tokens)?Math.max(0,F.tokens):0,Ae={session:F,position:[B,T+Wt+(Y-.5)*Le,m+(Fn(F.id+"z")-.5)*Le],startPosition:[j,0,0],color:$,radius:.35+Math.min(1.05,Math.cbrt(_e/1e5)*.3)};y.push(Ae),O.nodes.push(Ae)}h.push(O)});const p=new Set(r.map(C=>C.id)),v=[];for(const C of r)C.forkID&&p.has(C.forkID)?v.push({from:C.forkID,to:C.id,kind:"fork"}):C.parentID&&p.has(C.parentID)&&v.push({from:C.parentID,to:C.id,kind:"child"});const w=new Map(y.map(C=>[C.session.id,C])),S=new Set;for(const C of n?.lanes||[])for(const E of C.nodes){const b=w.get(E.session.id);b&&o(b.session)===C.key&&(b.position[1]=E.position[1],b.position[2]=E.position[2],S.add(b.session.id))}function M(C){const E=[],b=new Set;let k=C;for(;k&&!S.has(k.session.id)&&!b.has(k.session.id);){b.add(k.session.id);const P=k.session.forkID||k.session.parentID,T=P?w.get(P):void 0,m=T&&o(T.session)===o(k.session)?T:void 0;E.push({node:k,parent:m}),k=m}for(const{node:P,parent:T}of E.reverse()){const m=P.session.id;if(T){const $=Fn(m+"branch")>.5?1:-1;P.position[1]=T.position[1]+$*(9+Fn(m)*15),P.position[2]=T.position[2]+(Fn(m+"depth")-.5)*18}S.add(m)}}return r.forEach(C=>M(w.get(C.id))),y.forEach(C=>{C.startPosition=ti(C,C.startPosition[0])}),{nodes:y,edges:v,lanes:h,start:i,end:a,timeFrame:c}}const Iu=2,Ji=e=>JSON.stringify([Iu,e.importVersion,e.revision,e.updated,e.created,e.projectID,e.directory]),Cn=e=>e.normalize("NFKD").replace(new RegExp("\\p{M}","gu"),"").toLowerCase(),ni=e=>Cn(e).match(/[\p{L}\p{N}]+/gu)||[],Tu=e=>ni(e).join(" ");function Mu(e){const t={text:"",terms:[],phrases:[],filters:[]},n=[];for(const s of e.slice(0,300).match(/(?:[^\s"]+|"[^"]*")+/g)||[]){const o=/^(source|project|dir|model|is|after|before|in):(.+)$/i.exec(s);if(o){const i=o[1].toLowerCase(),a=Cn(o[2].replace(/^"|"$/g,""));if(i==="in"){const c={title:["title"],files:["files"],messages:["body"],tools:["tools"]};t.fields=c[a],t.fields||(t.error="Use in:title, in:files, in:messages, or in:tools.")}else i==="is"&&!["fork","child","root","archived"].includes(a)?t.error="Use is:fork, is:child, is:root, or is:archived.":["after","before"].includes(i)&&(!/^\d{4}-\d{2}-\d{2}$/.test(a)||!Number.isFinite(Date.parse(a))||new Date(a).toISOString().slice(0,10)!==a)?t.error="Use a valid date in YYYY-MM-DD format.":t.filters.push([i,a]);continue}const r=s.replace(/^"|"$/g,"");s.startsWith('"')&&s.endsWith('"')&&t.phrases.push(Tu(r)),n.push(r)}return t.text=n.join(" "),t.terms=ni(t.text).slice(0,12),t.text=t.terms.join(" "),t}function Au(e,t,n=220){const s=Cn(e),o=t.reduce((i,a)=>{const c=s.indexOf(a);return c<0?i:Math.min(i,c)},1/0),r=Number.isFinite(o)?Math.max(0,o-55):0;return`${r?"…":""}${e.slice(r,r+n).replace(/\s+/g," ").trim()}${e.length>r+n?"…":""}`}const ko={opencode:{name:"OpenCode",icon:"opencode"},"claude-code":{name:"Claude Code",icon:"claude"},codex:{name:"Codex",icon:"openai"},"t3-code":{name:"T3 Code",icon:"t3"},cursor:{name:"Cursor",icon:"cursor"},gemini:{name:"Gemini CLI",icon:"gemini"},"qwen-code":{name:"Qwen Code",icon:"qwen"},pi:{name:"Pi",icon:"pi"},copilot:{name:"GitHub Copilot CLI",icon:"copilot"},"copilot-chat":{name:"GitHub Copilot Chat (VS Code)",icon:"copilot"},cline:{name:"Cline",icon:"cline"},"roo-code":{name:"Roo Code",icon:"roo"},"kilo-code":{name:"Kilo Code",icon:"kilo"},continue:{name:"Continue",icon:"continue"},"prime-agent":{name:"Prime Agent",icon:"prime"},omp:{name:"Oh My Pi",icon:"pi"},senpi:{name:"Senpi / OmO Native",icon:"senpi"},kimchi:{name:"Kimchi",icon:"kimchi"},gajae:{name:"Gajae-Code",icon:"gajae"},openclaw:{name:"OpenClaw",icon:"openclaw"},hermes:{name:"Hermes Agent",icon:"hermes"},amp:{name:"Amp",icon:"amp"},droid:{name:"Factory Droid",icon:"droid"},codebuff:{name:"Codebuff",icon:"codebuff"},freebuff:{name:"Freebuff",icon:"freebuff"},kimi:{name:"Kimi CLI / Code",icon:"kimi"},grok:{name:"Grok Build",icon:"grok"},jcode:{name:"Jcode",icon:"jcode"},"cherry-studio":{name:"Cherry Studio",icon:"cherry"},"command-code":{name:"Command Code",icon:"commandcode"},zcode:{name:"ZCode",icon:"zcode"},codebuddy:{name:"CodeBuddy",icon:"codebuddy"},workbuddy:{name:"WorkBuddy",icon:"codebuddy"},proma:{name:"Proma",icon:"proma"},"deepseek-harness":{name:"DeepSeek Harness",icon:"deepseek"},aside:{name:"Aside",icon:"aside"},vibe:{name:"Mistral Vibe",icon:"mistral"},muse:{name:"Muse Code",icon:"muse"},junie:{name:"Junie",icon:"junie"},augment:{name:"Augment Code",icon:"augment"},fx:{name:"Fx",icon:"fx"},"minimax-code":{name:"MiniMax Code",icon:"minimax"},opencodereview:{name:"OpenCodeReview",icon:"opencode"},goose:{name:"Goose",icon:"goose"},zed:{name:"Zed Agent",icon:"zed"},devin:{name:"Devin CLI",icon:"devin"},"devin-desktop":{name:"Devin Desktop",icon:"devin"},crush:{name:"Crush",icon:"crush"},octofriend:{name:"Octofriend",icon:"octofriend"},"kilo-cli":{name:"Kilo CLI",icon:"kilo"},"mimo-code":{name:"MiMo Code",icon:"mimo"},"mimo-desktop":{name:"Xiaomi MiMo AI",icon:"mimo"},unsloth:{name:"Unsloth Studio",icon:"unsloth"},kiro:{name:"Kiro",icon:"kiro"},mux:{name:"Mux",icon:"mux"},antigravity:{name:"Antigravity",icon:"antigravity"},"antigravity-cli":{name:"Antigravity CLI",icon:"antigravity"},"antigravity-extension":{name:"Antigravity IDE Extension",icon:"antigravity"}},Fe=e=>ko[e||"opencode"]?.name||e||"Unknown",Ou=e=>typeof e=="string"&&Object.hasOwn(ko,e),kn=e=>{const t=ko[e||""]?.icon||"generic";return`<span class="source-icon source-icon-${t}" aria-hidden="true" style="--source-icon:url('/sources/${t}.svg')"></span>`};function Pu(e,t="/sources"){const n=ko[e||""]?.icon||"generic",s=document.createElement("span");return s.className=`source-icon source-icon-${n}`,s.setAttribute("aria-hidden","true"),s.style.setProperty("--source-icon",`url('${t}/${n}.svg')`),s}const vc=e=>[...e].sort((t,n)=>Number(n.selected||n.available||n.sessions>0)-Number(t.selected||t.available||t.sessions>0)||t.name.localeCompare(n.name)),_t=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function Du(e,{checked:t=e.selected,disabled:n=!1,settings:s=!1}={}){const o=e.available?"Detected":"Not detected",r=e.capabilities.history?"":"Metadata only",i=[e.description,e.lastImport?`Last import ${new Date(e.lastImport).toLocaleString()}`:"Not imported yet",e.error].filter(Boolean).join(" · ");return`<label class="import-source" data-source="${_t(e.id)}" title="${_t(i)}"><input ${s?'class="settings-source"':""} type="checkbox" value="${_t(e.id)}" aria-label="${_t(e.name)}" aria-description="${_t(`${o}. ${e.sessions.toLocaleString()} saved sessions. ${i}`)}" ${t?"checked":""} ${n?"disabled":""}/><span class="source-symbol">${kn(e.id)}</span><span class="source-copy"><strong>${_t(e.name)}</strong><small class="source-meta"><span class="source-detected ${e.available?"detected":""}">${o}</span><span>${e.sessions.toLocaleString()} saved</span>${r?`<span>${r}</span>`:""}</small>${e.error?`<small class="source-error">${_t(e.error)}</small>`:""}</span></label>`}const Pe=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function Hn(e,t){const n=new Set(t.map(Cn));let s=0,o="";for(const r of e.matchAll(/[\p{L}\p{N}]+/gu)){o+=Pe(e.slice(s,r.index));const i=Cn(r[0]),a=[...n].some(c=>i.startsWith(c));o+=a?`<mark>${Pe(r[0])}</mark>`:Pe(r[0]),s=r.index+r[0].length}return o+Pe(e.slice(s))}function Ru(e,t=()=>{},n){const s=new Worker(new URL("/assets/worker-B9mWJfQ6.js",import.meta.url),{type:"module"}),o=new AbortController,r={signal:o.signal},i=document.createElement("dialog");i.className="search-dialog",i.setAttribute("aria-label","Search sessions"),i.innerHTML=`
8
+ <div class="search-command"><span class="search-command-icon" aria-hidden="true">${W("search")}</span><input id="session-query" type="search" placeholder="Search sessions, messages, files…" autocomplete="off" spellcheck="false" role="combobox" aria-label="Search all sessions" aria-autocomplete="list" aria-expanded="true" aria-controls="search-results"/><button class="icon-button search-close" aria-label="Close search" title="Close (Esc)">${W("x")}</button></div>
9
+ <div class="search-options"><select id="search-scope" aria-label="Search scope" title="Switch scope (Alt+S)"><option value="all">All history</option><option value="view">Current view</option></select><button id="search-conversations" class="search-chip" aria-label="Index conversations" aria-pressed="true" title="Pause or resume background indexing. Indexed messages, tools, and files remain searchable.">Conversations</button><span id="search-index-state" role="status">Loading index…</span></div>
10
+ <div class="search-body"><div id="search-results" class="search-results" role="listbox" aria-label="Matching sessions"><div class="search-results-inner"></div></div><aside id="search-preview" class="search-preview" aria-label="Session preview"></aside></div>
11
+ <div class="search-footer"><span id="search-result-status" role="status">Loading sessions…</span><button id="search-more" hidden>More results</button><details class="search-syntax"><summary title="Search filters and cache">Filters</summary><div><code>project:sessiongraph</code><code>model:claude</code><code>in:files package.json</code><code>is:fork</code><code>after:2026-09-01</code><code>"exact phrase"</code><button id="search-clear-cache" title="Clear saved search text and pause indexing. Titles remain searchable; enable Conversations to rebuild.">Clear saved index</button></div></details><span class="search-keys"><kbd>↑↓</kbd> navigate <kbd>↵</kbd> open</span></div>`,document.body.append(i);const a=N=>i.querySelector(N),c=a("#session-query"),l=a("#search-results"),u=a(".search-results-inner"),d=a("#search-preview"),g=a("#search-scope");let h=new Map,y=new Map,f,p=[],v=0,w=0,S=0,M=80,C=0,E=0,b=0,k=!1,P=!1,T=!0,m,$=null,D,H=0,O="",F="",B=!1;const j=new Map,Y=86,Me=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Le=new Map;let Wt,_e=0;const Ae=N=>s.postMessage(N);function Nn(){if(!m)return;const N=a("#search-index-state");N.textContent=m.storage==="restoring"?"Restoring saved index…":m.complete===m.total&&m.total?`Conversations ready${m.storage==="local"?" · saved locally":""}`:`${m.indexed.toLocaleString()} / ${m.total.toLocaleString()} conversations${T?m.active?" · indexing":" · partial":" · paused"}`,N.title=`Titles and metadata cover all ${m.total.toLocaleString()} imported sessions. ${m.complete.toLocaleString()} conversations have all supported text indexed. ${m.failed?`${m.failed} unavailable; toggle Conversations to retry. `:""}${m.limited?"Large histories are sampled; missing matches may be in unindexed text. ":""}${m.storage==="memory"?"Saving unavailable; search continues in memory.":`Saved in local SQLite. ${m.restored.toLocaleString()} conversations restored; unchanged pages are reused. Clear saved index under Filters. Imported sessions remain saved.`}`}function Be(){if(cancelAnimationFrame(_e),_e=0,Wt!==p&&(Le.clear(),u.replaceChildren(),Wt=p),u.style.height=`${p.length*Y}px`,!p.length){u.innerHTML=`<div class="search-empty">${Pe(F||(k?"Searching…":c.value?"No matching sessions":"No sessions available"))}</div>`,c.removeAttribute("aria-activedescendant");return}const N=Math.max(0,Math.floor(l.scrollTop/Y)-3),_=Math.min(p.length,N+Math.ceil(l.clientHeight/Y)+7);for(const[K,te]of Le)(K<N||K>=_)&&(te.remove(),Le.delete(K));for(let K=N;K<_;K++){let te=Le.get(K);if(!te){const ne=p[K],re=h.get(ne.id);if(!re)continue;const qe=`${Fe(re.source)} · ${y.get(re.projectID)||re.directory.split("/").at(-1)||"Global"} · ${Me.format(re.updated)}`,Ke=document.createElement("template");Ke.innerHTML=`<div id="search-hit-${K}" class="search-result" role="option" aria-posinset="${K+1}" aria-setsize="${w}" data-result-index="${K}" style="top:${K*Y}px"><div class="search-result-title">${Hn(re.title,ne.terms)}</div><div class="search-result-meta"><span>${kn(re.source)}${Pe(qe)}</span><span class="match-kind">${Pe(ne.source)}</span></div>${ne.excerpt?`<div class="search-result-excerpt">${Hn(ne.excerpt,ne.terms)}</div>`:`<div class="search-result-excerpt">${Pe(re.model)}</div>`}</div>`,te=Ke.content.firstElementChild,Le.set(K,te);const ve=[...Le.keys()].filter(Ze=>Ze>K).sort((Ze,rn)=>Ze-rn)[0];u.insertBefore(te,Le.get(ve)??null)}const ae=String(K===v);te.getAttribute("aria-selected")!==ae&&(te.classList.toggle("active",K===v),te.setAttribute("aria-selected",ae))}v>=N&&v<_?c.setAttribute("aria-activedescendant",`search-hit-${v}`):c.removeAttribute("aria-activedescendant")}function jt(){_e||(_e=requestAnimationFrame(Be))}function ot(N,_=!1,K=!1){const te=p[v],ae=te&&h.get(te.id);if(!ae){d.innerHTML="";return}const ne=te.terms.length?te.terms:ni(Mu(c.value).text),re=N?.fragments.filter(ve=>{const Ze=Cn(ve.text);return ne.length&&ne.every(rn=>Ze.includes(rn))}).slice(0,4)||[],qe=N?.fragments.filter(ve=>["You","Assistant"].includes(ve.kind)).slice(0,5).reverse()||[],Ke=re.length?re:qe;if(d.innerHTML=`<div class="search-preview-heading"><span>${Pe(y.get(ae.projectID)||"Session")}</span><h2>${Hn(ae.title,ne)}</h2><p>${Pe(ae.model)} · ${new Date(ae.created).toLocaleDateString()}</p><button class="secondary-button search-open">Explore session <span aria-hidden="true">↗</span></button></div>${te.excerpt?`<section class="search-preview-section"><h3>Matching passage</h3><p>${Hn(te.excerpt,ne)}</p></section>`:""}<section class="search-preview-section"><h3>${re.length?"Matching context":"Recent conversation"}</h3>${_?'<p class="preview-loading">Loading preview…</p>':K?'<p>Preview unavailable.</p><button class="text-button preview-retry">Retry</button>':Ke.length?Ke.map(ve=>`<article><span>${Pe(ve.kind)}</span><p>${Hn(Au(ve.text,ne,360),ne)}</p></article>`).join(""):"<p>No conversation text in this batch.</p>"}${N&&(N.nextCursor||N.truncated)?'<p class="preview-coverage">Recent messages · partial preview</p>':""}</section>`,d.querySelector(".search-open")?.addEventListener("click",z,r),n){const ve=document.createElement("button");ve.className="text-button search-launch",ve.innerHTML=`${kn(ae.source)}Open in ${Pe(Fe(ae.source))}${W("arrow-up-right")}`,ve.addEventListener("click",()=>n(ae),r),d.querySelector(".search-preview-heading")?.append(ve)}d.querySelector(".preview-retry")?.addEventListener("click",()=>{O="",on()},r)}function on(){const N=p[v],_=N&&h.get(N.id),K=_?`${_.id}:${Ji(_)}:${c.value}`:"";if(K===O)return;if(O=K,window.clearTimeout(H),D?.abort(),!_){ot();return}const te=`${_.id}:${Ji(_)}`,ae=j.get(te);if(ae){ot(ae);return}ot(void 0,!0),H=window.setTimeout(async()=>{const ne=new AbortController;D=ne;try{const re=await fetch(`/api/sessiongraph/session/${encodeURIComponent(_.id)}/content?updated=${_.updated}`,{signal:ne.signal});if(!re.ok)throw new Error("Preview unavailable");const qe=await re.json();if(ne.signal.aborted||K!==O)return;j.size>=25&&j.delete(j.keys().next().value),j.set(te,qe),ot(qe)}catch{!ne.signal.aborted&&K===O&&ot(void 0,!1,!0)}},90)}function A(){cancelAnimationFrame(C),k=!0,c.setAttribute("aria-busy","true");const N=++S;E=performance.now(),C=requestAnimationFrame(()=>Ae({type:"query",request:N,text:c.value,viewOnly:g.value==="view",limit:M}))}function x(){v=0,B=!1,M=80,l.scrollTop=0,O="",A()}function I(N){if(!p.length)return;B=!0,v=Math.max(0,Math.min(p.length-1,v+N));const _=v*Y;_<l.scrollTop?l.scrollTop=_:_+Y>l.scrollTop+l.clientHeight&&(l.scrollTop=_+Y-l.clientHeight),Be(),on()}function R(){i.close(),t(!1),D?.abort(),window.clearTimeout(H),O="",$?.focus({preventScroll:!0})}function z(){const N=p[v];!N||k||(R(),e(N.id))}function de(){i.open||($=document.activeElement,i.showModal()),t(!0),c.focus({preventScroll:!0}),c.select(),A(),T&&Ae({type:"warm",enabled:!0})}s.onmessage=N=>{const _=N.data;if(_.type==="status"){m=_.status,Nn();return}if(_.type==="error"){F=_.message,k=!1,c.setAttribute("aria-busy","false"),Be();return}if(_.request!==S)return;const K=p[v]?.id;b=k?performance.now()-E:b,k=!1,c.setAttribute("aria-busy","false"),p=_.hits,w=_.total,F=_.error||"",v=Math.max(0,Math.min(p.length-1,B&&K?p.findIndex(te=>te.id===K):0)),a("#search-result-status").textContent=F||`${w.toLocaleString()} ${c.value?"matches":"sessions"} · ${Math.round(_.elapsed)} ms`,a("#search-more").hidden=p.length>=w||M>=250,i.open&&(Be(),on())},s.onerror=()=>{F="Search could not start. Reload to retry.",k=!1,Be()},c.addEventListener("input",()=>{P||x()},r),c.addEventListener("compositionstart",()=>{P=!0},r),c.addEventListener("compositionend",()=>{P=!1,x()},r),g.addEventListener("change",x,r),l.addEventListener("scroll",jt,{...r,passive:!0}),l.addEventListener("click",N=>{const _=N.target.closest("[data-result-index]");_&&(v=Number(_.dataset.resultIndex),B=!0,Be(),on(),c.focus())},r),l.addEventListener("dblclick",z,r),a("#search-more").addEventListener("click",()=>{M=Math.min(250,M+80),A()},r),a("#search-conversations").addEventListener("click",()=>{T=!T,a("#search-conversations").setAttribute("aria-pressed",String(T)),Ae({type:"warm",enabled:T}),Nn()},r),a("#search-clear-cache").addEventListener("click",()=>{T=!1,a("#search-conversations").setAttribute("aria-pressed","false"),j.clear(),O="",D?.abort(),window.clearTimeout(H),a(".search-syntax").open=!1,Ae({type:"clear-cache"}),c.focus()},r),a(".search-close").addEventListener("click",R,r),i.addEventListener("cancel",N=>{N.preventDefault(),R()},r),i.addEventListener("keydown",N=>{N.stopPropagation(),!(P||N.isComposing)&&((N.key==="ArrowDown"||N.key==="ArrowUp")&&(N.preventDefault(),I(N.key==="ArrowDown"?1:-1)),(N.key==="PageDown"||N.key==="PageUp")&&(N.preventDefault(),I((N.key==="PageDown"?1:-1)*Math.max(1,Math.floor(l.clientHeight/Y)))),N.key==="Enter"&&N.target===c&&(N.preventDefault(),z()),N.key==="Escape"&&(N.preventDefault(),R()),N.key.toLowerCase()==="s"&&N.altKey&&(N.preventDefault(),g.value=g.value==="view"?"all":"view",g.dispatchEvent(new Event("change",{bubbles:!0}))))},r),document.addEventListener("keydown",N=>{if(i.open||document.querySelector("dialog[open]"))return;const _=N.target,K=_.isContentEditable||_.closest('input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), textarea, select');(N.key==="/"&&!K&&!N.ctrlKey&&!N.metaKey&&!N.altKey||N.key.toLowerCase()==="k"&&(N.metaKey||N.ctrlKey))&&(N.preventDefault(),de())},r);const ue=new ResizeObserver(()=>{i.open&&jt()});return ue.observe(l),{open:de,setData(N){f!==N.sourceID&&(j.clear(),O="",D?.abort(),window.clearTimeout(H)),f=N.sourceID,h=new Map(N.sessions.map(_=>[_.id,_])),y=new Map(N.projects.map(_=>[_.id,_.name])),Wt=void 0,Ae({type:"data",sessions:N.sessions,projects:N.projects,sourceID:f})},setScope(N){Ae({type:"scope",ids:N})},diagnostics:()=>({open:i.open,query:c.value,matches:w,renderedRows:u.querySelectorAll('[role="option"]').length,roundTripMs:b,pending:k,index:m}),dispose(){s.terminate(),o.abort(),ue.disconnect(),D?.abort(),window.clearTimeout(H),cancelAnimationFrame(C),cancelAnimationFrame(_e),i.remove()}}}class Bo{values;tree;constructor(t){this.values=Float64Array.from(t),this.tree=new Float64Array(t.length+1);for(let n=1;n<this.tree.length;n++){this.tree[n]+=this.values[n-1];const s=n+(n&-n);s<this.tree.length&&(this.tree[s]+=this.tree[n])}}get length(){return this.values.length}offset(t){let n=0;for(let s=Math.min(t,this.length);s>0;s-=s&-s)n+=this.tree[s];return n}set(t,n){const s=n-this.values[t];if(Math.abs(s)<.1)return!1;this.values[t]=n;for(let o=t+1;o<this.tree.length;o+=o&-o)this.tree[o]+=s;return!0}indexAt(t){let n=0,s=0;for(let o=2**Math.floor(Math.log2(this.length||1));o;o=Math.floor(o/2)){const r=n+o;r<=this.length&&s+this.tree[r]<=t&&(n=r,s+=this.tree[r])}return Math.min(n,Math.max(0,this.length-1))}}class Vu{constructor(t,n){this.viewport=t,this.options=n,this.content.className="virtual-list-content",this.content.style.cssText="position:relative;overflow-anchor:none",t.replaceChildren(this.content),t.addEventListener("scroll",this.schedule,{passive:!0,signal:this.events.signal}),t.addEventListener("focusout",this.schedule,{signal:this.events.signal}),this.observer=new ResizeObserver(()=>{const s=t.clientWidth;s&&this.width&&s!==this.width&&this.resetHeights(),s&&(this.width=s),this.schedule()}),this.observer.observe(t)}viewport;options;items=[];heights=new Bo([]);sizes=new Map;mounted=new Map;content=document.createElement("div");observer;frame=0;width=0;pendingIndex;events=new AbortController;setItems(t,n=!1){const s=this.heights.indexAt(this.viewport.scrollTop),o=this.items[s]===void 0?void 0:this.options.key(this.items[s]),r=this.viewport.scrollTop-this.heights.offset(s);if(this.clearRows(),this.content.parentElement!==this.viewport&&this.viewport.replaceChildren(this.content),!n)this.sizes.clear();else{const i=new Set(t.map(this.options.key));for(const a of this.sizes.keys())i.has(a)||this.sizes.delete(a)}if(this.items=t,this.heights=new Bo(t.map(i=>this.sizes.get(this.options.key(i))??this.options.estimate(i))),this.pendingIndex=void 0,this.content.style.height=`${this.heights.offset(t.length)}px`,!n)this.viewport.scrollTop=0;else if(o!==void 0){const i=t.findIndex(a=>this.options.key(a)===o);i>=0&&(this.viewport.scrollTop=this.heights.offset(i)+r)}this.render()}getElement(t){return this.mounted.get(t)?.element}scrollToIndex(t){t<0||t>=this.items.length||(this.pendingIndex=t,this.render())}resetHeights(){const t=this.heights.indexAt(this.viewport.scrollTop),n=this.viewport.scrollTop-this.heights.offset(t);this.sizes.clear(),this.heights=new Bo(this.items.map(this.options.estimate)),this.content.style.height=`${this.heights.offset(this.items.length)}px`,this.viewport.scrollTop=this.heights.offset(t)+n,this.schedule()}schedule=()=>{this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))};reveal(t){const n=this.heights.offset(t),s=this.heights.offset(t+1);n<this.viewport.scrollTop?this.viewport.scrollTop=n:s>this.viewport.scrollTop+this.viewport.clientHeight&&(this.viewport.scrollTop=s-this.viewport.clientHeight)}render(){if(this.content.style.height=`${this.heights.offset(this.items.length)}px`,!this.items.length||!this.viewport.clientHeight)return;this.pendingIndex!==void 0&&this.reveal(this.pendingIndex);const t=this.viewport.scrollTop,n=this.heights.indexAt(t),s=this.options.overscan??4,o=Math.max(0,n-s),r=Math.min(this.items.length,this.heights.indexAt(t+this.viewport.clientHeight)+s+1);for(const[l,u]of this.mounted)(l<o||l>=r)&&!u.wrapper.contains(document.activeElement)&&(this.observer.unobserve(u.wrapper),u.wrapper.remove(),this.mounted.delete(l));for(let l=o;l<r;l++)if(!this.mounted.has(l)){const u=this.options.render(this.items[l],l),d=document.createElement("div");d.style.cssText="position:absolute;top:0;left:0;width:100%;display:flow-root",d.className="virtual-list-row",d.append(u),this.mounted.set(l,{wrapper:d,element:u});const g=[...this.mounted.keys()].filter(h=>h>l).sort((h,y)=>h-y)[0];this.content.insertBefore(d,this.mounted.get(g)?.wrapper??null),this.observer.observe(d)}const i=[...this.mounted].map(([l,u])=>[l,u.wrapper.getBoundingClientRect().height]),a=this.heights.offset(n);let c=!1;for(const[l,u]of i)u>0&&(this.sizes.set(this.options.key(this.items[l]),u),c=this.heights.set(l,u)||c);for(const[l,u]of this.mounted){const d=`translateY(${this.heights.offset(l)}px)`;u.wrapper.style.transform!==d&&(u.wrapper.style.transform=d)}this.content.style.height=`${this.heights.offset(this.items.length)}px`,c&&(this.viewport.scrollTop+=this.heights.offset(n)-a),this.pendingIndex!==void 0&&(this.reveal(this.pendingIndex),this.pendingIndex=void 0),c&&this.schedule()}clearRows(){for(const t of this.mounted.values())this.observer.unobserve(t.wrapper);this.mounted.clear(),this.content.replaceChildren()}dispose(){cancelAnimationFrame(this.frame),this.events.abort(),this.observer.disconnect(),this.content.remove()}}const Jn=[{id:"opencode",name:"OpenCode",command:"opencode"},{id:"claude-code",name:"Claude Code",command:"claude"},{id:"codex",name:"Codex",command:"codex"},{id:"cursor",name:"Cursor Agent",command:"cursor-agent"},{id:"gemini",name:"Gemini CLI",command:"gemini"},{id:"qwen-code",name:"Qwen Code",command:"qwen"},{id:"pi",name:"Pi",command:"pi"},{id:"copilot",name:"GitHub Copilot CLI",command:"copilot"}],qo=e=>Jn.some(t=>t.id===e),bc=e=>/^ses[a-zA-Z0-9_-]+$/.test(e);function Nu(e,t){if(!bc(t))throw new Error("Invalid session ID.");const n=new URL(e);if(!["http:","https:"].includes(n.protocol)||n.username||n.password)throw new Error("Invalid OpenCode URL.");const s=btoa(String.fromCharCode(...new TextEncoder().encode(n.origin))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`${n.origin}/server/${s}/session/${encodeURIComponent(t)}`}class Tt extends Error{constructor(t,n,s){super(t),this.status=n,this.code=s}status;code}async function Xe(e,t,n,s=fetch){const o=a=>{const c=n?.signal?.reason;return c?.name==="AbortError"?c:new Tt(c?.name==="TimeoutError"?"The request timed out.":t,a)};let r;try{r=await s(e,n)}catch{throw o()}let i;try{i=await r.json()}catch{throw o(r.status)}if(!r.ok){const a=typeof i?.error=="string"&&i.error.trim()&&i.code!=="OPERATION_FAILED"?i.error:t;throw new Tt(a,r.status,typeof i?.code=="string"?i.code:void 0)}if(i===null||typeof i!="object")throw new Tt(t,r.status);return i}var pn=(e,t=[])=>({parts:(...n)=>{if(Fu(t))return pn(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>pn(e,[...t,...n]),omit:(...n)=>pn(e,t.filter(s=>!n.includes(s))),rename:n=>pn(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,s)=>Object.assign(n,{[s]:{selector:[`&[data-scope="${an(e)}"][data-part="${an(s)}"]`,`& [data-scope="${an(e)}"][data-part="${an(s)}"]`].join(", "),attrs:{"data-scope":an(e),"data-part":an(s)}}}),{})}),an=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Fu=e=>e.length===0,Hu=pn("select").parts("label","positioner","trigger","indicator","clearTrigger","item","itemText","itemIndicator","itemGroup","itemGroupLabel","list","content","root","control","valueText"),ke=Hu.build(),Wu=Object.defineProperty,ju=(e,t,n)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t,n)=>ju(e,typeof t!="symbol"?t+"":t,n);function _u(e){return e==null?[]:Array.isArray(e)?e:[e]}var Bu=e=>e[e.length-1],qu=(e,t)=>e.indexOf(t)!==-1,Uu=(e,...t)=>e.concat(t),Gu=(e,...t)=>e.filter(n=>!t.includes(n)),Xi=(e,t)=>qu(e,t)?Gu(e,t):Uu(e,t);function Qi(e,t){return e.reduce((n,s,o)=>(o%t===0?n.push([s]):Bu(n)?.push(s),n),[])}var ea=e=>e?.constructor.name==="Array",Yu=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Mn(e[n],t[n]))return!1;return!0},Mn=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(ea(e)&&ea(t))return Yu(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),s=n.length;if(Object.keys(e).length!==s)return!1;for(let o=0;o<s;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<s;o++){const r=n[o];if(!Mn(e[r],t[r]))return!1}return!0},Ku=e=>Array.isArray(e),wc=e=>e!=null&&typeof e=="object",Uo=e=>wc(e)&&!Ku(e),Zu=e=>typeof e=="string",lt=e=>typeof e=="function",zu=e=>e==null,qs=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ju=e=>Object.prototype.toString.call(e),Cc=Function.prototype.toString,Xu=Cc.call(Object),Xn=e=>{if(!wc(e)||Ju(e)!="[object Object]"||tf(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=qs(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Cc.call(n)==Xu},Qu=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,ef=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,tf=e=>Qu(e)||ef(e),ta=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,nf=e=>e(),kc=()=>{},so=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function Er(e,t,...n){if(e in t){const o=t[e];return lt(o)?o(...n):o}const s=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(s,Er),s}var{min:sf,max:of}=Math,rf=e=>Number.isNaN(e),Ec=e=>rf(e)?0:e,Go=(e,t,n)=>{const s=Ec(e),o=t==null||s>=t,r=n==null||s<=n;return o&&r},af=(e,t,n)=>sf(of(Ec(e),t),n);function si(e){if(!Xn(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(s=>typeof s=="string"),n={};for(const s of t){const o=e[s];o!==void 0&&(n[s]=si(o))}return n}function Sc(e,t){if(!t)return e;const n={...e},s=t;for(const o in s){const r=s[o];r!==void 0&&(n[o]=r)}return n}function Us(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function na(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function Eo(e,t){if(e==null)throw new Error(t())}var Gs={itemToValue(e){return typeof e=="string"?e:Uo(e)&&qs(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:Uo(e)&&qs(e,"label")?e.label:Gs.itemToValue(e)},isItemDisabled(e){return Uo(e)&&qs(e,"disabled")?!!e.disabled:!1}},xc=class $c{constructor(t){q(this,"options",t),q(this,"items"),q(this,"indexMap",null),q(this,"copy",n=>new $c({...this.options,items:n??[...this.items]})),q(this,"isEqual",n=>Mn(this.items,n.items)),q(this,"setItems",n=>this.copy(n)),q(this,"getValues",(n=this.items)=>{const s=[];for(const o of n){const r=this.getItemValue(o);r!=null&&s.push(r)}return s}),q(this,"find",n=>{if(n==null)return null;const s=this.indexOf(n);return s!==-1?this.at(s):null}),q(this,"findMany",n=>{const s=[];for(const o of n){const r=this.find(o);r!=null&&s.push(r)}return s}),q(this,"at",n=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[n]??null;let s=0;const o=this.group();for(const[,r]of o)for(const i of r){if(s===n)return i;s++}return null}),q(this,"sortFn",(n,s)=>{const o=this.indexOf(n),r=this.indexOf(s);return(o??0)-(r??0)}),q(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),q(this,"getItemValue",n=>n==null?null:this.options.itemToValue?.(n)??Gs.itemToValue(n)),q(this,"getItemDisabled",n=>n==null?!1:this.options.isItemDisabled?.(n)??Gs.isItemDisabled(n)),q(this,"stringifyItem",n=>n==null?null:this.options.itemToString?.(n)??Gs.itemToString(n)),q(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),q(this,"stringifyItems",(n,s=", ")=>{const o=[];for(const r of n){const i=this.stringifyItem(r);i!=null&&o.push(i)}return o.join(s)}),q(this,"stringifyMany",(n,s)=>this.stringifyItems(this.findMany(n),s)),q(this,"has",n=>this.indexOf(n)!==-1),q(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),q(this,"group",()=>{const{groupBy:n,groupSort:s}=this.options;if(!n)return[["",[...this.items]]];const o=new Map;this.items.forEach((i,a)=>{const c=n(i,a);o.has(c)||o.set(c,[]),o.get(c).push(i)});let r=Array.from(o.entries());return s&&r.sort(([i],[a])=>{if(typeof s=="function")return s(i,a);if(Array.isArray(s)){const c=s.indexOf(i),l=s.indexOf(a);return c===-1?1:l===-1?-1:c-l}return s==="asc"?i.localeCompare(a):s==="desc"?a.localeCompare(i):0}),r}),q(this,"getNextValue",(n,s=1,o=!1)=>{let r=this.indexOf(n);if(r===-1)return null;for(r=o?Math.min(r+s,this.size-1):r+s;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),q(this,"getPreviousValue",(n,s=1,o=!1)=>{let r=this.indexOf(n);if(r===-1)return null;for(r=o?Math.max(r-s,0):r-s;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),q(this,"indexOf",n=>{if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(s=>this.getItemValue(s)===n);if(!this.indexMap){this.indexMap=new Map;let s=0;const o=this.group();for(const[,r]of o)for(const i of r){const a=this.getItemValue(i);a!=null&&this.indexMap.set(a,s),s++}}return this.indexMap.get(n)??-1}),q(this,"getByText",(n,s)=>{const o=s!=null?this.indexOf(s):-1,r=n.length===1;for(let i=0;i<this.items.length;i++){const a=this.items[(o+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===s)&&!this.getItemDisabled(a)&&cf(this.stringifyItem(a),n))return a}}),q(this,"search",(n,s)=>{const{state:o,currentValue:r,timeout:i=350}=s,a=o.keysSoFar+n,l=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,u=this.getByText(l,r),d=this.getItemValue(u);function g(){clearTimeout(o.timer),o.timer=-1}function h(y){o.keysSoFar=y,g(),y!==""&&(o.timer=+setTimeout(()=>{h(""),g()},i))}return h(a),d}),q(this,"update",(n,s)=>{let o=this.indexOf(n);return o===-1?this:this.copy([...this.items.slice(0,o),s,...this.items.slice(o+1)])}),q(this,"upsert",(n,s,o="append")=>{let r=this.indexOf(n);return r===-1?(o==="append"?this.append:this.prepend)(s):this.copy([...this.items.slice(0,r),s,...this.items.slice(r+1)])}),q(this,"insert",(n,...s)=>this.copy(Wn(this.items,n,...s))),q(this,"insertBefore",(n,...s)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Wn(this.items,o,...s))}),q(this,"insertAfter",(n,...s)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Wn(this.items,o+1,...s))}),q(this,"prepend",(...n)=>this.copy(Wn(this.items,0,...n))),q(this,"append",(...n)=>this.copy(Wn(this.items,this.items.length,...n))),q(this,"filter",n=>{const s=this.items.filter((o,r)=>n(this.stringifyItem(o),r,o));return this.copy(s)}),q(this,"remove",(...n)=>{const s=n.map(o=>typeof o=="string"?o:this.getItemValue(o));return this.copy(this.items.filter(o=>{const r=this.getItemValue(o);return r==null?!1:!s.includes(r)}))}),q(this,"move",(n,s)=>{const o=this.indexOf(n);return o===-1?this:this.copy($s(this.items,[o],s))}),q(this,"moveBefore",(n,...s)=>{let o=this.items.findIndex(i=>this.getItemValue(i)===n);if(o===-1)return this;let r=s.map(i=>this.items.findIndex(a=>this.getItemValue(a)===i)).sort((i,a)=>i-a);return this.copy($s(this.items,r,o))}),q(this,"moveAfter",(n,...s)=>{let o=this.items.findIndex(i=>this.getItemValue(i)===n);if(o===-1)return this;let r=s.map(i=>this.items.findIndex(a=>this.getItemValue(a)===i)).sort((i,a)=>i-a);return this.copy($s(this.items,r,o+1))}),q(this,"reorder",(n,s)=>this.copy($s(this.items,[n],s))),q(this,"compareValue",(n,s)=>{const o=this.indexOf(n),r=this.indexOf(s);return o<r?-1:o>r?1:0}),q(this,"range",(n,s)=>{let o=[],r=n;for(;r!=null;){if(this.find(r)&&o.push(r),r===s)return o;r=this.getNextValue(r)}return[]}),q(this,"getValueRange",(n,s)=>n&&s?this.compareValue(n,s)<=0?this.range(n,s):this.range(s,n):[]),q(this,"toString",()=>{let n="";for(const s of this.items){const o=this.getItemValue(s),r=this.stringifyItem(s),i=this.getItemDisabled(s),a=[o,r,i].filter(Boolean).join(":");n+=a+","}return n}),q(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},cf=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function Wn(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function $s(e,t,n){t=[...t].sort((o,r)=>o-r);const s=t.map(o=>e[o]);for(let o=t.length-1;o>=0;o--)e=[...e.slice(0,t[o]),...e.slice(t[o]+1)];return n=Math.max(0,n-t.filter(o=>o<n).length),[...e.slice(0,n),...s,...e.slice(n)]}function Lc({values:e,collection:t,selectedItemMap:n}){const s=[];for(const o of e){const r=t.find(o)??n.get(o);r!=null&&s.push(r)}return s}function Ic({selectedItemMap:e,values:t,selectedItems:n,collection:s}){const o=new Map(e);for(const i of n){const a=s.getItemValue(i);a!=null&&o.set(a,i)}const r=new Set(t);for(const i of o.keys())r.has(i)||o.delete(i);return o}function Ls({values:e,collection:t,selectedItemMap:n}){const s=Lc({values:e,collection:t,selectedItemMap:n}),o=Ic({selectedItemMap:n,values:e,selectedItems:s,collection:t});return{selectedItems:s,nextSelectedItemMap:o}}function lf({selectedItems:e,collection:t}){return Ic({selectedItemMap:new Map,values:e.map(n=>t.getItemValue(n)).filter(Boolean),selectedItems:e,collection:t})}var oo=e=>new xc(e);oo.empty=()=>new xc({items:[]});var df=Object.defineProperty,uf=(e,t,n)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yo=(e,t,n)=>uf(e,typeof t!="symbol"?t+"":t,n),ff=(e,t)=>e.map((n,s)=>e[(Math.max(t,0)+s)%e.length]),ro=()=>{},So=e=>typeof e=="object"&&e!==null,V=e=>e?"":void 0,be=e=>e?"true":void 0,hf=1,pf=9,gf=11,ye=e=>So(e)&&e.nodeType===hf&&typeof e.nodeName=="string",oi=e=>So(e)&&e.nodeType===pf,mf=e=>So(e)&&e===e.window,Tc=e=>ye(e)?e.localName||"":"#document";function yf(e){return["html","body","#document"].includes(Tc(e))}var Mc=e=>So(e)&&e.nodeType!==void 0,En=e=>Mc(e)&&e.nodeType===gf&&"host"in e,Ac=e=>ye(e)&&e.localName==="input",vf=e=>ye(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Sr(e){if(!e)return!1;const t=e.getRootNode();return xo(t)===e}var bf=/(textarea|select)/;function wf(e){if(e==null||!ye(e))return!1;try{return Ac(e)&&e.selectionStart!=null||bf.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function Sn(e,t){if(!e||!t||!ye(e)||!Mc(t))return!1;if(ye(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&En(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function je(e){return oi(e)?e:mf(e)?e.document:e?.ownerDocument??document}function Cf(e){return je(e).documentElement}function Ce(e){return En(e)?Ce(e.host):oi(e)?e.defaultView??window:ye(e)?e.ownerDocument?.defaultView??window:window}function xo(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function sa(e,t){return!e||e===je(e).body?!1:!t.some(n=>Sn(n,e))}function kf(e){if(Tc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||En(e)&&e.host||Cf(e);return En(t)?t.host:t}function Ef(e){let t;try{if(t=e.getRootNode({composed:!0}),oi(t)||En(t))return t}catch{}return e.ownerDocument??document}var Ko=new WeakMap;function Oc(e){return Ko.has(e)||Ko.set(e,Ce(e).getComputedStyle(e)),Ko.get(e)}var ri=()=>typeof document<"u";function Sf(){return navigator.userAgentData?.platform??navigator.platform}function xf(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var ii=e=>ri()&&e.test(Sf()),$f=e=>ri()&&e.test(xf()),Lf=/^iPhone/i,If=/^iPad/i,Tf=/^Mac/i,Mf=/Android/i,oa=()=>ri()&&!!navigator.maxTouchPoints,Af=()=>ii(Lf),Of=()=>ii(If)||ai()&&navigator.maxTouchPoints>1,Pc=()=>Af()||Of(),ai=()=>ii(Tf),Pf=()=>$f(Mf),Df=new Set(["menu","listbox","dialog","grid","tree","region","application"]),Rf=e=>Df.has(e),Vf=e=>e.getAttribute("aria-controls")?.split(" ")||[];function Nf(e,t){const n=new Set,s=Ef(e),o=r=>{const i=r.querySelectorAll("[aria-controls]");for(const a of i){if(a.getAttribute("aria-expanded")!=="true")continue;const c=Vf(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=s.getElementById(l);if(u){const d=u.getAttribute("role"),g=u.getAttribute("aria-modal")==="true";if(d&&Rf(d)&&!g&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}function Ff(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function bt(e){return Ff(e)?.[0]??e.target}function Hf(e){return ci(e).isComposing||e.keyCode===229}function Wf(e){return e.pointerType===""&&e.isTrusted?!0:Pf()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var jf=e=>e.button===2||ai()&&e.ctrlKey&&e.button===0,_f={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},ra={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function xr(e,t={}){const{dir:n="ltr",orientation:s="horizontal"}=t;let o=e.key;return o=_f[o]??o,n==="rtl"&&s==="horizontal"&&o in ra&&(o=ra[o]),o}function ci(e){return e.nativeEvent??e}var Ys=(e,t,n,s)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,s),()=>{o?.removeEventListener(t,n,s)}};function Bf(e,t){const{type:n="HTMLInputElement",property:s="value"}=t,o=Ce(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,s)??{}}function qf(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Is(e,t,n="value"){if(!e)return;const s=qf(e);s&&Bf(e,{type:s,property:n}).set?.call(e,t),e.setAttribute(n,t)}function Uf(e){return e.matches("textarea, input, select, button")}function Gf(e,t){if(!e)return;const n=Uf(e)?e.form:e.closest("form"),s=o=>{o.defaultPrevented||t()};return n?.addEventListener("reset",s,{passive:!0}),()=>n?.removeEventListener("reset",s)}function Yf(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const s=Ce(n),o=new s.MutationObserver(()=>t(n.disabled));return o.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function Kf(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:s}=t,o=[Gf(e,s),Yf(e,n)];return()=>o.forEach(r=>r?.())}var Dc=Symbol.for("zag.changeEvent");function Rc(e){return Object.prototype.hasOwnProperty.call(e,Dc)}function Zf(e){return Rc(e)||Object.defineProperty(e,Dc,{value:!0}),e}var zf=e=>ye(e)&&e.tagName==="IFRAME";function Jf(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var Xf=e=>Jf(e)<0;function Qf(e){return Ac(e)&&e.type==="radio"}function eh(e){if(!Qf(e)||!e.name||e.checked)return!0;const t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,s=Array.from(n.querySelectorAll(t)).filter(r=>r.form===e.form&&$o(r)),o=s.find(r=>r.checked);return o?o===e:s[0]===e}function th(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function nh(e,t,n){const s=[...e],o=[...e],r=new Set,i=new Map;e.forEach((c,l)=>i.set(c,l));let a=0;for(;a<o.length;){const c=o[a++];if(!c||r.has(c))continue;r.add(c);const l=th(c,t);if(l){const u=Array.from(l.querySelectorAll(li)).filter(n),d=i.get(c);if(d!==void 0){const g=d+1;s.splice(g,0,...u),u.forEach((h,y)=>{i.set(h,g+y)});for(let h=g+u.length;h<s.length;h++)i.set(s[h],h)}else{const g=s.length;s.push(...u),u.forEach((h,y)=>{i.set(h,g+y)})}o.push(...u)}}return s}var li="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function $o(e){return!ye(e)||e.closest("[inert]")?!1:e.matches(li)&&vf(e)}function di(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:s}=t,o=Array.from(e.querySelectorAll(li));n&&Zo(e)&&o.unshift(e);const r=[];for(const i of o)if(Zo(i)){if(zf(i)&&i.contentDocument){const a=i.contentDocument.body;r.push(...di(a,{getShadowRoot:s}));continue}r.push(i)}if(s){const i=nh(r,s,Zo);return!i.length&&n?o:i}return!r.length&&n?o:r}function Zo(e){return ye(e)&&e.tabIndex>0?!0:!$o(e)||Xf(e)?!1:eh(e)}function sh(e,t={}){const n=di(e,t),s=n[0]||null,o=n[n.length-1]||null;return[s,o]}function oh(e){const{root:t,getInitialEl:n,filter:s,enabled:o=!0}=e;if(!o)return!1;let r=typeof n=="function"?n():n;return r===!1?!1:(r||(r=t?.matches("[data-autofocus],[autofocus]")?t:t?.querySelector("[data-autofocus],[autofocus]")),r||(r=di(t).filter(a=>s?s(a):!0).find(a=>!a.hasAttribute("data-no-autofocus"))),r||t||void 0)}function rh(e){const t=e.currentTarget;if(!t)return!1;const[n,s]=sh(t);return!(Sr(n)&&e.shiftKey||Sr(s)&&!e.shiftKey||!n&&!s)}var Vc=class Nc{constructor(){Yo(this,"id",null),Yo(this,"fn_cleanup"),Yo(this,"cleanup",()=>{this.cancel()})}static create(){return new Nc}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function we(e){const t=Vc.create();return t.request(e),t.cleanup}function Fc(e){const t=new Set;function n(s){const o=globalThis.requestAnimationFrame(s);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}var zo=new WeakMap;function ih(e){const t={childList:!0,subtree:!0,attributes:e.attributes??(e.attributeOldValue!==void 0||e.attributeFilter!==void 0),characterData:e.characterData??e.characterDataOldValue!==void 0,attributeOldValue:!!e.attributeOldValue,characterDataOldValue:!!e.characterDataOldValue};return e.attributeFilter!==void 0&&(t.attributeFilter=[...new Set(e.attributeFilter)].sort()),t}function ah(e){const t=ih(e),n=JSON.stringify(t);return{observe(s,o){const r=Ce(s);if(typeof r.MutationObserver!="function")return ro;const i=zo.get(s)??new Map;let a=i.get(n);if(!a){const l=new Set,u=new r.MutationObserver(d=>{for(const g of[...l])if(l.has(g))try{g(d)}catch(h){r.queueMicrotask(()=>{throw h})}});u.observe(s,t),a={observer:u,listeners:l},i.set(n,a),zo.set(s,i)}const c=l=>o(l);return a.listeners.add(c),()=>{!a.listeners.delete(c)||a.listeners.size>0||(a.observer.disconnect(),i.delete(n),i.size===0&&zo.delete(s))}}}}function ch(e,t){if(!e)return;const{attributes:n,callback:s}=t,o=e.ownerDocument.defaultView||window,r=new o.MutationObserver(i=>{for(const a of i)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&s(a)});return r.observe(e,{attributes:!0,attributeFilter:n}),()=>r.disconnect()}function lh(e,t){const n=we,s=[];return s.push(n(()=>{const o=typeof e=="function"?e():e;s.push(ch(o,t))})),()=>{s.forEach(o=>o?.())}}function $r(e){const t=kf(e);return yf(t)?je(t).body:ye(t)&&fh(t)?t:$r(t)}var dh=/auto|scroll|overlay|hidden|clip/,uh=new Set(["inline","contents"]);function fh(e){const t=Ce(e),{overflow:n,overflowX:s,overflowY:o,display:r}=t.getComputedStyle(e);return dh.test(n+o+s)&&!uh.has(r)}var ia=/auto|scroll|overlay|hidden/;function hh(e,t={}){const{axis:n}=t,{overflowX:s,overflowY:o}=Ce(e).getComputedStyle(e),r=n!=="y"&&ia.test(s)&&e.scrollWidth>e.clientWidth,i=n!=="x"&&ia.test(o)&&e.scrollHeight>e.clientHeight;return r||i}var gn="default",Lr="",Ks=new WeakMap;function ph(e={}){const{target:t,doc:n}=e,s=n??document,o=s.documentElement;return Pc()?(gn==="default"&&(Lr=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),gn="disabled"):t&&(Ks.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Hc({target:t,doc:s})}function Hc(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(Pc()){if(gn!=="disabled")return;gn="restoring",setTimeout(()=>{Fc(()=>{gn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=Lr||""),Lr="",gn="default")})},300)}else if(t&&Ks.has(t)){const r=Ks.get(t);t.style.userSelect==="none"&&(t.style.userSelect=r??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Ks.delete(t)}}function gh(e={}){const{defer:t,target:n,...s}=e,o=t?we:i=>i(),r=[];return r.push(o(()=>{const i=typeof n=="function"?n():n;r.push(ph({...s,target:i}))})),()=>{r.forEach(i=>i?.())}}function mh(e,t){return Array.from(e?.querySelectorAll(t)??[])}function yh(e,t){return e?.querySelector(t)??null}var ui=e=>e.id;function vh(e,t,n=ui){return e.find(s=>n(s)===t)}function bh(e,t,n=ui){const s=vh(e,t,n);return s?e.indexOf(s):-1}function wh(e,t){const{rootEl:n,...s}=t||{};!e||!n||hh(n)&&e.scrollIntoView(s)}var aa,Ch=()=>aa??(aa=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),kh=e=>e.normalize("NFC").trim(),Eh=e=>kh(e.dataset?.valuetext??e.textContent??""),Sh=(e,t)=>{const n=t.normalize("NFC");return Ch().compare(e.slice(0,n.length),n)===0};function xh(e,t,n,s=ui){const o=n?bh(e,n,s):-1;let r=n?ff(e,o):e;return t.length===1&&(r=r.filter(a=>s(a)!==n)),r.find(a=>Sh(Eh(a),t))}function $h(e,t){if(!e)return ro;const n=Object.keys(t).reduce((s,o)=>(s[o]=e.style.getPropertyValue(o),s),{});return Lh(n,t)?ro:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function Lh(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function Ih(e,t){const{state:n,activeId:s,key:o,timeout:r=350,itemToId:i}=t,a=n.keysSoFar+o,l=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a;let u=e.slice();const d=xh(u,l,s,i);function g(){clearTimeout(n.timer),n.timer=-1}function h(y){n.keysSoFar=y,g(),y!==""&&(n.timer=+setTimeout(()=>{h(""),g()},r))}return h(a),d}var Ir=Object.assign(Ih,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:Th});function Th(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Mh={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 Ah(e,t,n){const{signal:s}=t;return[new Promise((i,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);s.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{s.aborted||(clearTimeout(c),i(l))}).catch(l=>{s.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function Oh(e,t){const{timeout:n,rootNode:s}=t,o=Ce(s),r=je(s),i=new o.AbortController;let a;const c=Ah(new Promise(u=>{const d=e();if(d){u(d);return}a=new o.MutationObserver(()=>{const g=e();g&&g.isConnected&&(a?.disconnect(),u(g))}),a.observe(r.body,{childList:!0,subtree:!0})}),i,n),l=()=>a?.disconnect();return c[0].then(l,l),c}var Ph=ah({});function Dh(e,t,n={}){const{defer:s,onMissing:o,getRootNode:r}=n,i=()=>typeof e=="function"?e():e,a=[],c=l=>{if(!l)return o?.();a.push(t(l))};if(!s)c(i());else{let l=!1;a.push(()=>{l=!0}),queueMicrotask(()=>{if(l)return;const u=i();if(u){c(u);return}let d=!1;const g=p=>{l||d||(d=!0,y(),f(),c(p))},h=r?.(),y=h?Ph.observe(h,()=>{const p=i();p&&g(p)}):ro,f=we(()=>g(i()));a.push(y,f)})}return()=>{a.forEach(l=>l?.())}}function Rh(e){return!(e.metaKey||!ai()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Vh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Nh=["a[href]","audio[controls]","button","details","embed","iframe","img[controls]","img[usemap]","input","select","textarea","video[controls]"].join(",");function Fh(e,t,n){const s=n?bt(n):null,o=je(s),r=Ce(s),i=xo(o);return e=e||i instanceof r.HTMLInputElement&&!Vh.has(i?.type)||i instanceof r.HTMLTextAreaElement||i instanceof r.HTMLElement&&i.isContentEditable,!(e&&t==="keyboard"&&n instanceof r.KeyboardEvent&&!Reflect.has(Wh,n.key))}var wt=null,Tr=new Set,io=new Map,zt=!1,Mt=null,Mr=!1,Jo=null,Hh=!1,Wh={Tab:!0,Escape:!0};function Lo(e,t){for(let n of Tr)n(e,t)}function ao(e){Mt=null,zt=!0,Rh(e)&&(wt="keyboard",Lo("keyboard",e))}function De(e){(e.type==="pointermove"||e.type==="mousemove")&&e.isTrusted&&Jo?.x===e.clientX&&Jo?.y===e.clientY||(Jo={x:e.clientX,y:e.clientY},wt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Mt=null,zt=!0,Lo("pointer",e)))}function Wc(e){if(Wf(e)){Mt=null,zt=!0,wt="virtual";return}Mt=null;const t=bt(e),n=t?.closest("label"),s=n?.control;if(!n||!s||s.matches(":disabled"))return;const o=t?.closest(Nh);o&&n.contains(o)&&o!==s||s!==xo(n.ownerDocument)&&(Mt=s)}function jc(e){const t=bt(e),n=t===Mt;t===Ce(t)||t===je(t)||Hh||!e.isTrusted||(!zt&&!n&&!Mr&&(wt="virtual",Lo("virtual",e)),zt=!1,Mt=null,Mr=!1)}function _c(){zt=!1,Mt=null,Mr=!0}function jh(e){try{return e.focus}catch{return}}function _h(e){const t=e.HTMLElement.prototype;try{let s=function(){zt=!0,(o??i.call(this)).apply(this,arguments)};var n=s;const o=jh(t),r=o?void 0:Object.getOwnPropertyDescriptor(t,"focus"),i=r?.get;return!o&&!i?{focus:void 0}:(Object.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:s}),{focus:o,descriptor:r})}catch{return{focus:void 0}}}function Bh(e){if(typeof window>"u"||io.get(Ce(e)))return;const t=Ce(e),n=je(e),s=_h(t);n.addEventListener("keydown",ao,!0),n.addEventListener("keyup",ao,!0),n.addEventListener("click",Wc,!0),t.addEventListener("focus",jc,!0),t.addEventListener("blur",_c,!1),typeof t.PointerEvent<"u"?(n.addEventListener("pointerdown",De,!0),n.addEventListener("pointermove",De,!0),n.addEventListener("pointerup",De,!0)):(n.addEventListener("mousedown",De,!0),n.addEventListener("mousemove",De,!0),n.addEventListener("mouseup",De,!0)),t.addEventListener("beforeunload",()=>{qh(e)},{once:!0}),io.set(t,s)}var qh=(e,t)=>{const n=Ce(e),s=je(e),o=io.get(n);if(o){if(o.focus||o.descriptor)try{Object.defineProperty(n.HTMLElement.prototype,"focus",o.descriptor??{configurable:!0,writable:!0,value:o.focus})}catch{}s.removeEventListener("keydown",ao,!0),s.removeEventListener("keyup",ao,!0),s.removeEventListener("click",Wc,!0),n.removeEventListener("focus",jc,!0),n.removeEventListener("blur",_c,!1),typeof n.PointerEvent<"u"?(s.removeEventListener("pointerdown",De,!0),s.removeEventListener("pointermove",De,!0),s.removeEventListener("pointerup",De,!0)):(s.removeEventListener("mousedown",De,!0),s.removeEventListener("mousemove",De,!0),s.removeEventListener("mouseup",De,!0)),io.delete(n)}};function Ar(){return wt}function Uh(e){wt=e,Lo(e,null)}function ca(){return wt==="keyboard"||wt==="virtual"}function Gh(e={}){const{isTextInput:t,autoFocus:n,onChange:s,root:o}=e;Bh(o),s?.({isFocusVisible:n||ca(),modality:wt});const r=(i,a)=>{Fh(!!t,i,a)&&s?.({isFocusVisible:ca(),modality:i})};return Tr.add(r),()=>{Tr.delete(r)}}const Yh=["top","right","bottom","left"],Ot=Math.min,mt=Math.max,co=Math.round,Ts=Math.floor,yt=e=>({x:e,y:e}),Kh={left:"right",right:"left",bottom:"top",top:"bottom"};function Bc(e,t,n){return mt(e,Ot(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function Pt(e){return e.split("-")[0]}function An(e){return e.split("-")[1]}function fi(e){return e==="x"?"y":"x"}function hi(e){return e==="y"?"height":"width"}function Je(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function pi(e){return fi(Je(e))}function Zh(e,t,n){n===void 0&&(n=!1);const s=An(e),o=pi(e),r=hi(o);let i=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=lo(i)),[i,lo(i)]}function zh(e){const t=lo(e);return[Or(e),t,Or(t)]}function Or(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const la=["left","right"],da=["right","left"],Jh=["top","bottom"],Xh=["bottom","top"];function Qh(e,t,n){switch(e){case"top":case"bottom":return n?t?da:la:t?la:da;case"left":case"right":return t?Jh:Xh;default:return[]}}function ep(e,t,n,s){const o=An(e);let r=Qh(Pt(e),n==="start",s);return o&&(r=r.map(i=>i+"-"+o),t&&(r=r.concat(r.map(Or)))),r}function lo(e){const t=Pt(e);return Kh[t]+e.slice(t.length)}function tp(e){var t,n,s,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(o=e.left)!=null?o:0}}function qc(e){return typeof e!="number"?tp(e):{top:e,right:e,bottom:e,left:e}}function uo(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function ua(e,t,n){let{reference:s,floating:o}=e;const r=Je(t),i=pi(t),a=hi(i),c=Pt(t),l=r==="y",u=s.x+s.width/2-o.width/2,d=s.y+s.height/2-o.height/2,g=s[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:s.y-o.height};break;case"bottom":h={x:u,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:d};break;case"left":h={x:s.x-o.width,y:d};break;default:h={x:s.x,y:s.y}}const y=An(t);return y&&(h[i]+=g*(y==="end"?1:-1)*(n&&l?-1:1)),h}async function np(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:r,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=Ct(t,e),y=qc(h),p=a[g?d==="floating"?"reference":"floating":d],v=uo(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(p)))==null||n?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:s,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),M=await(r.isElement==null?void 0:r.isElement(S))&&await(r.getScale==null?void 0:r.getScale(S))||{x:1,y:1},C=uo(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:S,strategy:c}):w);return{top:(v.top-C.top+y.top)/M.y,bottom:(C.bottom-v.bottom+y.bottom)/M.y,left:(v.left-C.left+y.left)/M.x,right:(C.right-v.right+y.right)/M.x}}const sp=50,op=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:r=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:np},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ua(l,s,c),g=s,h=0;const y={};for(let f=0;f<r.length;f++){const p=r[f];if(!p)continue;const{name:v,fn:w}=p,{x:S,y:M,data:C,reset:E}=await w({x:u,y:d,initialPlacement:s,placement:g,strategy:o,middlewareData:y,rects:l,platform:a,elements:{reference:e,floating:t}});u=S??u,d=M??d,y[v]={...y[v],...C},E&&h<sp&&(h++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(l=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=ua(l,g,c)),f=-1)}return{x:u,y:d,placement:g,strategy:o,middlewareData:y}},rp=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:r,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Ct(e,t)||{};if(l==null)return{};const d=qc(u),g={x:n,y:s},h=pi(o),y=hi(h),f=await i.getDimensions(l),p=h==="y",v=p?"top":"left",w=p?"bottom":"right",S=p?"clientHeight":"clientWidth",M=r.reference[y]+r.reference[h]-g[h]-r.floating[y],C=g[h]-r.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let b=E?E[S]:0;(!b||!await(i.isElement==null?void 0:i.isElement(E)))&&(b=a.floating[S]||r.floating[y]);const k=M/2-C/2,P=b/2-f[y]/2-1,T=Ot(d[v],P),m=Ot(d[w],P),$=b-f[y]-m,D=b/2-f[y]/2+k,H=Bc(T,D,$),O=!c.arrow&&An(o)!=null&&D!==H&&r.reference[y]/2-(D<T?T:m)-f[y]/2<0,F=O?D<T?D-T:D-$:0;return{[h]:g[h]+F,data:{[h]:H,centerOffset:D-H-F,...O&&{alignmentOffset:F}},reset:O}}}),ip=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:r,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:f=!0,...p}=Ct(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const v=Pt(o),w=Je(a),S=Pt(a)===a,M=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=g||(S||!f?[lo(a)]:zh(a)),E=y!=="none";!g&&E&&C.push(...ep(a,f,y,M));const b=[a,...C],k=await c.detectOverflow(t,p),P=[];let T=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&P.push(k[v]),d){const H=Zh(o,i,M);P.push(k[H[0]],k[H[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(H=>H<=0)){var m,$;const H=(((m=r.flip)==null?void 0:m.index)||0)+1,O=b[H];if(O&&(!(d==="alignment"?w!==Je(O):!1)||T.every(j=>Je(j.placement)===w?j.overflows[0]>0:!0)))return{data:{index:H,overflows:T},reset:{placement:O}};let F=($=T.filter(B=>B.overflows[0]<=0).sort((B,j)=>B.overflows[1]-j.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(h){case"bestFit":{var D;const B=(D=T.filter(j=>{if(E){const Y=Je(j.placement);return Y===w||Y==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(Y=>Y>0).reduce((Y,Me)=>Y+Me,0)]).sort((j,Y)=>j[1]-Y[1])[0])==null?void 0:D[0];B&&(F=B);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function fa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ha(e){return Yh.some(t=>e[t]>=0)}const ap=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:o="referenceHidden",...r}=Ct(e,t);switch(o){case"referenceHidden":{const i=await s.detectOverflow(t,{...r,elementContext:"reference"}),a=fa(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ha(a)}}}case"escaped":{const i=await s.detectOverflow(t,{...r,altBoundary:!0}),a=fa(i,n.floating);return{data:{escapedOffsets:a,escaped:ha(a)}}}default:return{}}}}},Uc=new Set(["left","top"]);async function cp(e,t){const{placement:n,platform:s,elements:o}=e,r=await(s.isRTL==null?void 0:s.isRTL(o.floating)),i=Pt(n),a=An(n),c=Je(n)==="y",l=Uc.has(i)?-1:1,u=r&&c?-1:1,d=Ct(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),c?{x:h*u,y:g*l}:{x:g*l,y:h*u}}const lp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:r,placement:i,middlewareData:a}=t,c=await cp(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:{...c,placement:i}}}}},dp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o,platform:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:S,y:M}=w;return{x:S,y:M}}},...l}=Ct(e,t),u={x:n,y:s},d=await r.detectOverflow(t,l),g=Je(o),h=fi(g);let y=u[h],f=u[g];const p=(w,S)=>Bc(S+d[w==="y"?"top":"left"],S,S-d[w==="y"?"bottom":"right"]);i&&(y=p(h,y)),a&&(f=p(g,f));const v=c.fn({...t,[h]:y,[g]:f});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:i,[g]:a}}}}}},up=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,s;const{x:o,y:r,placement:i,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Ct(e,t),g={x:o,y:r},h=Je(i),y=fi(h);let f=g[y],p=g[h];const v=Ct(l,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(s=v.crossAxis)!=null?s:0};if(u){const C=y==="y"?"height":"width",E=a.reference[y]-a.floating[C]+w.mainAxis,b=a.reference[y]+a.reference[C]-w.mainAxis;f<E?f=E:f>b&&(f=b)}if(d){var S,M;const C=y==="y"?"width":"height",E=Uc.has(Pt(i)),b=a.reference[h]-a.floating[C]+(E&&((S=c.offset)==null?void 0:S[h])||0)+(E?0:w.crossAxis),k=a.reference[h]+a.reference[C]+(E?0:((M=c.offset)==null?void 0:M[h])||0)-(E?w.crossAxis:0);p<b?p=b:p>k&&(p=k)}return{[y]:f,[h]:p}}}},fp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:s,platform:o,elements:r}=t,{apply:i=()=>{},...a}=Ct(e,t),c=await o.detectOverflow(t,a),l=Pt(n),u=An(n),d=Je(n)==="y",{width:g,height:h}=s.floating;let y,f;l==="top"||l==="bottom"?(y=l,f=u===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(f=l,y=u==="end"?"top":"bottom");const p=h-c.top-c.bottom,v=g-c.left-c.right,w=Ot(h-c[y],p),S=Ot(g-c[f],v),M=t.middlewareData.shift,C=!M;let E=w,b=S;M!=null&&M.enabled.x&&(b=v),M!=null&&M.enabled.y&&(E=p),C&&!u&&(d?b=g-2*mt(c.left,c.right):E=h-2*mt(c.top,c.bottom)),await i({...t,availableWidth:b,availableHeight:E});const k=await o.getDimensions(r.floating);return g!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function On(e){return Gc(e)?(e.nodeName||"").toLowerCase():"#document"}function $e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function St(e){var t;return(t=(Gc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gc(e){return Io()?e instanceof Node||e instanceof $e(e).Node:!1}function nt(e){return Io()?e instanceof Element||e instanceof $e(e).Element:!1}function Nt(e){return Io()?e instanceof HTMLElement||e instanceof $e(e).HTMLElement:!1}function pa(e){return!Io()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof $e(e).ShadowRoot}function To(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&o!=="inline"&&o!=="contents"}function hp(e){return/^(table|td|th)$/.test(On(e))}function Mo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const pp=/transform|translate|scale|rotate|perspective|filter/,gp=/paint|layout|strict|content/,Bt=e=>!!e&&e!=="none";let Xo;function gi(e){const t=nt(e)?st(e):e;return Bt(t.transform)||Bt(t.translate)||Bt(t.scale)||Bt(t.rotate)||Bt(t.perspective)||!mi()&&(Bt(t.backdropFilter)||Bt(t.filter))||pp.test(t.willChange||"")||gp.test(t.contain||"")}function mp(e){let t=Jt(e);for(;Nt(t)&&!us(t);){if(gi(t))return t;if(Mo(t))return null;t=Jt(t)}return null}function mi(){return Xo==null&&(Xo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xo}function us(e){return/^(html|body|#document)$/.test(On(e))}function st(e){return $e(e).getComputedStyle(e)}function Ao(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(On(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pa(e)&&e.host||St(e);return pa(t)?t.host:t}function Yc(e){const t=Jt(e);return us(t)?(e.ownerDocument||e).body:Nt(t)&&To(t)?t:Yc(t)}function fs(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yc(e),r=o===((s=e.ownerDocument)==null?void 0:s.body),i=$e(o);if(r){const a=Pr(i);return t.concat(i,i.visualViewport||[],To(o)?o:[],a&&n?fs(a):[])}else return t.concat(o,fs(o,[],n))}function Pr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Kc(e){const t=st(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Nt(e),r=o?e.offsetWidth:n,i=o?e.offsetHeight:s,a=co(n)!==r||co(s)!==i;return a&&(n=r,s=i),{width:n,height:s,$:a}}function yi(e){return nt(e)?e:e.contextElement}function yn(e){const t=yi(e);if(!Nt(t))return yt(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:r}=Kc(t);let i=(r?co(n.width):n.width)/s,a=(r?co(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const yp=yt(0);function Zc(e){const t=$e(e);return!mi()||!t.visualViewport?yp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vp(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$e(e)}function Xt(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=yi(e);let i=yt(1);t&&(s?nt(s)&&(i=yn(s)):i=yn(e));const a=vp(r,n,s)?Zc(r):yt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(r&&s){const g=$e(r),h=nt(s)?$e(s):s;let y=g,f=Pr(y);for(;f&&h!==y;){const p=yn(f),v=f.getBoundingClientRect(),w=st(f),S=v.left+(f.clientLeft+parseFloat(w.paddingLeft))*p.x,M=v.top+(f.clientTop+parseFloat(w.paddingTop))*p.y;c*=p.x,l*=p.y,u*=p.x,d*=p.y,c+=S,l+=M,y=$e(f),f=Pr(y)}}return uo({width:u,height:d,x:c,y:l})}function Oo(e,t){const n=Ao(e).scrollLeft;return t?t.left+n:Xt(St(e)).left+n}function zc(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Oo(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function bp(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const r=o==="fixed",i=St(s),a=t?Mo(t.floating):!1;if(s===i||a&&r)return n;let c={scrollLeft:0,scrollTop:0},l=yt(1);const u=yt(0),d=Nt(s);if((d||!r)&&((On(s)!=="body"||To(i))&&(c=Ao(s)),d)){const h=Xt(s);l=yn(s),u.x=h.x+s.clientLeft,u.y=h.y+s.clientTop}const g=i&&!d&&!r?zc(i,c):yt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+g.x,y:n.y*l.y-c.scrollTop*l.y+u.y+g.y}}function wp(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Cp(e){const t=Ao(e),n=e.ownerDocument.body,s=mt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=mt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-t.scrollLeft+Oo(e);const i=-t.scrollTop;return st(n).direction==="rtl"&&(r+=mt(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:i}}const kp=25;function Ep(e,t,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",o=$e(e),r=St(e),i=o.visualViewport;let a=r.clientWidth,c=r.clientHeight,l=0,u=0;if(i){const g=!mi()||t==="fixed";s?g||(l=-i.offsetLeft,u=-i.offsetTop):(a=i.width,c=i.height,g&&(l=i.offsetLeft,u=i.offsetTop))}if(Oo(r)<=0){const g=r.ownerDocument,h=g.body,y=getComputedStyle(h),f=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,p=Math.abs(r.clientWidth-h.clientWidth-f),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?p/2:p;v<=kp&&(a-=v)}return{width:a,height:c,x:l,y:u}}function Sp(e,t){const n=Xt(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,r=yn(e),i=e.clientWidth*r.x,a=e.clientHeight*r.y,c=o*r.x,l=s*r.y;return{width:i,height:a,x:c,y:l}}function ga(e,t,n){let s;if(t==="viewport"||t==="layoutViewport")s=Ep(e,n,t);else if(t==="document")s=Cp(St(e));else if(nt(t))s=Sp(t,n);else{const o=Zc(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return uo(s)}function xp(e,t){const n=t.get(e);if(n)return n;let s=fs(e,[],!1).filter(a=>nt(a)&&On(a)!=="body"),o=null;const r=st(e).position==="fixed";let i=r?Jt(e):e;for(;nt(i)&&!us(i);){const a=st(i),c=gi(i),l=o?o.position:r?"fixed":"";!c&&(l==="fixed"||l==="absolute"&&a.position==="static")?s=s.filter(d=>d!==i):o=a,i=Jt(i)}return t.set(e,s),s}function $p(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const i=[...n==="clippingAncestors"?Mo(t)?[]:xp(t,this._c):[].concat(n),s],a=ga(t,i[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let g=1;g<i.length;g++){const h=ga(t,i[g],o);c=mt(h.top,c),l=Ot(h.right,l),u=Ot(h.bottom,u),d=mt(h.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function Lp(e){const{width:t,height:n}=Kc(e);return{width:t,height:n}}function Ip(e,t,n){const s=Nt(t),o=St(t),r=n==="fixed",i=Xt(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const c=yt(0);if((s||!r)&&((On(t)!=="body"||To(o))&&(a=Ao(t)),s)){const g=Xt(t,!0,r,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}!s&&o&&(c.x=Oo(o));const l=o&&!s&&!r?zc(o,a):yt(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function Qo(e){return st(e).position==="static"}function ma(e,t){if(!Nt(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return St(e)===n&&(n=n.ownerDocument.body),n}function Jc(e,t){const n=$e(e);if(Mo(e))return n;if(!Nt(e)){let o=Jt(e);for(;o&&!us(o);){if(nt(o)&&!Qo(o))return o;o=Jt(o)}return n}let s=ma(e,t);for(;s&&hp(s)&&Qo(s);)s=ma(s,t);return s&&us(s)&&Qo(s)&&!gi(s)?n:s||mp(e)||n}const Tp=async function(e){const t=this.getOffsetParent||Jc,n=this.getDimensions,s=await n(e.floating);return{reference:Ip(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Mp(e){return st(e).direction==="rtl"}const Ap={convertOffsetParentRelativeRectToViewportRelativeRect:bp,getDocumentElement:St,getClippingRect:$p,getOffsetParent:Jc,getElementRects:Tp,getClientRects:wp,getDimensions:Lp,getScale:yn,isElement:nt,isRTL:Mp};function Xc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Op(e,t,n){let s=null,o;const r=St(e);function i(){var u;clearTimeout(o),(u=s)==null||u.disconnect(),s=null}function a(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const g=e.getBoundingClientRect(),{left:h,top:y,width:f,height:p}=g;if(u||t(),!f||!p)return;const v=Ts(y),w=Ts(r.clientWidth-(h+f)),S=Ts(r.clientHeight-(y+p)),M=Ts(h),E={rootMargin:-v+"px "+-w+"px "+-S+"px "+-M+"px",threshold:mt(0,Ot(1,d))||1};let b=!0;function k(P){const T=P[0].intersectionRatio;if(!Xc(g,e.getBoundingClientRect()))return a();if(T!==d){if(!b)return a();T?a(!1,T):o=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{s=new IntersectionObserver(k,{...E,root:r.ownerDocument})}catch{s=new IntersectionObserver(k,E)}s.observe(e)}const c=$e(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),i()}}function Pp(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=yi(e),u=o||r?[...l?fs(l):[],...t?fs(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});const d=l&&a?Op(l,n,r):null;let g=-1,h=null;i&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),l&&!c&&h.observe(l),t&&h.observe(t));let y,f=c?Xt(e):null;c&&p();function p(){const v=Xt(e);f&&!Xc(f,v)&&n(),f=v,y=requestAnimationFrame(p)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(y)}}const Dp=lp,Rp=dp,Vp=ip,Np=fp,Fp=ap,Hp=rp,Wp=up,jp=(e,t,n)=>{const s=new Map,o=n??{},r={...Ap,...o.platform,_c:s};return op(e,t,{...o,platform:r})};function ya(e=0,t=0,n=0,s=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,s);const o={x:e,y:t,width:n,height:s,top:t,right:e+n,bottom:t+s,left:e};return{...o,toJSON:()=>o}}function _p(e){if(!e)return ya();const{x:t,y:n,width:s,height:o}=e;return ya(t,n,s,o)}function Bp(e,t){return{contextElement:ye(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,s=t?.(n);return s||!n?_p(s):n.getBoundingClientRect()}}}var jn=e=>({variable:e,reference:`var(${e})`}),dt={arrowSize:jn("--arrow-size"),arrowSizeHalf:jn("--arrow-size-half"),arrowBg:jn("--arrow-background"),transformOrigin:jn("--transform-origin"),arrowOffset:jn("--arrow-offset")},qp=e=>e==="top"||e==="bottom"?"y":"x";function Up(e,t){return{name:"transformOrigin",fn(n){const{elements:s,middlewareData:o,placement:r,rects:i,y:a}=n,c=r.split("-")[0],l=qp(c),u=o.arrow?.x||0,d=o.arrow?.y||0,g=t?.clientWidth||0,h=t?.clientHeight||0,y=u+g/2,f=d+h/2,p=Math.abs(o.shift?.y||0),v=i.reference.height/2,w=h/2,S=e.offset?.mainAxis??e.gutter,M=typeof S=="number"?S+w:S??w,C=p>M,E={top:`${y}px calc(100% + ${M}px)`,bottom:`${y}px ${-M}px`,left:`calc(100% + ${M}px) ${f}px`,right:`${-M}px ${f}px`}[c],b=`${y}px ${i.reference.y+v-a}px`,k=!!e.overlap&&l==="y"&&C;return s.floating.style.setProperty(dt.transformOrigin.variable,k?b:E),{data:{transformOrigin:k?b:E}}}}}var Gp={name:"rects",fn({rects:e}){return{data:e}}},Yp=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:s,y:o}=n.arrow,r=t.split("-")[0];return Object.assign(e.style,{left:s!=null?`${s}px`:"",top:o!=null?`${o}px`:"",[r]:`calc(100% + ${dt.arrowOffset.reference})`}),{}}}};function Kp(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function Qc(e){return e.split("-")[0]}var Zp={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,applyStyles:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function va(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function mn(e,t){return e!=null&&Math.abs(e-t)<.5}function Po(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function zp(e,t,n){const s=e||t.createElement("div");return Hp({element:s,padding:n.arrowPadding})}function Jp(e,t){if(!zu(t.offset??t.gutter))return Dp(({placement:n})=>{const s=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,r=typeof o=="number"?o+s:o??s,{hasAlign:i}=Kp(n),a=i?void 0:t.shift,c=t.offset?.crossAxis??a;return si({crossAxis:c,mainAxis:r,alignmentAxis:t.shift})})}function Xp(e){if(e.flip)return Vp(()=>{const t=Po(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function Qp(e){if(!(!e.slide&&!e.overlap))return Rp(()=>{const t=Po(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Wp()}})}function e1(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,s,o;return Np(()=>{const r=Po(e.boundary);return{padding:e.overflowPadding,...r?{boundary:r}:void 0,apply({elements:i,rects:a,availableHeight:c,availableWidth:l}){const u=i.floating,d=Math.round(a.reference.width),g=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),mn(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),mn(n,g)||(u.style.setProperty("--reference-height",`${g}px`),n=g),mn(s,l)||(u.style.setProperty("--available-width",`${l}px`),s=l),mn(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function t1(e){if(e.hideWhenDetached)return Fp(()=>({strategy:"referenceHidden",boundary:Po(e.boundary)??"clippingAncestors"}))}function n1(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var s1=["transform","visibility","pointer-events","--x","--y","--z-index","z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],o1=["top","right","bottom","left"],Qn=new WeakSet;function r1(e,t){const n=e.style.getPropertyValue("z-index"),s=Qn.has(e),o=s&&n==="var(--z-index)";s&&!o&&Qn.delete(e);const r=Oc(t).zIndex;if(r==="auto"){o&&(e.style.removeProperty("z-index"),Qn.delete(e));return}n&&!o||(e.style.setProperty("--z-index",r),e.style.setProperty("z-index","var(--z-index)"),Qn.add(e))}function ba(e,t){if(!e)return kc;const n=new Map(t.map(s=>[s,e.style.getPropertyValue(s)]));return()=>{n.forEach((s,o)=>{s?e.style.setProperty(o,s):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function wa(e){return e==null?null:ye(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function i1(e,t,n={}){const s=()=>(typeof t=="function"?t():t)??null,o=()=>{const T=typeof e=="function"?e():e;return n.getAnchorElement?.()??T},r=()=>{const T=o();return!T&&!n.getAnchorRect?null:Bp(T,n.getAnchorRect)},i=Object.assign({},Zp,n);let a=[],c=null,l,u;function d(T){if(l?.(),u?.(),c=T,i.restoreStyles){const $=ba(T,s1);l=()=>{$(),Qn.delete(T)}}else l=void 0;const m=T.querySelector("[data-part=arrow]");u=i.restoreStyles?ba(m,o1):void 0,a=[Jp(m,i),Xp(i),Qp(i),zp(m,T.ownerDocument,i),Yp(m),Up({gutter:i.gutter,offset:i.offset,overlap:i.overlap},m),e1(i),t1(i),Gp]}const{placement:g,strategy:h,onComplete:y,onPositioned:f}=i;let p,v,w=!1,S,M,C=kc;const E=n1(i.listeners);function b(){if(!i.listeners)return;const T=o(),m=r(),$=s();if(!m||!$)return;(wa(T)!==wa(S)||$!==M)&&(C(),S=T,M=$,C=Pp(m,$,P,E))}async function k(){b();const T=s();if(!T)return;T!==c&&(d(T),w=!1);const m=r();if(!m)return;const $=await jp(m,T,{placement:g,middleware:a,strategy:h}),D=Ce(T),H=va(D,$.x),O=va(D,$.y);if(y?.({...$,x:H,y:O}),i.applyStyles!==!1&&(mn(p,H)||(T.style.setProperty("--x",`${H}px`),p=H),mn(v,O)||(T.style.setProperty("--y",`${O}px`),v=O),i.hideWhenDetached&&($.middlewareData.hide?.referenceHidden?(T.style.setProperty("visibility","hidden"),T.style.setProperty("pointer-events","none")):(T.style.removeProperty("visibility"),T.style.removeProperty("pointer-events"))),!w)){const F=T.firstElementChild;F&&(r1(T,F),w=!0)}}async function P(){n.updatePosition?(await n.updatePosition({updatePosition:k,floatingElement:s()}),f?.({placed:!0})):await k()}return P(),()=>{C(),u?.(),l?.(),f?.({placed:!1})}}function Dr(e,t,n={}){const{defer:s,...o}=n,r=s?we:a=>a(),i=[];return i.push(r(()=>{i.push(i1(e,t,o))})),()=>{i.forEach(a=>a?.())}}var a1={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function el(e={}){const{placement:t,sameWidth:n,fitViewport:s,strategy:o="absolute",applyStyles:r=!0}=e;return{arrow:{position:"absolute",width:dt.arrowSize.reference,height:dt.arrowSize.reference,[dt.arrowSizeHalf.variable]:`calc(${dt.arrowSize.reference} / 2)`,[dt.arrowOffset.variable]:`calc(${dt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?a1[t.split("-")[0]]:void 0,background:dt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:s?"var(--available-width)":void 0,maxHeight:s?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x, 0), var(--y, -100vh), 0)":"translate3d(0, -100vh, 0)",zIndex:r===!1?"var(--z-index)":void 0}}}var c1=e=>e.ids?.root??`select:${e.id}`,Rr=e=>e.ids?.content??`select:${e.id}:content`,Vr=e=>e.ids?.trigger??`select:${e.id}:trigger`,tl=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,Ms=e=>e.ids?.label??`select:${e.id}:label`,l1=e=>e.ids?.control??`select:${e.id}:control`,Nr=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,Fr=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,nl=e=>e.ids?.positioner??`select:${e.id}:positioner`,d1=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,Ca=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,er=e=>e.getById(Fr(e)),_n=e=>e.getById(Rr(e)),Yt=e=>e.getById(Vr(e)),u1=e=>e.getById(tl(e)),tr=e=>e.getById(nl(e)),nr=(e,t)=>t==null?null:e.getById(Nr(e,t)),f1={clearTriggerLabel:"Clear value"};function h1(e,t){const{context:n,prop:s,scope:o,state:r,computed:i,send:a}=e,c=Sc(f1,s("translations")),l=s("disabled")||n.get("fieldsetDisabled"),u=!!s("invalid"),d=!!s("required"),g=!!s("readOnly"),h=s("composite"),y=s("collection"),f=r.hasTag("open"),p=r.matches("focused"),v=n.get("highlightedValue"),w=n.get("highlightedItem"),S=i("selectedItems"),M=n.get("currentPlacement"),C=M?Qc(M):void 0,E=i("isTypingAhead"),b=i("isInteractive"),k=v?Nr(o,v):void 0;function P(m){const $=y.getItemDisabled(m.item),D=y.getItemValue(m.item);return Eo(D,()=>`[zag-js] No value found for item ${JSON.stringify(m.item)}`),{value:D,disabled:!!(l||$),highlighted:v===D,selected:n.get("value").includes(D)}}const T=el({...s("positioning"),placement:M});return{open:f,focused:p,empty:n.get("value").length===0,highlightedItem:w,highlightedValue:v,selectedItems:S,hasSelectedItems:i("hasSelectedItems"),value:n.get("value"),valueAsString:i("valueAsString"),collection:y,multiple:!!s("multiple"),disabled:!!l,reposition(m={}){a({type:"POSITIONING.SET",options:m})},focus(){Yt(o)?.focus({preventScroll:!0})},setOpen(m){a({type:m?"OPEN":"CLOSE",replaces:"open"})},selectValue(m){a({type:"ITEM.SELECT",value:m})},setValue(m){a({type:"VALUE.SET",value:m})},selectAll(){a({type:"VALUE.SET",value:y.getValues()})},setHighlightValue(m){a({type:"HIGHLIGHTED_VALUE.SET",value:m})},clearHighlightValue(){a({type:"HIGHLIGHTED_VALUE.CLEAR"})},clearValue(m){a(m?{type:"ITEM.CLEAR",value:m}:{type:"VALUE.CLEAR"})},getItemState:P,getRootProps(){return t.element({...ke.root.attrs,dir:s("dir"),id:c1(o),"data-invalid":V(u),"data-readonly":V(g)})},getLabelProps(){return t.label({dir:s("dir"),id:Ms(o),...ke.label.attrs,"data-disabled":V(l),"data-invalid":V(u),"data-readonly":V(g),"data-required":V(d),htmlFor:Fr(o),onClick(m){m.defaultPrevented||l||Yt(o)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...ke.control.attrs,dir:s("dir"),id:l1(o),"data-state":f?"open":"closed","data-focus":V(p),"data-disabled":V(l),"data-invalid":V(u)})},getValueTextProps(){return t.element({...ke.valueText.attrs,dir:s("dir"),"data-disabled":V(l),"data-invalid":V(u),"data-focus":V(p)})},getTriggerProps(){return t.button({id:Vr(o),disabled:l,dir:s("dir"),type:"button",role:"combobox","aria-controls":Rr(o),"aria-expanded":f,"aria-haspopup":"listbox","data-state":f?"open":"closed","aria-invalid":u,"aria-required":d,"aria-labelledby":Ms(o),...ke.trigger.attrs,"data-disabled":V(l),"data-invalid":V(u),"data-readonly":V(g),"data-placement":M,"data-side":C,"data-placeholder-shown":V(!i("hasSelectedItems")),onClick(m){b&&(m.defaultPrevented||a({type:"TRIGGER.CLICK"}))},onFocus(){a({type:"TRIGGER.FOCUS"})},onBlur(){a({type:"TRIGGER.BLUR"})},onKeyDown(m){if(m.defaultPrevented||!b)return;const D={ArrowUp(){a({type:"TRIGGER.ARROW_UP"})},ArrowDown(H){a({type:H.altKey?"OPEN":"TRIGGER.ARROW_DOWN"})},ArrowLeft(){a({type:"TRIGGER.ARROW_LEFT"})},ArrowRight(){a({type:"TRIGGER.ARROW_RIGHT"})},Home(){a({type:"TRIGGER.HOME"})},End(){a({type:"TRIGGER.END"})},Enter(){a({type:"TRIGGER.ENTER"})},Space(H){a(E?{type:"TRIGGER.TYPEAHEAD",key:H.key}:{type:"TRIGGER.ENTER"})}}[xr(m,{dir:s("dir"),orientation:"vertical"})];if(D){D(m),m.preventDefault();return}Ir.isValidEvent(m)&&(a({type:"TRIGGER.TYPEAHEAD",key:m.key}),m.preventDefault())}})},getIndicatorProps(){return t.element({...ke.indicator.attrs,dir:s("dir"),"aria-hidden":!0,"data-state":f?"open":"closed","data-disabled":V(l),"data-invalid":V(u),"data-readonly":V(g)})},getItemProps(m){const $=P(m);return t.element({id:Nr(o,$.value),role:"option",...ke.item.attrs,dir:s("dir"),"data-value":$.value,"aria-selected":$.selected,"data-state":$.selected?"checked":"unchecked","data-highlighted":V($.highlighted),"data-disabled":V($.disabled),"aria-disabled":be($.disabled),onPointerMove(D){$.disabled||D.pointerType!=="mouse"||Ar()==="pointer"&&$.value!==v&&a({type:"ITEM.POINTER_MOVE",value:$.value})},onClick(D){D.defaultPrevented||$.disabled||a({type:"ITEM.CLICK",src:"pointerup",value:$.value})},onPointerLeave(D){$.disabled||m.persistFocus||D.pointerType==="mouse"&&Ar()==="pointer"&&a({type:"ITEM.POINTER_LEAVE"})}})},getItemTextProps(m){const $=P(m);return t.element({...ke.itemText.attrs,"data-state":$.selected?"checked":"unchecked","data-disabled":V($.disabled),"data-highlighted":V($.highlighted)})},getItemIndicatorProps(m){const $=P(m);return t.element({"aria-hidden":!0,...ke.itemIndicator.attrs,"data-state":$.selected?"checked":"unchecked",hidden:!$.selected})},getItemGroupLabelProps(m){const{htmlFor:$}=m;return t.element({...ke.itemGroupLabel.attrs,id:Ca(o,$),dir:s("dir"),role:"presentation"})},getItemGroupProps(m){const{id:$}=m;return t.element({...ke.itemGroup.attrs,"data-disabled":V(l),id:d1(o,$),"aria-labelledby":Ca(o,$),role:"group",dir:s("dir")})},getClearTriggerProps(){return t.button({...ke.clearTrigger.attrs,id:tl(o),type:"button","aria-label":c.clearTriggerLabel,"data-invalid":V(u),disabled:l,hidden:!i("hasSelectedItems"),dir:s("dir"),onClick(m){m.defaultPrevented||a({type:"CLEAR.CLICK"})}})},getHiddenSelectProps(){const m=n.get("value"),$=s("multiple")?m:m?.[0],D=H=>{const O=ci(H);Rc(O)||a({type:"VALUE.SET",value:p1(H.currentTarget)})};return t.select({name:s("name"),form:s("form"),disabled:l,multiple:s("multiple"),required:s("required"),"aria-hidden":!0,id:Fr(o),defaultValue:$,style:Mh,tabIndex:-1,autoComplete:s("autoComplete"),onChange:D,onInput:D,onFocus(){Yt(o)?.focus({preventScroll:!0})},"aria-labelledby":Ms(o)})},getPositionerProps(){return t.element({...ke.positioner.attrs,dir:s("dir"),id:nl(o),style:T.floating})},getContentProps(){return t.element({hidden:!f,dir:s("dir"),id:Rr(o),role:h?"listbox":"dialog",...ke.content.attrs,"data-state":f?"open":"closed","data-placement":M,"data-side":C,"data-activedescendant":k,"aria-activedescendant":h?k:void 0,"aria-multiselectable":s("multiple")&&h?!0:void 0,"aria-labelledby":Ms(o),tabIndex:0,onKeyDown(m){if(!b||!Sn(m.currentTarget,bt(m)))return;if(m.key==="Tab"&&!rh(m)){m.preventDefault();return}const $={ArrowUp(){a({type:"CONTENT.ARROW_UP"})},ArrowDown(){a({type:"CONTENT.ARROW_DOWN"})},Home(){a({type:"CONTENT.HOME"})},End(){a({type:"CONTENT.END"})},Enter(){a({type:"ITEM.CLICK",src:"keydown.enter"})},Space(O){E?a({type:"CONTENT.TYPEAHEAD",key:O.key}):$.Enter?.()}},D=$[xr(m)];if(D){D(m),m.preventDefault();return}const H=bt(m);wf(H)||Ir.isValidEvent(m)&&(a({type:"CONTENT.TYPEAHEAD",key:m.key}),m.preventDefault())}})},getListProps(){return t.element({...ke.list.attrs,tabIndex:0,role:h?void 0:"listbox","aria-labelledby":Vr(o),"aria-activedescendant":h?void 0:k,"aria-multiselectable":!h&&s("multiple")?!0:void 0})}}}var p1=e=>e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value?[e.value]:[];function g1(e,t,n){let s=[],o;return r=>{const i=e(r);return(i.length!==s.length||i.some((c,l)=>!Mn(s[l],c)))&&(s=i,o=t(i,r)),o}}function m1(){const e=new Map;return{claim(t){const n=Symbol(t);return e.set(t,n),n},isReplaced(t,n){return e.get(t)!==n}}}var Ft=".",sl="#",ka=new WeakMap,ol=new WeakMap;function Hr(e){return e.join(Ft)}function y1(e){return e.includes(Ft)}function rl(e){return e.startsWith(sl)}function v1(e){return e.startsWith(Ft)}function b1(e){return rl(e)?e.slice(sl.length):e}function Wr(e,t){return e?`${e}${Ft}${t}`:t}function w1(e){const t=new Map,n=new Map,s=(o,r)=>{t.set(o,r);const i=r.id;i&&(n.has(i)&&na(`[zag-js] Duplicate state id: "${i}"`),n.set(i,o));const a=r.states;if(a){Eo(r.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),r.initial in a||na(`[zag-js] Compound state "${o}" has initial "${String(r.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=Wr(o,c);s(u,l)}}};for(const[o,r]of Object.entries(e.states))r&&s(o,r);return{index:t,idIndex:n}}function Cs(e){const t=ka.get(e);if(t)return t;const{index:n,idIndex:s}=w1(e);return ka.set(e,n),ol.set(e,s),n}function C1(e,t){return Cs(e),ol.get(e)?.get(t)}function vi(e){return e?String(e).split(Ft).filter(Boolean):[]}function fo(e,t){if(!t)return[];const n=Cs(e),s=vi(t),o=[],r=[];for(const i of s){r.push(i);const a=Hr(r),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Bn(e,t){const n=Cs(e),s=vi(t);if(!s.length)return t;const o=[];for(const a of s){o.push(a);const c=Hr(o);if(!n.has(c))return t}let r=Hr(o),i=n.get(r);for(;i?.initial;){const a=`${r}${Ft}${i.initial}`,c=n.get(a);if(!c)break;r=a,i=c}return r}function Ea(e,t){return Cs(e).has(t)}function Sa(e,t,n){const s=String(t);if(rl(s)){const o=b1(s),r=C1(e,o);return Eo(r,()=>`[zag-js] Unknown state id: "${o}"`),Bn(e,r)}if(v1(s)&&n){const o=Wr(n,s.slice(1));return Bn(e,o)}if(!y1(s)&&n){const o=vi(n);for(let r=o.length-1;r>=1;r--){const i=o.slice(0,r).join(Ft),a=Wr(i,s);if(Ea(e,a))return Bn(e,a)}if(Ea(e,s))return Bn(e,s)}return Bn(e,s)}function k1(e,t,n){const s=fo(e,t);for(let r=s.length-1;r>=0;r--){const a=s[r]?.state.on?.[n];if(a)return{transitions:a,source:s[r]?.path}}return{transitions:e.on?.[n],source:void 0}}function E1(e,t,n,s){const o=t?fo(e,t):[],r=fo(e,n);let i=0;for(;i<o.length&&i<r.length&&o[i]?.path===r[i]?.path;)i+=1;let a=o.slice(i).reverse(),c=r.slice(i);const l=o[o.length-1]?.path===r[r.length-1]?.path;return s&&l&&(a=o.slice().reverse(),c=r),{exiting:a,entering:c}}function S1(e,t){return e?e===t||e.startsWith(`${t}${Ft}`):!1}function x1(e,t,n){return fo(e,t).some(s=>s.state.tags?.includes(n))}function il(){return{and:(...e)=>function(n){return e.every(s=>n.guard(s))},or:(...e)=>function(n){return e.some(s=>n.guard(s))},not:e=>function(n){return!n.guard(e)}}}function al(e){return Cs(e),e}var es=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(es||{}),As="__init__";function $1(e){const t=()=>e.getRootNode?.()??document,n=()=>je(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>xo(t()),isActiveElement:Sr,getById:i=>t().getElementById(i)}}function L1(e){const t={each(n){for(let s=0;s<e.frames?.length;s+=1){const o=e.frames[s];o&&n(o)}},addEventListener(n,s,o){return t.each(r=>{try{r.document.addEventListener(n,s,o)}catch{}}),()=>{try{t.removeEventListener(n,s,o)}catch{}}},removeEventListener(n,s,o){t.each(r=>{try{r.document.removeEventListener(n,s,o)}catch{}})}};return t}function I1(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,s,o)=>{try{t?.addEventListener(n,s,o)}catch{}return()=>{try{t?.removeEventListener(n,s,o)}catch{}}},removeEventListener:(n,s,o)=>{try{t?.removeEventListener(n,s,o)}catch{}}}}var xa="pointerdown.outside",$a="focus.outside";function T1(e){for(const t of e)if(ye(t)&&$o(t))return!0;return!1}var cl=e=>"clientY"in e;function M1(e,t){if(!cl(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function A1(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function La(e,t){if(!t||!cl(e))return!1;const n=t.scrollHeight>t.clientHeight,s=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,r=o&&e.clientY>t.offsetTop+t.clientHeight,i={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return A1(i,a)?s||r:!1}function O1(e,t){const{exclude:n,onFocusOutside:s,onPointerDownOutside:o,onInteractOutside:r,defer:i,followControlledElements:a=!0}=t;if(!e)return;const c=je(e),l=Ce(e),u=L1(l),d=I1(l);function g(C,E){if(!ye(E)||!E.isConnected||Sn(e,E)||M1(e,C)||a&&Nf(e,E))return!1;const b=c.querySelector(`[aria-controls="${e.id}"]`);if(b){const P=$r(b);if(La(C,P))return!1}const k=$r(e);return La(C,k)?!1:!n?.(E)}const h=new Set,y=En(e?.getRootNode());let f=!1;function p(C){f=!0;const E=()=>{f=!1};c.addEventListener("pointerup",E,{once:!0}),l.addEventListener("pointerup",E,{once:!0});function b(k){const P=i&&!oa()?we:$=>$(),T=k??C,m=T?.composedPath?.()??[T?.target];P(()=>{const $=y?m[0]:bt(C);if(!(!e||!g(C,$))){if(o||r){const D=so(o,r);e.addEventListener(xa,D,{once:!0})}Ia(e,xa,{bubbles:!1,cancelable:!0,detail:{originalEvent:T,contextmenu:jf(T),focusable:T1(m),target:$}})}})}C.pointerType==="touch"?(h.forEach(k=>k()),h.add(Ys(c,"click",b,{once:!0})),h.add(d.addEventListener("click",b,{once:!0})),h.add(u.addEventListener("click",b,{once:!0}))):b()}const v=new Set,w=setTimeout(()=>{v.add(Ys(c,"pointerdown",p,!0)),v.add(d.addEventListener("pointerdown",p,!0)),v.add(u.addEventListener("pointerdown",p,!0))},0),S=Vc.create();function M(C){if(f)return;(i?b=>S.request(b):b=>b())(()=>{const b=C?.composedPath?.()??[C?.target],k=y?b[0]:bt(C);if(!(!e||!g(C,k))){if(s||r){const P=so(s,r);e.addEventListener($a,P,{once:!0})}Ia(e,$a,{bubbles:!1,cancelable:!0,detail:{originalEvent:C,contextmenu:!1,focusable:$o(k),target:k}})}})}return oa()||(v.add(Ys(c,"focusin",M,!0)),v.add(d.addEventListener("focusin",M,!0)),v.add(u.addEventListener("focusin",M,!0))),()=>{clearTimeout(w),S.cancel(),h.forEach(C=>C()),v.forEach(C=>C())}}function P1(e,t){const{defer:n}=t,s=n?we:r=>r(),o=[];return o.push(s(()=>{const r=typeof e=="function"?e():e;o.push(O1(r,t))})),()=>{o.forEach(r=>r?.())}}function Ia(e,t,n){const s=e.ownerDocument.defaultView||window,o=new s.CustomEvent(t,n);return e.dispatchEvent(o)}function D1(e,t){const n=s=>{s.key==="Escape"&&(s.isComposing||t?.(s))};return Ys(je(e),"keydown",n,{capture:!0})}var Ta="layer:request-dismiss",xe={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(s=>s.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(s=>s.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(s=>Sn(s.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Sn(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(s=>{const o=s();o&&R1(o)}),this.recentlyRemoved.add(e),Fc(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>xe.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Ma(e,t,e.node),e.styleTargets?.forEach(n=>{const s=n();if(!s||s===e.node)return;Ma(e,t,s);const{zIndex:o}=Oc(e.node);s.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const s=this.layers[n];N1(e,Ta,o=>{s.requestDismiss?.(o),o.defaultPrevented||s?.dismiss()}),V1(e,Ta,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Ma(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),xe.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=xe.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function R1(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function V1(e,t,n){const s=e.ownerDocument.defaultView||window,o=new s.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function N1(e,t,n){e.addEventListener(t,n,{once:!0})}var sr=new WeakMap,is=new WeakMap;function F1(e){return xe.isBelowPointerBlockingLayer(e)?"none":"auto"}function ll(e){const t=F1(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function H1(e){if(is.has(e))return;const t=Ce(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{is.has(e)&&ll(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),is.set(e,n)}function Aa(){xe.layers.forEach(({node:e})=>{ll(e),H1(e)})}function W1(e){const t=is.get(e);t&&(t.disconnect(),is.delete(e)),e.style.pointerEvents=""}function j1(e,t){const n=je(e),s=[];return xe.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(sr.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[r,i]=Oh(()=>{const a=o();return ye(a)?a:null},{timeout:1e3});r.then(a=>s.push($h(a,{pointerEvents:"auto"}))),s.push(i)}),()=>{xe.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const r=sr.get(o);r!==void 0&&(o.style.pointerEvents=r,sr.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),s.forEach(o=>o()))}}function _1(e,t){const{onDismiss:n,onRequestDismiss:s,pointerBlocking:o,exclude:r,debug:i,type:a="dialog",layerStyleTargets:c}=t,l={dismiss:n,node:e,type:a,pointerBlocking:o,requestDismiss:s,styleTargets:c};xe.add(l),Aa();function u(f){const p=bt(f.detail.originalEvent);xe.isBelowPointerBlockingLayer(e)||xe.isInBranch(p)||(t.onPointerDownOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onPointerDownOutside:",f.detail.originalEvent),n?.(f)))}function d(f){const p=bt(f.detail.originalEvent);xe.isInBranch(p)||(t.onFocusOutside?.(f),t.onInteractOutside?.(f),!f.defaultPrevented&&(i&&console.log("onFocusOutside:",f.detail.originalEvent),n?.(f)))}function g(f){xe.isTopMost(e)&&(t.onEscapeKeyDown?.(f),!f.defaultPrevented&&n&&(f.preventDefault(),n(f)))}function h(f){const p=typeof r=="function"?r():r,v=Array.isArray(p)?p:[p],w=t.persistentElements?.map(S=>S()).filter(ye);return w&&v.push(...w),v.some(S=>Sn(S,f))||xe.isInNestedLayer(e,f)}const y=[o?j1(e,t.persistentElements):void 0,D1(e,g),P1(e,{exclude:h,onFocusOutside:d,onPointerDownOutside:u,defer:t.defer})];return()=>{xe.remove(e),Aa(),W1(e),y.forEach(f=>f?.())}}function dl(e,t){const{warnOnMissingNode:n=!0}=t;return Dh(e,s=>_1(s,t),{defer:t.defer,getRootNode:t.getRootNode,onMissing:n?()=>Us("[@zag-js/dismissable] node is `null` or `undefined`"):void 0})}var{and:qn,not:qt,or:B1}=il(),q1=al({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??oo.empty(),positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){const s=e("value")??e("defaultValue")??[],o=e("collection").findMany(s);return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Mn,onChange(r){const i=n(),a=e("collection"),c=i.get("selectedItemMap"),l=Ls({values:r,collection:a,selectedItemMap:c}),u=e("value")??r,d=u===r?l:Ls({values:u,collection:a,selectedItemMap:l.nextSelectedItemMap});return i.set("selectedItemMap",d.nextSelectedItemMap),e("onValueChange")?.({value:r,items:l.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(r){e("onHighlightChange")?.({highlightedValue:r,highlightedItem:e("collection").find(r),highlightedIndex:e("collection").indexOf(r)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:lf({selectedItems:o,collection:e("collection")})}))}},refs(){return{typeahead:{...Ir.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get("value").length>0,isTypingAhead:({refs:e})=>e.get("typeahead").keysSoFar!=="",isDisabled:({prop:e,context:t})=>!!e("disabled")||!!t.get("fieldsetDisabled"),isInteractive:({prop:e})=>!(e("disabled")||e("readOnly")),selectedItems:({context:e,prop:t})=>Lc({values:e.get("value"),collection:t("collection"),selectedItemMap:e.get("selectedItemMap")}),valueAsString:({computed:e,prop:t})=>t("collection").stringifyItems(e("selectedItems"))},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},entry:["syncSelectElement"],watch({context:e,prop:t,track:n,action:s}){n([()=>e.get("value").toString()],()=>{s(["syncSelectedItems","syncSelectElement","dispatchChangeEvent"])}),n([()=>t("open")],()=>{s(["toggleVisibility"])}),n([()=>e.get("highlightedValue")],()=>{s(["syncHighlightedItem"])}),n([()=>t("collection").toString()],()=>{s(["syncCollection"])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedItem"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedItem"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setSelectedItems"]},"VALUE.CLEAR":{actions:["clearSelectedItems"]},"CLEAR.CLICK":{actions:["clearSelectedItems","focusTriggerEl"]}},effects:["trackFormControlState"],states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{target:"open",actions:["setInitialFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus","highlightFirstSelectedItem"]}],"TRIGGER.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{guard:"isTriggerArrowUpEvent",target:"open",actions:["setInitialFocus","highlightComputedLastItem"]},{guard:B1("isTriggerArrowDownEvent","isTriggerEnterEvent"),target:"open",actions:["setInitialFocus","highlightComputedFirstItem"]},{target:"open",actions:["setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}],"TRIGGER.BLUR":{target:"idle"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightFirstSelectedItem"]}],"TRIGGER.ENTER":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_UP":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedLastItem"]}],"TRIGGER.ARROW_DOWN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_LEFT":[{guard:qn(qt("multiple"),"hasSelectedItems"),actions:["selectPreviousItem"]},{guard:qt("multiple"),actions:["selectLastItem"]}],"TRIGGER.ARROW_RIGHT":[{guard:qn(qt("multiple"),"hasSelectedItems"),actions:["selectNextItem"]},{guard:qt("multiple"),actions:["selectFirstItem"]}],"TRIGGER.HOME":{guard:qt("multiple"),actions:["selectFirstItem"]},"TRIGGER.END":{guard:qt("multiple"),actions:["selectLastItem"]},"TRIGGER.TYPEAHEAD":{guard:qt("multiple"),actions:["selectMatchingItem"]}}},open:{tags:["open"],exit:["scrollContentToTop"],effects:["trackDismissableElement","trackFocusVisible","computePlacement","scrollToHighlightedItem"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["clearHighlightedItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{guard:"restoreFocus",target:"focused",actions:["invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["invokeOnClose","clearHighlightedItem"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","clearHighlightedItem"]}],"ITEM.CLICK":[{guard:qn("closeOnSelect","isOpenControlled"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{actions:["selectHighlightedItem"]}],"CONTENT.HOME":{actions:["highlightFirstItem"]},"CONTENT.END":{actions:["highlightLastItem"]},"CONTENT.ARROW_DOWN":[{guard:qn("hasHighlightedItem","loop","isLastItemHighlighted"),actions:["highlightFirstItem"]},{guard:"hasHighlightedItem",actions:["highlightNextItem"]},{actions:["highlightFirstItem"]}],"CONTENT.ARROW_UP":[{guard:qn("hasHighlightedItem","loop","isFirstItemHighlighted"),actions:["highlightLastItem"]},{guard:"hasHighlightedItem",actions:["highlightPreviousItem"]},{actions:["highlightLastItem"]}],"CONTENT.TYPEAHEAD":{actions:["highlightMatchingItem"]},"ITEM.POINTER_MOVE":{actions:["highlightItem"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedItem"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{loop:({prop:e})=>!!e("loopFocus"),multiple:({prop:e})=>!!e("multiple"),hasSelectedItems:({computed:e})=>!!e("hasSelectedItems"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e("closeOnSelect")),restoreFocus:({event:e})=>Oa(e),isOpenControlled:({prop:e})=>e("open")!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.CLICK",isTriggerEnterEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ENTER",isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ARROW_UP",isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ARROW_DOWN"},effects:{trackFocusVisible({scope:e}){return Gh({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Kf(er(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){const n=e.initial("value");e.set("value",n)}})},trackDismissableElement({scope:e,send:t,prop:n}){const s=()=>_n(e);let o=!0;return dl(s,{type:"listbox",defer:!0,getRootNode:e.getRootNode,layerStyleTargets:[()=>tr(e)],exclude:[Yt(e),u1(e)],onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onInteractOutside(r){n("onInteractOutside")?.(r),o=!(r.detail.focusable||r.detail.contextmenu)},onDismiss(r){t({type:"CLOSE",src:"interact-outside",restoreFocus:o,focusVisible:r?.type==="keydown"})}})},computePlacement({context:e,prop:t,scope:n}){const s=t("positioning");return e.set("currentPlacement",s.placement),Dr(()=>Yt(n),()=>tr(n),{defer:!0,...s,onComplete(i){e.set("currentPlacement",i.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){const s=a=>{const c=e.get("highlightedValue");if(c==null||Ar()==="pointer")return;const u=_n(n),d=t("scrollToIndexFn");if(d){const h=t("collection").indexOf(c);d?.({index:h,immediate:a,getElement:()=>nr(n,c)});return}const g=nr(n,c);wh(g,{rootEl:u,block:"nearest"})},o=we(()=>{Uh("virtual"),s(!0)}),i=lh(()=>_n(n),{attributes:["data-activedescendant"],callback(){s(!1)}});return()=>{o(),i()}}},actions:{reposition({context:e,prop:t,scope:n,event:s}){const o=()=>tr(n);Dr(Yt(n),o,{...t("positioning"),...s.options,defer:!0,listeners:!1,onComplete(r){e.set("currentPlacement",r.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})},highlightPreviousItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const s=t("collection").getPreviousValue(n,1,t("loopFocus"));s!=null&&e.set("highlightedValue",s)},highlightNextItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const s=t("collection").getNextValue(n,1,t("loopFocus"));s!=null&&e.set("highlightedValue",s)},highlightFirstItem({context:e,prop:t}){const n=t("collection").firstValue;e.set("highlightedValue",n)},highlightLastItem({context:e,prop:t}){const n=t("collection").lastValue;e.set("highlightedValue",n)},setInitialFocus({scope:e}){we(()=>{const t=oh({root:_n(e)});t&&t.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){if(!Oa(e))return;const n=U1(e);we(()=>{Yt(t)?.focus(n)})},selectHighlightedItem({context:e,prop:t,event:n}){let s=n.value??e.get("highlightedValue");if(s==null||!t("collection").has(s))return;t("onSelect")?.({value:s}),s=t("deselectable")&&!t("multiple")&&e.get("value").includes(s)?null:s,e.set("value",r=>s==null?[]:t("multiple")?Xi(r,s):[s])},highlightComputedFirstItem({context:e,prop:t,computed:n}){const s=t("collection"),o=n("hasSelectedItems")?s.sort(e.get("value"))[0]:s.firstValue;e.set("highlightedValue",o)},highlightComputedLastItem({context:e,prop:t,computed:n}){const s=t("collection"),o=n("hasSelectedItems")?s.sort(e.get("value"))[0]:s.lastValue;e.set("highlightedValue",o)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n("hasSelectedItems"))return;const s=t("collection").sort(e.get("value"))[0];e.set("highlightedValue",s)},highlightItem({context:e,event:t}){e.set("highlightedValue",t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:s}){const o=t("collection").search(n.key,{state:s.get("typeahead"),currentValue:e.get("highlightedValue")});o!=null&&e.set("highlightedValue",o)},setHighlightedItem({context:e,event:t}){e.set("highlightedValue",t.value)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},selectItem({context:e,prop:t,event:n}){t("onSelect")?.({value:n.value});const o=t("deselectable")&&!t("multiple")&&e.get("value").includes(n.value)?null:n.value;e.set("value",r=>o==null?[]:t("multiple")?Xi(r,o):[o])},clearItem({context:e,event:t}){e.set("value",n=>n.filter(s=>s!==t.value))},setSelectedItems({context:e,event:t}){e.set("value",t.value)},clearSelectedItems({context:e}){e.set("value",[])},selectPreviousItem({context:e,prop:t}){const[n]=e.get("value"),s=t("collection").getPreviousValue(n);s&&e.set("value",[s])},selectNextItem({context:e,prop:t}){const[n]=e.get("value"),s=t("collection").getNextValue(n);s&&e.set("value",[s])},selectFirstItem({context:e,prop:t}){const n=t("collection").firstValue;n&&e.set("value",[n])},selectLastItem({context:e,prop:t}){const n=t("collection").lastValue;n&&e.set("value",[n])},selectMatchingItem({context:e,prop:t,event:n,refs:s}){const o=t("collection").search(n.key,{state:s.get("typeahead"),currentValue:e.get("value")[0]});o!=null&&e.set("value",[o])},scrollContentToTop({prop:e,scope:t}){if(e("scrollToIndexFn")){const n=e("collection").firstValue;e("scrollToIndexFn")?.({index:0,immediate:!0,getElement:()=>nr(t,n)})}else _n(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("onOpenChange")?.({open:!1,value:t.get("value")})},syncSelectElement({context:e,prop:t,scope:n}){const s=er(n);if(s){if(e.get("value").length===0&&!t("multiple")){s.selectedIndex=-1;return}for(const o of s.options)o.selected=e.get("value").includes(o.value)}},syncCollection({context:e,prop:t}){const n=t("collection"),s=n.find(e.get("highlightedValue"));s&&e.set("highlightedItem",s);const o=Ls({values:e.get("value"),collection:n,selectedItemMap:e.get("selectedItemMap")});e.set("selectedItemMap",o.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){const n=Ls({values:e.get("value"),collection:t("collection"),selectedItemMap:e.get("selectedItemMap")});e.set("selectedItemMap",n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){const n=t("collection"),s=e.get("highlightedValue"),o=s?n.find(s):null;e.set("highlightedItem",o)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{const t=er(e);if(!t)return;const n=e.getWin(),s=new n.Event("change",{bubbles:!0,composed:!0});t.dispatchEvent(Zf(s))})}}}});function Oa(e){const t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}function U1(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function G1(e){return new Proxy({},{get(t,n){return n==="style"?s=>e({style:s}).style:e}})}var Y1=Object.defineProperty,K1=(e,t,n)=>t in e?Y1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>K1(e,typeof t!="symbol"?t+"":t,n),Pa={onFocus:"onFocusin",onBlur:"onFocusout",onChange:"onInput",onDoubleClick:"onDblclick",htmlFor:"for",className:"class",defaultValue:"value",defaultChecked:"checked"},Z1=new Set(["viewBox","preserveAspectRatio"]),ul=G1(e=>Object.entries(e).reduce((t,[n,s])=>{if(s===void 0)return t;n in Pa&&(n=Pa[n]);const o=Z1.has(n)?n:n.toLowerCase();return t[o]=s,t},{})),Os=new WeakMap,Da=new Set(["value","checked","selected"]),z1=new Set(["viewBox","preserveAspectRatio","clipPath","clipRule","fillRule","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeDashoffset","strokeMiterlimit"]),J1=e=>e.tagName==="svg"||e.namespaceURI==="http://www.w3.org/2000/svg",Ps=(e,t)=>J1(e)&&z1.has(t)?t:t.toLowerCase(),or=e=>e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ra=(e,t,n)=>{if(typeof n=="string"){e.setAttribute("style",n);return}if(n==null&&typeof t=="string"){e.removeAttribute("style");return}const s=e.style;if(s!=null){for(const o in t)n?.[o]==null&&s.removeProperty(or(o));for(const o in n){const r=n[o];r==null?s.removeProperty(or(o)):s.setProperty(or(o),String(r))}}};function ie(e,t,n){const s="default";let o=Os.get(e);o||(o=new Map,Os.set(e,o));const r=o.get(s)||{},i=Object.keys(t),a=(f,p)=>{e.addEventListener(f.toLowerCase(),p)},c=(f,p)=>{e.removeEventListener(f.toLowerCase(),p)},l=f=>f.startsWith("on"),u=f=>!f.startsWith("on"),d=f=>a(f.substring(2),t[f]),g=f=>c(f.substring(2),t[f]),h=f=>{const p=t[f],v=r[f];if(p!==v){if(f==="class"){e.className=p??"";return}if(f==="style"){Ra(e,v,p);return}if(Da.has(f)){e[f]=p??"";return}if(typeof p=="boolean"&&!f.includes("aria-")){e.toggleAttribute(Ps(e,f),p);return}if(f==="children"){e.innerHTML=p;return}if(p!=null){e.setAttribute(Ps(e,f),p);return}e.removeAttribute(Ps(e,f))}};for(const f in r)t[f]==null&&(f==="class"?e.className="":f==="style"?Ra(e,r[f],void 0):Da.has(f)?e[f]="":e.removeAttribute(Ps(e,f)));return Object.keys(r).filter(l).forEach(f=>{c(f.substring(2),r[f])}),i.filter(l).forEach(d),i.filter(u).forEach(h),o.set(s,t),function(){i.filter(l).forEach(g);const p=Os.get(e);p&&(p.delete(s),p.size===0&&Os.delete(e))}}function X1(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function fl(e,t){const n=X1();return n?(n[e]||(n[e]=t()),n[e]):t()}var Zs=fl("__zag__refSet",()=>new WeakSet),Q1=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,eg=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,tg=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",ng=e=>Q1(e)||eg(e)||tg(e),jr=e=>e!==null&&typeof e=="object",Va=e=>jr(e)&&!Zs.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!ng(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise)&&!(e instanceof File)&&!(e instanceof Blob)&&!(e instanceof AbortController);const sg=Symbol(),Na=Object.getPrototypeOf,_r=new WeakMap,og=e=>e&&(_r.has(e)?_r.get(e):Na(e)===Object.prototype||Na(e)===Array.prototype),rg=e=>og(e)&&e[sg]||null,Fa=(e,t=!0)=>{_r.set(e,t)};var Gt=fl("__zag__proxyStateMap",()=>new WeakMap),ig=(e=Object.is,t=(a,c)=>new Proxy(a,c),n=new WeakMap,s=(a,c)=>{const l=n.get(a);if(l?.[0]===c)return l[1];const u=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Fa(u,!0),n.set(a,[c,u]),Reflect.ownKeys(a).forEach(d=>{const g=Reflect.get(a,d);Zs.has(g)?(Fa(g,!1),u[d]=g):Gt.has(g)?u[d]=cg(g):u[d]=g}),Object.freeze(u)},o=new WeakMap,r=[1,1],i=a=>{if(!jr(a))throw new Error("object required");const c=o.get(a);if(c)return c;let l=r[0];const u=new Set,d=(b,k=++r[0])=>{l!==k&&(l=k,u.forEach(P=>P(b,k)))};let g=r[1];const h=(b=++r[1])=>(g!==b&&!u.size&&(g=b,f.forEach(([k])=>{const P=k[1](b);P>l&&(l=P)})),l),y=b=>(k,P)=>{const T=[...k];T[1]=[b,...T[1]],d(T,P)},f=new Map,p=(b,k)=>{if(u.size){const P=k[3](y(b));f.set(b,[k,P])}else f.set(b,[k])},v=b=>{const k=f.get(b);k&&(f.delete(b),k[1]?.())},w=b=>(u.add(b),u.size===1&&f.forEach(([P,T],m)=>{const $=P[3](y(m));f.set(m,[P,$])}),()=>{u.delete(b),u.size===0&&f.forEach(([P,T],m)=>{T&&(T(),f.set(m,[P]))})}),S=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),C=t(S,{deleteProperty(b,k){const P=Reflect.get(b,k);v(k);const T=Reflect.deleteProperty(b,k);return T&&d(["delete",[k],P]),T},set(b,k,P,T){const m=Reflect.has(b,k),$=Reflect.get(b,k,T);if(m&&(e($,P)||o.has(P)&&e($,o.get(P))))return!0;v(k),jr(P)&&(P=rg(P)||P);let D=P;if(!Object.getOwnPropertyDescriptor(b,k)?.set){!Gt.has(P)&&Va(P)&&(D=hl(P));const H=!Zs.has(D)&&Gt.get(D);H&&p(k,H)}return Reflect.set(b,k,D,T),d(["set",[k],P,$]),!0}});o.set(a,C);const E=[S,h,s,w];return Gt.set(C,E),Reflect.ownKeys(a).forEach(b=>{const k=Object.getOwnPropertyDescriptor(a,b);k.get||k.set?Object.defineProperty(S,b,k):C[b]=a[b]}),C})=>[i,Gt,Zs,e,t,Va,n,s,o,r],[ag]=ig();function hl(e={}){return ag(e)}function Ha(e,t,n){const s=Gt.get(e);let o;const r=[],i=s[3];let a=!1;const l=i(u=>{r.push(u),o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(r.splice(0))}))});return a=!0,()=>{a=!1,l()}}function cg(e){const t=Gt.get(e),[n,s,o]=t;return o(n,s())}function ho(e){const t=e().value??e().defaultValue;e().debug&&console.log(`[bindable > ${e().debug}] initial`,t);const n=e().isEqual??Object.is,s=hl({value:t}),o=()=>e().value!==void 0;return{initial:t,ref:s,get(){return o()?e().value:s.value},set(r){const i=o()?e().value:s.value,a=lt(r)?r(i):r;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:a,prev:i}),o()||(s.value=a),n(a,i)||e().onChange?.(a,i)},invoke(r,i){e().onChange?.(r,i)},hash(r){return e().hash?.(r)??String(r)}}}ho.cleanup=e=>{};ho.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function lg(e){const t={current:e};return{get(n){return t.current[n]},set(n,s){t.current[n]=s}}}var{defineProperty:dg,getOwnPropertyDescriptor:ug,getOwnPropertyDescriptors:Wa}=Object;function ts(e,t){if(Object.is(e,t))return e;if(!Xn(e)||!Xn(t))return t===void 0?e:t;let n=e;const s=(o,r)=>{n===e&&(n=Object.defineProperties({},Wa(e))),dg(n,o,r)};for(const[o,r]of Object.entries(Wa(t))){if(!r.enumerable)continue;if(r.get){s(o,r);continue}const i=r.value;if(i===void 0)continue;const a=!!ug(e,o)?.get,c=e[o],l=Xn(c)&&Xn(i)?ts(c,i):i;!a&&Object.is(c,l)||s(o,{value:l,writable:!0,enumerable:!0,configurable:!0})}return n}var pl=class{constructor(e,t={}){J(this,"machine",e),J(this,"scope"),J(this,"context"),J(this,"prop"),J(this,"state"),J(this,"refs"),J(this,"computed"),J(this,"event",{type:""}),J(this,"previousEvent",{type:""}),J(this,"effects",new Map),J(this,"replaceTracker",m1()),J(this,"transition",null),J(this,"cleanups",[]),J(this,"subscriptions",[]),J(this,"userProps"),J(this,"userPropsSources",[]),J(this,"getUserProps",()=>{let d=this.userProps;for(const g of this.userPropsSources){const h=ta(g);d=d?ts(d,h):h}return d}),J(this,"getEvent",()=>({...this.event,current:()=>this.event,previous:()=>this.previousEvent})),J(this,"getState",()=>({...this.state,matches:(...d)=>d.some(g=>S1(this.state.get(),g)),hasTag:d=>x1(this.machine,this.state.get(),d)})),J(this,"debug",(...d)=>{this.machine.debug&&console.log(...d)}),J(this,"notify",()=>{this.publish()}),J(this,"send",d=>{if(this.status!==es.Started)return;const g=d?.replaces,h=g?this.replaceTracker.claim(g):void 0;queueMicrotask(()=>{if(!d||g&&h&&this.replaceTracker.isReplaced(g,h))return;this.previousEvent=this.event,this.event=d,this.debug("send",d);let y=this.state.get();const f=d.type,{transitions:p,source:v}=k1(this.machine,y,f),w=this.choose(p);if(!w)return;this.transition=w;const S=Sa(this.machine,w.target??y,v);this.debug("transition",w),S!==y?this.state.set(S):w.reenter?this.state.invoke(y,y):this.action(w.actions)})}),J(this,"action",d=>{const g=lt(d)?d(this.getParams()):d;if(!g)return;const h=g.map(y=>{const f=this.machine.implementations?.actions?.[y];return f||Us(`[zag-js] No implementation found for action "${JSON.stringify(y)}"`),f});for(const y of h)y?.(this.getParams())}),J(this,"guard",d=>{if(lt(d))return d(this.getParams());const g=this.machine.implementations?.guards?.[d];return g||Us(`[zag-js] No implementation found for guard "${JSON.stringify(d)}"`),g?.(this.getParams())}),J(this,"effect",d=>{const g=lt(d)?d(this.getParams()):d;if(!g)return;const h=g.map(f=>{const p=this.machine.implementations?.effects?.[f];return p||Us(`[zag-js] No implementation found for effect "${JSON.stringify(f)}"`),p}),y=[];for(const f of h){const p=f?.(this.getParams());p&&y.push(p)}return()=>y.forEach(f=>f?.())}),J(this,"choose",d=>_u(d).find(g=>{let h=!g.guard;return Zu(g.guard)?h=!!this.guard(g.guard):lt(g.guard)&&(h=g.guard(this.getParams())),h})),J(this,"subscribe",d=>(this.subscriptions.push(d),()=>{const g=this.subscriptions.indexOf(d);g>-1&&this.subscriptions.splice(g,1)})),J(this,"status",es.NotStarted),J(this,"publish",()=>{this.callTrackers(),this.subscriptions.forEach(d=>d(this.service))}),J(this,"trackers",[]),J(this,"setupTrackers",()=>{this.machine.watch?.(this.getParams())}),J(this,"callTrackers",()=>{this.trackers.forEach(({deps:d,fn:g})=>{const h=d.map(y=>y());Mn(g.prev,h)||(g(),g.prev=h)})}),J(this,"getParams",()=>({state:this.getState(),context:this.context,event:this.getEvent(),prop:this.prop,send:this.send,action:this.action,guard:this.guard,track:(d,g)=>{g.prev=d.map(h=>h()),this.trackers.push({deps:d,fn:g})},refs:this.refs,computed:this.computed,flush:nf,scope:this.scope,choose:this.choose})),lt(t)?this.userPropsSources.push(t):this.userProps=t;const{id:n,ids:s,getRootNode:o}=ta(t);this.scope=$1({id:n,ids:s,getRootNode:o});const r=d=>{const g=this.getUserProps();return(e.props?.({props:si(g),scope:this.scope})??g)[d]};this.prop=r;const i=e.context?.({prop:r,bindable:ho,scope:this.scope,flush(d){queueMicrotask(d)},getContext(){return a},getComputed(){return c},getRefs(){return l},getEvent:this.getEvent.bind(this)});i&&Object.values(i).forEach(d=>{const g=Ha(d.ref,()=>this.notify());this.cleanups.push(g)});const a={get(d){return i?.[d].get()},set(d,g){i?.[d].set(g)},initial(d){return i?.[d].initial},hash(d){const g=i?.[d].get();return i?.[d].hash(g)}};this.context=a;const c=d=>(Eo(e.computed,()=>"[zag-js] No computed object found on machine"),e.computed[d]({context:a,event:this.getEvent(),prop:r,refs:this.refs,scope:this.scope,computed:c}));this.computed=c;const l=lg(e.refs?.({prop:r,context:a})??{});this.refs=l;const u=ho(()=>({defaultValue:Sa(e,e.initialState({prop:r})),onChange:(d,g)=>{const{exiting:h,entering:y}=E1(this.machine,g,d,this.transition?.reenter);if(h.forEach(f=>{this.effects.get(f.path)?.(),this.effects.delete(f.path)}),h.forEach(f=>{this.action(f.state?.exit)}),this.action(this.transition?.actions),y.forEach(f=>{const p=this.effect(f.state?.effects);if(p){const v=this.effects.get(f.path);this.effects.set(f.path,v?so(v,p):p)}}),g===As){this.action(e.entry);const f=this.effect(e.effects);if(f){const p=this.effects.get(As);this.effects.set(As,p?so(p,f):f)}}y.forEach(f=>{this.action(f.state?.entry)})}}));this.state=u,this.cleanups.push(Ha(this.state.ref,()=>this.notify()))}updateProps(e){const t=this.userPropsSources;if(lt(e))t.push(e);else if(t.length===0)this.userProps=ts(this.userProps,e);else{const n=t.length-1,s=t[n];if(lt(s)){const o=ts({},e);o&&Object.keys(o).length>0&&t.push(o)}else t[n]=ts(s,e)}this.notify()}start(){this.status=es.Started,this.debug("initializing..."),this.state.invoke(this.state.initial,As),this.setupTrackers()}stop(){this.effects.forEach(e=>e?.()),this.effects.clear(),this.transition=null,this.action(this.machine.exit),this.cleanups.forEach(e=>e()),this.cleanups=[],this.subscriptions=[],this.status=es.Stopped,this.debug("unmounting...")}get service(){return{state:this.getState(),send:this.send,context:this.context,prop:this.prop,scope:this.scope,refs:this.refs,computed:this.computed,event:this.getEvent(),getStatus:()=>this.status}}};const fg=W("chevron-down"),$t=new Map;let hg=0;function pg(e){const t=document.createElement("span");t.className="ui-select",t.innerHTML=`<button type="button" class="ui-select-trigger"><span></span>${fg}</button><div class="ui-select-positioner" popover="manual"><div class="ui-select-menu"></div></div>`,e.after(t),e.hidden=!0;const n=t.querySelector("button"),s=n.querySelector("span"),o=e.dataset.sourceIcons,r=w=>w?Pu(w,o):Cr("terminal");let i;o&&t.classList.add("ui-select-with-source");const a=t.querySelector(".ui-select-positioner"),c=t.querySelector(".ui-select-menu");let l=[],u="",d=e.value,g=e.disabled;const h=new pl(q1,{id:`select-${++hg}`,collection:oo({items:l}),defaultValue:[d],disabled:g,positioning:{placement:"bottom-start",strategy:"fixed",sameWidth:!0,gutter:6},onValueChange({value:w}){e.value!==w[0]&&(d=e.value=w[0]??"",e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}}),y=()=>h1(h.service,ul);function f(){const w=y();ie(t,w.getRootProps()),ie(n,{...w.getTriggerProps(),"aria-label":e.getAttribute("aria-label")||e.labels?.[0]?.textContent?.trim(),"aria-labelledby":void 0}),ie(a,w.getPositionerProps()),ie(c,{...w.getContentProps(),"aria-label":e.getAttribute("aria-label"),"aria-labelledby":void 0});const S=e.selectedOptions[0]?.textContent||"Choose…";if(s.textContent!==S&&(s.textContent=S),o&&i!==e.value){n.querySelector(".ui-select-source")?.remove();const M=r(e.value);M.classList.add("ui-select-source"),n.prepend(M),i=e.value}l.forEach((M,C)=>{const E=c.children[C];ie(E,w.getItemProps({item:M}))}),a.hidden=!w.open,w.open&&!a.matches(":popover-open")&&a.showPopover?.(),!w.open&&a.matches(":popover-open")&&a.hidePopover?.()}function p(){const w=Array.from(e.options,M=>({value:M.value,label:M.text,disabled:M.disabled})),S=JSON.stringify(w);S!==u&&(u=S,l=w,c.replaceChildren(...l.map(M=>{const C=document.createElement("div");if(C.className="ui-select-option",o){const b=r(M.value);b.classList.add("ui-select-source"),C.append(b)}const E=document.createElement("span");return E.textContent=M.label,C.append(E,Cr("check")),C})),h.updateProps({collection:oo({items:l})})),d!==e.value&&(d=e.value,y().setValue([d])),g!==e.disabled&&(g=e.disabled,h.updateProps({disabled:g})),f()}t.addEventListener("keydown",w=>w.stopPropagation()),e.addEventListener("change",p);const v=h.subscribe(f);return h.start(),p(),{sync:p,focus:()=>n.focus(),dispose(){e.removeEventListener("change",p),v(),h.stop(),t.remove(),e.hidden=!1}}}function hs(e=document){for(const[t,n]of $t)t.isConnected||(n.dispose(),$t.delete(t));for(const t of e.querySelectorAll("select:not([data-native])"))$t.has(t)?$t.get(t).sync():$t.set(t,pg(t))}function gg(e){hs(e.parentElement),$t.get(e)?.focus()}function mg(e=document.body){const t=new MutationObserver(n=>{n.some(s=>s.target instanceof Element&&(s.target.matches("select, option")||[...s.addedNodes,...s.removedNodes].some(o=>o instanceof Element&&(o.matches("select")||o.querySelector("select")))))&&hs(e)});return t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled"]}),hs(e),()=>{t.disconnect();for(const[n,s]of $t)(e.contains(n)||!n.isConnected)&&(s.dispose(),$t.delete(n))}}function yg(e){const t=document.createElement("dialog");t.className="launch-dialog",t.setAttribute("aria-labelledby","launch-heading"),t.innerHTML=`
12
+ <button class="icon-button dialog-close" aria-label="Close open session">${W("x")}</button>
13
+ <h2 id="launch-heading">Open session</h2><p class="launch-title"></p>
14
+ <label class="launch-destination">Open in<select aria-label="Open in">
15
+ ${Jn.map(m=>`<option value="${m.id}">${m.name}</option>`).join("")}
16
+ <option value="web">OpenCode · Web browser</option>
17
+ </select></label>
18
+ <section class="launch-web" hidden>
19
+ <a class="primary-button launch-web-link" target="_blank" rel="noopener noreferrer" hidden>Open in browser ${W("arrow-up-right")}</a>
20
+ <details class="launch-pairing"><summary>First time connecting?</summary><p>Run <code>opencode pair</code> in your terminal and open its pairing link once. Then open this session again.</p><button class="text-button launch-copy-pair">Copy pairing command</button></details>
21
+ </section>
22
+ <section class="launch-cli">
23
+ <label class="launch-directory-label">Working directory<input class="launch-directory" aria-label="Working directory" spellcheck="false" autocomplete="off"/></label>
24
+ <div class="launch-summary" hidden><strong class="launch-mode"></strong><p class="launch-hint"></p>
25
+ <details class="launch-context" hidden><summary>Saved context</summary><p class="launch-coverage"></p><code class="launch-context-path"></code></details>
26
+ </div>
27
+ <input class="launch-command" aria-label="CLI command" readonly spellcheck="false" placeholder="Preparing command…"/>
28
+ <div class="launch-actions"><button class="primary-button launch-terminal" disabled>Open Terminal ${W("arrow-up-right")}</button><button class="secondary-button launch-copy" disabled>Copy command ${W("copy")}</button></div>
29
+ <p class="launch-availability"></p>
30
+ </section>
31
+ <p class="launch-status" role="status"></p>`,document.body.append(t);const n=new AbortController,s={signal:n.signal},o=m=>t.querySelector(m),r=o("select"),i=o(".launch-directory"),a=o(".launch-web-link"),c=o(".launch-command"),l=o(".launch-terminal"),u=o(".launch-copy"),d=o(".launch-status");let g,h=0,y=0,f,p,v,w,S,M=null;function C(){y++,p?.abort(),clearTimeout(S),v=void 0,c.value="",l.disabled=u.disabled=!0,o(".launch-summary").hidden=!0,o(".launch-availability").textContent=""}function E(){t.close(),h++,f?.abort(),C(),e(),M?.focus({preventScroll:!0})}async function b(m){try{await navigator.clipboard.writeText(m),d.textContent="Command copied."}catch{d.textContent=`Copy this command: ${m}`,m===c.value&&(c.focus(),c.select())}}function k(){if(a.hidden=!0,a.removeAttribute("href"),g&&w?.webBaseUrl)try{a.href=Nu(w.webBaseUrl,g.nativeID||g.id),a.hidden=!1}catch{}d.textContent=w?a.hidden?"OpenCode is unavailable. Choose another app to use the saved conversation.":"":"Finding OpenCode…"}function P(m){const $=Jn.find(D=>D.id===r.value)?.name||Fe(r.value);c.value=m.command,u.disabled=!1,l.disabled=!m.terminalAvailable,l.textContent=`${m.mode==="resume"?"Resume in":"Open in"} ${$}`,l.insertAdjacentHTML("beforeend",W("arrow-up-right")),o(".launch-summary").hidden=!1,o(".launch-mode").textContent=m.mode==="resume"?"Resume original session":"New session · saved context",o(".launch-hint").textContent=m.mode==="resume"?`Continue this conversation in ${$}.`:`Start in ${$} with the saved conversation.`,o(".launch-context").hidden=!m.context,o(".launch-coverage").textContent=m.context?`${m.context.messages.toLocaleString()} / ${m.context.totalMessages.toLocaleString()} messages${m.context.partial?" · Partial history":""}`:"",o(".launch-context-path").textContent=m.context?.path||"",o(".launch-availability").textContent=m.targetAvailable?m.terminalAvailable?"":"Automatic terminal opening is unavailable. Run the copied command in your terminal.":`${$} CLI was not found. Install it, then run the copied command.`,d.textContent=""}async function T(){if(C(),!g||!t.open)return;const m=r.value==="web";if(o(".launch-web").hidden=!m,o(".launch-cli").hidden=m,m){k();return}if(!qo(r.value))return;const $=y;p=new AbortController,d.textContent="Preparing command…";try{const D=await Xe(`/api/sessiongraph/session/${encodeURIComponent(g.id)}/prepare-launch`,"Could not prepare this session.",{method:"POST",signal:AbortSignal.any([p.signal,AbortSignal.timeout(3e4)]),headers:{"Content-Type":"application/json","X-SessionGraph-Action":"prepare-launch"},body:JSON.stringify({target:r.value,directory:i.value})});if(y!==$)return;v=D,P(v)}catch(D){y===$&&(c.placeholder="Command unavailable",d.textContent=D instanceof Error?D.message:"Could not prepare this session.")}}return r.addEventListener("change",()=>{try{localStorage.setItem("sessiongraph.open-target",r.value)}catch{}T()},s),i.addEventListener("input",()=>{C(),d.textContent="Checking working directory…",S=setTimeout(()=>{T()},300)},s),i.addEventListener("change",()=>{T()},s),o(".dialog-close").addEventListener("click",E,s),t.addEventListener("cancel",m=>{m.preventDefault(),E()},s),t.addEventListener("keydown",m=>{m.stopPropagation()},s),u.addEventListener("click",()=>{v&&b(v.command)},s),o(".launch-copy-pair").addEventListener("click",()=>{b("opencode pair")},s),l.addEventListener("click",async()=>{if(!g||!v||l.disabled)return;const m=h;l.disabled=r.disabled=i.disabled=!0,d.textContent="Opening Terminal…";try{await Xe(`/api/sessiongraph/session/${encodeURIComponent(g.id)}/open-terminal`,"Could not open Terminal. Copy the command instead.",{method:"POST",signal:AbortSignal.timeout(3e4),headers:{"Content-Type":"application/json","X-SessionGraph-Action":"open-terminal"},body:JSON.stringify({target:r.value,directory:v.directory})}),h===m&&(d.textContent="Session sent to Terminal.")}catch($){h===m&&(d.textContent=$ instanceof Error?$.message:"Could not open Terminal. Copy the command instead.")}finally{h===m&&(r.disabled=i.disabled=!1,l.disabled=!v?.terminalAvailable)}},s),{async open(m){g=m;const $=++h;f?.abort(),f=new AbortController,w=void 0,C(),t.open||(M=document.activeElement),o(".launch-title").textContent=`${Fe(m.source)} · ${m.title}`,i.value=m.directory,i.disabled=r.disabled=!1,r.value=qo(m.source)?m.source:"opencode";const D=(!m.source||m.source==="opencode")&&bc(m.nativeID||m.id);r.querySelector('[value="web"]').disabled=!D;for(const H of Jn)r.querySelector(`[value="${H.id}"]`).textContent=H.name;try{const H=localStorage.getItem("sessiongraph.open-target")||localStorage.getItem("session-atlas.open-target")||localStorage.getItem("atlas.open-target");(qo(H)||H==="web"&&D)&&(r.value=H)}catch{}c.placeholder="Preparing command…",o(".launch-context").open=!1,t.open||t.showModal(),e(),gg(r),T();try{const H=await Xe(`/api/sessiongraph/session/${encodeURIComponent(m.id)}/connection`,"Could not check OpenCode.",{signal:AbortSignal.any([f.signal,AbortSignal.timeout(15e3)])});if(h!==$)return;w=H;for(const O of Jn){const F=H.targets.some(B=>B.id===O.id&&B.available);r.querySelector(`[value="${O.id}"]`).textContent=`${O.name}${F?"":" · CLI not found"}`}r.value==="web"&&k()}catch(H){h===$&&r.value==="web"&&(d.textContent=H instanceof Error?H.message:"Could not check OpenCode.")}},dispose(){h++,f?.abort(),C(),n.abort(),t.remove()}}}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,o){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 Ds,cn,Oe,ln,Rs,rr,Vs;const ja="__TAURI_TO_IPC_KEY__";function vg(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class fv{constructor(t){Ds.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=vg(n=>{const s=n.index;if("end"in n){s==fe(this,Oe,"f")?this.cleanupCallback():fn(this,Rs,s);return}const o=n.message;if(s==fe(this,Oe,"f")){for(fe(this,Ds,"m",rr).call(this,o),fn(this,Oe,fe(this,Oe,"f")+1);fe(this,Oe,"f")in fe(this,ln,"f");){const r=fe(this,ln,"f")[fe(this,Oe,"f")];fe(this,Ds,"m",rr).call(this,r),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]=o})}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,Ds=new WeakSet,rr=function(n){try{fe(this,cn,"f").call(this,n)}catch(s){queueMicrotask(()=>{throw s})}},ja)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[ja]()}}async function bi(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}class hv{get rid(){return fe(this,Vs,"f")}constructor(t){Vs.set(this,void 0),fn(this,Vs,t)}async close(){return bi("plugin:resources|close",{rid:this.rid})}async[(Vs=new WeakMap,Symbol.asyncDispose)](){await this.close()}}function vn(){return!!(globalThis||window).isTauri}const zs=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function gl(e,t={}){const n=e.pathHint||"Choose the harness history root, not its executable or project working directory.";return`${Du(e,t)}${e.pathSupported?`<details class="source-location"><summary>History location <span>${e.path?"Custom":"Automatic"}</span></summary>
32
+ <form class="source-location-form"><fieldset ${t.disabled?"disabled":""}>
33
+ <p class="source-location-hint">${zs(n)}</p>
34
+ <label>History path<input class="source-path" aria-label="${zs(e.name)} history path" value="${zs(e.path||"")}" placeholder="Automatic — paste an absolute path to override" spellcheck="false" autocomplete="off"/></label>
35
+ <div class="source-location-actions">${t.desktop?'<button type="button" class="secondary-button source-browse">Browse…</button>':""}<button type="submit" class="secondary-button">Save path</button><button type="button" class="text-button source-automatic">Automatic</button></div>
36
+ <p class="source-location-note">Only this harness is affected. Automatic restores environment/default discovery. Saving does not start an import or grant filesystem access.</p>
37
+ </fieldset></form><p class="source-location-status" role="status"></p></details>`:""}`}function bg(e,t={}){return`<div class="source-setting" data-source="${zs(e.id)}">${gl(e,t)}</div>`}async function wg(e,t,n){return(await Xe("/api/sessiongraph/sources/path","Could not save history location.",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"source-path"},body:JSON.stringify({source:e,path:t}),signal:n?AbortSignal.any([n,AbortSignal.timeout(3e4)]):AbortSignal.timeout(3e4)})).source}function ml(e,t){const n=new AbortController,s=vn();let o=!1,r=!1;const i=()=>e.querySelectorAll(".source-location-form fieldset").forEach(l=>{l.disabled=o||r});function a(l,u){l.querySelector(".source-location-status").textContent=u}async function c(l,u){if(o||r)return;if(u!==null&&!u.trim()){a(l,"Enter a history path, or choose Automatic.");return}const d=l.contains(document.activeElement);r=!0,i(),t.busy(!0),a(l,"Saving history location…");try{const g=await wg(l.dataset.source,u,n.signal);if(n.signal.aborted||!e.contains(l))return;const h=l.querySelector('input[type="checkbox"]').checked;l.innerHTML=gl(g,{settings:t.settings,desktop:s,checked:h,disabled:!0}),l.querySelector("details").open=!0,a(l,g.available?"Saved. Import selected sources to read this history.":"Saved, but no readable history was detected here. Check the expected folder and OS permissions before importing.")}catch(g){!n.signal.aborted&&e.contains(l)&&a(l,g instanceof Error?g.message:"Could not save history location.")}finally{r=!1,n.signal.aborted||(i(),t.busy(!1),d&&l.closest("dialog")?.open&&(document.activeElement===document.body||l.contains(document.activeElement))&&l.querySelector(".source-path")?.focus())}}return e.addEventListener("submit",l=>{const u=l.target;if(!u.matches(".source-location-form"))return;l.preventDefault();const d=u.closest(".source-setting");c(d,d.querySelector(".source-path").value)},{signal:n.signal}),e.addEventListener("click",async l=>{const u=l.target.closest(".source-automatic, .source-browse");if(!u||o||r)return;const d=u.closest(".source-setting");if(u.matches(".source-automatic")){c(d,null);return}r=!0,i(),t.busy(!0);try{const{open:g}=await ws(async()=>{const{open:y}=await import("./index-ClDHxy66.js");return{open:y}},[]),h=await g({title:"Choose harness history folder",directory:!0,multiple:!1});!n.signal.aborted&&e.contains(d)&&typeof h=="string"&&(d.querySelector(".source-path").value=h,a(d,"Folder chosen. Save path to apply it."))}catch(g){!n.signal.aborted&&e.contains(d)&&a(d,g instanceof Error?g.message:"Could not open the folder picker. Paste a path instead.")}finally{r=!1,n.signal.aborted||(i(),t.busy(!1))}},{signal:n.signal}),{option:(l,u=l.selected)=>bg(l,{settings:t.settings,desktop:s,checked:u,disabled:o||r}),setDisabled(l){o=l,i()},get busy(){return r},dispose(){n.abort()}}}const Cg=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]);function kg(e,t,n){const s=document.createElement("dialog");s.className="imports-dialog",s.setAttribute("aria-labelledby","imports-heading"),s.innerHTML=`<button class="icon-button dialog-close" aria-label="Close sources">${W("x")}</button><h2 id="imports-heading">Choose your session sources</h2><p class="imports-description">By default, Claude Code searches accessible folders across this computer, including other users’ readable histories. Only selected sources are imported. Custom history paths restrict the search.</p><div class="import-sources"></div><div class="imports-progress" role="status"></div><details class="imports-notes" hidden><summary>Import details</summary><div></div></details><footer><button class="primary-button import-start">Import sessions</button></footer>`,document.body.append(s);const o=m=>s.querySelector(m);let r=!1,i=0,a=!1,c=null,l=!1,u=!1,d=!1;const g=new AbortController;let h=!1,y=0,f=!1,p=!1,v=!1,w=!1;const S=ml(o(".import-sources"),{busy(m){w=m,M()}});function M(){const m=s.querySelectorAll("input:checked").length;o(".import-start").disabled=r||l||f||w,o(".import-start").textContent=r||l?"Importing…":w?"Saving location…":f?"Finding sources…":p?h?m?"Import & continue →":"Continue without importing →":"Import updates ↗":"Try again",s.querySelectorAll('input[type="checkbox"]').forEach($=>{$.disabled=r||l||w}),S.setDisabled(r||l||f)}async function C(m,$){try{const D=m==="sources"?"Could not load sources.":$?.method==="POST"?"Could not start the import.":"Could not load import status.";return await Xe(`/api/sessiongraph/${m}`,D,{...$,signal:AbortSignal.any([g.signal,AbortSignal.timeout(3e4)])})}catch(D){if(D instanceof Tt&&D.code==="IMPORT_RUNNING"&&$?.method==="POST")return C("import");throw D}}function E(m){r=m.running,M(),o(".imports-progress").textContent=r?`${m.source?Fe(m.source):"Importing"} · ${m.imported.toLocaleString()} imported · ${m.unchanged.toLocaleString()} unchanged${m.discovered?` / ${m.discovered.toLocaleString()} found`:" · discovering…"}`:`${m.imported.toLocaleString()} imported · ${m.unchanged.toLocaleString()} already up to date${m.failed?` · ${m.failed} unavailable`:""}`;const $=[...m.errors,...m.warnings||[]];o(".imports-notes").hidden=!$.length,o(".imports-notes div").innerHTML=$.map(D=>`<p>${Cg(D)}</p>`).join(""),document.dispatchEvent(new CustomEvent("sessiongraph-import-status",{detail:m}))}async function b(){if(!(a||u)){i=0,u=!0;try{const m=await C("import");if(a)return;if(E(m),m.running)i=window.setTimeout(b,1e3);else{const $=v;v=!1,await e(d),!a&&!d&&!s.open&&m.failed?n(m.errors[0]||"Import failed."):!a&&$&&!m.failed&&n(m.imported+m.unchanged?"Your sessions are ready to explore.":"No conversations found. Choose other sources in Manage sources.")}}catch(m){k(m)}finally{u=!1}}}function k(m){if(a)return;v=!1;const $=m instanceof Error?m.message:"Import unavailable.";E({running:!1,discovered:0,imported:0,unchanged:0,failed:1,errors:[$]}),o(".imports-progress").textContent=$,!s.open&&!d&&n($)}async function P(m,$=!1){if(a||w||$&&s.open)return;if(r||l||u||i){!$&&!s.open&&T();return}l=!0,d=$,r=!0,M();const D=h&&s.open&&m!==void 0,H=y;try{const O=await C("import",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"import"},body:JSON.stringify($?{automatic:!0}:{sources:m})});if(a||(E(O),D&&(v=!!m?.length,y===H&&s.open&&s.close(),m?.length&&n("Import started. You can explore the map as soon as your sessions are ready."),await e(!0)),a))return;window.clearTimeout(i),i=window.setTimeout(b,100)}catch(O){k(O)}finally{l=!1,a||M()}}async function T(m=!1){if(w)return;h=m;const $=++y;f=!0,p=!1,c=document.activeElement,o("#imports-heading").textContent=m?"Choose your session sources":"Your session sources",m&&(o(".imports-progress").textContent="",o(".imports-notes").hidden=!0),M(),s.open||s.showModal(),t(),o(".import-sources").textContent="Finding local session sources…";try{const D=await C("sources");if(a||$!==y)return;o(".import-sources").innerHTML=vc(D.sources).map(O=>S.option(O,O.selected||m&&O.available&&O.capabilities.history)).join(""),p=!0;const H=await C("import");if(a||$!==y)return;H.running?(E(H),window.clearTimeout(i),i=window.setTimeout(b,1e3)):m||E(H)}catch(D){!a&&$===y&&(p=!1,o(".import-sources").textContent=D instanceof Error?D.message:"Could not detect sources.")}finally{!a&&$===y&&(f=!1,M())}}return o(".import-sources").addEventListener("change",M),o(".import-start").addEventListener("click",()=>{p?P([...s.querySelectorAll("input:checked")].map(m=>m.value)):T(h)}),o(".dialog-close").addEventListener("click",()=>s.close()),s.addEventListener("close",()=>{y++,f=!1,t(),c?.focus()}),s.addEventListener("keydown",m=>m.stopPropagation()),{open:T,sources:async()=>(await C("sources")).sources,select:m=>P(m),get busy(){return r||l||u||w||!!i},refresh:(m=!1)=>P(void 0,m),resume:()=>{d=!0,r=!0,window.clearTimeout(i),b()},dispose:()=>{a=!0,S.dispose(),g.abort(),window.clearTimeout(i),s.remove()}}}const Eg=6e4,Sg=3e4;class xg{constructor(t,n=Date.now){this.options=t,this.now=n}options;now;lastActivity=-1/0;checking=!1;disposed=!1;activity(){this.lastActivity=this.now()}async check(){if(!(this.disposed||this.checking||!this.options.eligible()||this.options.busy()||this.now()-this.lastActivity<Sg)){this.checking=!0,this.activity();try{await this.options.refresh()}finally{this.checking=!1}}}dispose(){this.disposed=!0}}class $g{constructor(t,n){this.write=t,this.changed=n}write;changed;revision=0;state="saved";error;queued;task;disposed=!1;get pending(){return!!(this.queued||this.task)}set(t,n){this.state=t,this.error=n,this.disposed||this.changed(t)}save(t){this.disposed||(this.revision++,this.queued={...this.queued,...t},this.set("saving"),this.flush())}flush(){if(this.task)return this.task;if(this.disposed||!this.queued)return Promise.resolve();const t=this.queued;return this.queued=void 0,this.set("saving"),this.task=Promise.resolve().then(()=>this.write(t)).then(()=>{if(this.task=void 0,this.queued)return this.flush();this.set("saved")},n=>{this.queued={...t,...this.queued},this.task=void 0,this.set("error",n instanceof Error?n.message:void 0)}),this.task}dispose(){this.disposed=!0}}const wi=Object.freeze({sourceID:"",projectID:"",directory:"",days:"ytd",fromDate:"",toDate:"",includeChildren:!0,includeArchived:!1}),Lg=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,10)===e;function Ig(e){const t={...wi};if(!e||typeof e!="object"||Array.isArray(e))return t;const n=e;for(const s of["sourceID","projectID","directory"])typeof n[s]=="string"&&n[s].length<=4096&&(t[s]=n[s]);(n.days==="ytd"||[0,7,30,90].includes(n.days))&&(t.days=n.days);for(const s of["includeChildren","includeArchived"])typeof n[s]=="boolean"&&(t[s]=n[s]);for(const s of["fromDate","toDate"])Lg(n[s])&&(t[s]=n[s]);return t.fromDate&&t.toDate&&t.fromDate>t.toDate&&(t.fromDate="",t.toDate=""),t}function yl(e,t=Date.now()){const n=new Date(t),s=e.days==="ytd"?new Date(n.getFullYear(),0,1).getTime():e.days?t-e.days*864e5:0,o=e.days==="ytd"?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999).getTime():1/0;return{min:e.fromDate?new Date(`${e.fromDate}T00:00:00`).getTime():s,max:e.toDate?new Date(`${e.toDate}T23:59:59.999`).getTime():o}}const Tg=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0;function vl(e,t={}){const n=e.filter(a=>Tg(a.tokens)),s=n.filter(a=>Number.isFinite(a.activity?.lastMessageAt)&&a.activity.lastMessageAt>0).sort((a,c)=>Math.max(a.created,a.activity.lastMessageAt)-Math.max(c.created,c.activity.lastMessageAt)),o=[],r=[0];for(const a of s)o.push(Math.max(a.created,a.activity.lastMessageAt)),r.push(r.at(-1)+a.tokens);const i=n.reduce((a,c)=>a+c.tokens,0);return{recorded:n.length,missing:e.length-n.length,partial:n.filter(a=>a.usage?.partial).length,untimed:n.length-s.length,at(a,c=!1){if(c)return{tokens:i,sessions:n.length};let l=0,u=o.length;for(;l<u;){const d=l+u>>>1;o[d]<=a?l=d+1:u=d}return{tokens:r[l],sessions:l}}}}const Ci=15e3,ps=5e3,bl=1e3,ki=30,Br=Ci/1e3*ki,pv=(Ci+ps+bl)/1e3*ki,gv=e=>Math.min(1,e/(Br-1)),mv=e=>e<Br?null:Math.min(1,(e-Br+1)/(ps/1e3*ki));function yv(e,t=0){const n=Math.max(0,Math.min(1,e)),s=.2,o=.34,r=Math.max(0,Math.min(1,t*ps/1e3)),i=(1-r*s/2)/(1-(s+o)/2),a=c=>c**3-c**4/2;return n<s?r*n+(i-r)*s*a(n/s):n>1-o?1-i*o*a((1-n)/o):i*(n-s/2)+r*s/2}const Mg=new Intl.DateTimeFormat("en",{month:"short",year:"numeric"}),Ag=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}),Og=(e,t)=>(t>=90*864e5?Mg:Ag).format(e);function Pg(e,t,n,s=70){const o=new Array(s).fill(0),r=Math.max(1,n-t);for(const i of e)o[Math.max(0,Math.min(s-1,Math.floor((i-t)/r*s)))]++;return o}function wl(e){const t=e.map(n=>n.created).sort((n,s)=>n-s);return(n,s=!1)=>{if(s)return t.length;let o=0,r=t.length;for(;o<r;){const i=o+r>>>1;t[i]<=n?o=i+1:r=i}return o}}function Dg(e,t={},{showCoverage:n=!0}={}){const s=r=>`data-playback="${r}"${t[r]?` id="${t[r]}"`:""}`,o=W("play");return`<div class="timeline-top">${e}</div>
38
+ <div class="timeline-track"><button type="button" class="play-button" ${s("play")} aria-label="Play timeline">${o}</button><div class="histogram-wrap"><div class="histogram" ${s("histogram")} aria-hidden="true"></div><input ${s("scrubber")} type="range" min="0" max="1000" value="1000" aria-label="Timeline playback position"><div class="timeline-cursor" ${s("cursor")}></div></div><output class="playback-date" ${s("date")}>—</output></div>
39
+ <div class="playback-period" ${s("period")} aria-label="Playback position">—</div>
40
+ <div class="playback-summary" ${s("summary")} hidden><span><strong ${s("sessions")}>0</strong><span>Sessions</span></span><span data-token-total><strong ${s("tokens")}>—</strong><span>Burnt tokens</span></span>${n?`<small ${s("coverage")}></small>`:""}</div>`}function Rg(e,t){return!t||e.source===t||!!(e.source==="t3-code"&&e.linkedSessionIDs?.some(n=>n.startsWith(`${t}:`)))}const Do=Object.freeze({autoImport:!1,muted:!1,clickSounds:!0,clickVolume:35,motion:"system",grouping:"worktree",density:"comfortable",panelOpacity:90,quality:"balanced",bloom:32,stars:!0,labels:!0,nodeScale:100,focusDimming:!0,trails:"all",trailOpacity:34,trailFlow:!1,trailSpeed:25,relationships:!0,messageDots:!0,playbackSpeed:1}),Ei="sessiongraph.preferences",_a={motion:["system","on","off"],grouping:["repository","worktree"],density:["comfortable","compact"],quality:["performance","balanced","high"],trails:["all","selected","off"]},Ba={clickVolume:[0,100],panelOpacity:[55,100],bloom:[0,75],nodeScale:[60,180],trailOpacity:[0,100],trailSpeed:[10,100],playbackSpeed:[.25,3]};function Ro(e){const t={...Do};if(!e||typeof e!="object"||Array.isArray(e))return t;const n=e;for(const s of Object.keys(t)){const o=n[s];if(s in _a)_a[s].includes(o)&&Object.assign(t,{[s]:o});else if(s in Ba){const[r,i]=Ba[s];typeof o=="number"&&Number.isFinite(o)&&Object.assign(t,{[s]:Math.max(r,Math.min(i,o))})}else typeof o=="boolean"&&Object.assign(t,{[s]:o})}return t}function Cl(e){try{const t=JSON.parse(e.getItem(Ei)||e.getItem("session-atlas.preferences")||"null");return Ro(t?.version===1?t.values:void 0)}catch{return{...Do}}}function kl(e,t){try{return e.setItem(Ei,JSON.stringify({version:1,values:Ro(t)})),!0}catch{return!1}}const Vg=(e,t)=>e.motion==="on"||e.motion==="system"&&!t,rt=[["interface","Interface","panels"],["sources","Sources","database"],["audio","Sound","volume-2"],["graphics","Graphics","sparkles"],["trails","Trails & playback","orbit"],["privacy","Privacy","lock"]],it=(e,t,n)=>`<label class="setting-row"><span><strong>${t}</strong><small>${n}</small></span><input type="checkbox" role="switch" data-pref="${e}" aria-label="${t}"/></label>`,Ut=(e,t,n,s,o,r="%",i=1)=>`<label class="setting-row setting-range"><span><strong>${t}</strong><small>${n}</small></span><span class="setting-slider"><input type="range" data-pref="${e}" aria-label="${t}" min="${s}" max="${o}" step="${i}"/><output data-output="${e}" data-unit="${r}"></output></span></label>`,Un=(e,t,n,s)=>`<label class="setting-row"><span><strong>${t}</strong><small>${n}</small></span><select data-pref="${e}" aria-label="${t}">${s.map(([o,r])=>`<option value="${o}">${r}</option>`).join("")}</select></label>`;function Ng(e){const t=document.createElement("dialog");t.className="settings-dialog",t.setAttribute("aria-labelledby","settings-title"),t.innerHTML=`<header class="settings-heading"><div><h2 id="settings-title">Settings</h2><p>Import, appearance, and playback preferences.</p></div><button class="icon-button settings-close" aria-label="Close settings">${W("x")}</button></header>
41
+ <div class="settings-layout"><nav class="settings-tabs" role="tablist" aria-label="Settings categories">${rt.map(([p,v,w],S)=>`<button role="tab" id="settings-tab-${p}" aria-controls="settings-${p}" aria-selected="${!S}" tabindex="${S?-1:0}" data-tab="${p}">${W(w)}${v}</button>`).join("")}</nav>
42
+ <div class="settings-content">
43
+ <section id="settings-interface" role="tabpanel" aria-labelledby="settings-tab-interface"><h3>Interface</h3><p class="settings-description">View preferences and filters are saved with your library.</p>
44
+ ${Un("grouping","Cluster sessions by","Worktree keeps checkouts separate. Repository combines them. Both use the session directory when Git metadata is unavailable.",[["worktree","Worktree / Directory"],["repository","Repository"]])}
45
+ ${Un("motion","Motion","Camera transitions, reveals, and ambient movement.",[["system","Follow system"],["on","On"],["off","Off"]])}
46
+ ${Un("density","Session list","Adjust spacing between sessions.",[["comfortable","Comfortable"],["compact","Compact"]])}
47
+ <label class="setting-row"><span><strong>Show archived sessions</strong><small>Include archived history in the map and session list.</small></span><input class="settings-archived" type="checkbox" role="switch" aria-label="Show archived sessions"/></label>
48
+ ${Ut("panelOpacity","Panel opacity","Adjust panel background transparency.",55,100)}
49
+ </section>
50
+ <section id="settings-sources" role="tabpanel" aria-labelledby="settings-tab-sources" hidden><h3>Sources</h3><p class="settings-description">Choose the local apps to import. Expand History location under any harness to override its automatic discovery. Importing is read-only.</p>
51
+ ${it("autoImport","Auto-import sessions","Check selected sources on startup, on return, and every minute while visible.")}
52
+ <div class="settings-sources-list import-sources"></div>
53
+ <div class="settings-import-progress" role="status"></div>
54
+ <div class="settings-note"><span>Selections apply when you import. History locations save separately. Previously saved history is kept.</span><button class="secondary-button settings-import" disabled>Import selected sources</button></div>
55
+ </section>
56
+ <section id="settings-audio" role="tabpanel" aria-labelledby="settings-tab-audio" hidden><h3>Sound</h3><p class="settings-description">Interaction sounds are synthesized locally.</p>
57
+ ${it("muted","Mute all sound","Silence everything. Your volume levels are kept.")}
58
+ ${it("clickSounds","Interaction sounds","A soft tick for controls; a chime for sessions.")}
59
+ ${Ut("clickVolume","Interaction volume","Adjust interaction sound volume.",0,100)}
60
+ <div class="settings-note"><span class="settings-audio-status" role="status">Sound starts after your first interaction.</span><button class="secondary-button settings-preview" data-sound="none">Preview chime</button></div>
61
+ <p class="settings-footnote">Audio pauses while this tab is hidden. The speaker button on the map is a quick mute.</p>
62
+ </section>
63
+ <section id="settings-graphics" role="tabpanel" aria-labelledby="settings-tab-graphics" hidden><h3>Graphics</h3><p class="settings-description">Adjust rendering quality and map appearance.</p>
64
+ ${Un("quality","Render quality","Performance uses 1× resolution and skips post-process effects.",[["performance","Performance"],["balanced","Balanced"],["high","High fidelity"]])}
65
+ ${Ut("bloom","Glow strength","Soft light around bright nodes; disabled in Performance.",0,75)}
66
+ ${Ut("nodeScale","Node size","Scale the lights without changing their positions.",60,180)}
67
+ ${it("stars","Starfield","A faint field of stars behind the timeline.")}
68
+ ${it("labels","Map labels","Month labels, cluster names, and the selected session title.")}
69
+ ${it("focusDimming","Focus dimming","Dim surrounding nodes when a session is selected.")}
70
+ </section>
71
+ <section id="settings-trails" role="tabpanel" aria-labelledby="settings-tab-trails" hidden><h3>Trails &amp; playback</h3><p class="settings-description">Trails start at creation and end at the latest recorded message.</p>
72
+ ${Un("trails","Session trails","Choose how much history to draw on the map.",[["all","All sessions"],["selected","Selected session"],["off","Hidden"]])}
73
+ ${Ut("trailOpacity","Trail brightness","Fade lifetime trails into the background.",0,100)}
74
+ ${it("trailFlow","Flowing trails","A decorative pulse along each lifetime; respects Motion.")}
75
+ ${Ut("trailSpeed","Flow speed","How quickly the light travels along the trails.",10,100)}
76
+ ${it("relationships","Relationship links","Show recorded fork and child connections.")}
77
+ ${it("messageDots","Message dots","User and assistant messages, colored to match the selected session.")}
78
+ ${Ut("playbackSpeed","Playback speed","1× plays the full timeline in 15 seconds.",.25,3,"×",.25)}
79
+ <p class="settings-footnote">Flow is decorative. Message dots reflect saved timestamps; visual settings never alter your history.</p>
80
+ </section>
81
+ <section id="settings-privacy" role="tabpanel" aria-labelledby="settings-tab-privacy" hidden><h3>Privacy</h3><p class="settings-description">Local storage and network access.</p>
82
+ <div class="settings-note"><span><strong>Public profile</strong><br>Choose which usage fields to share. Nothing uploads until you review a preview and publish.</span><button class="secondary-button settings-publishing">Publishing settings</button></div>
83
+ <div class="setting-row"><span><strong>Processed on this computer</strong><small>Importing, indexing, search, and visualization run locally. Imports read your selected sources without changing them or starting an AI agent.</small></span></div>
84
+ <div class="setting-row"><span><strong>Update checks use the internet</strong><small>Desktop update checks and downloads contact GitHub without session content. npm installation contacts its registry. These services receive ordinary connection metadata, including your public IP address.</small></span></div>
85
+ <div class="setting-row"><span><strong>Continuing a session is your choice</strong><small>Explicitly launching another harness lets it read the selected context. It may contact its model provider under its own privacy settings.</small></span></div>
86
+ <div class="setting-row"><span><strong>Local storage is not encrypted by SessionGraph</strong><small>Saved conversations, search text, and handoff files rely on your device's access controls. Disk encryption and backup or sync settings affect confidentiality. Deselecting a source keeps previously imported history.</small></span></div>
87
+ </section>
88
+ </div></div><footer class="settings-footer"><span class="settings-save-status" role="status">Changes save automatically on this device.</span><button class="text-button settings-reset">Restore defaults</button><button class="primary-button settings-done">Done</button></footer>`,document.body.append(t);const n=new AbortController,s={signal:n.signal},o=t.querySelector(".settings-archived");o.addEventListener("change",()=>e.changeArchived(o.checked),s);let r=null,i=0,a=!1,c=!1,l="interface",u=!1;const d=()=>{t.querySelectorAll(".settings-source, .settings-import").forEach(p=>{p.disabled=a||c||u}),g.setDisabled(a||c),t.querySelector(".settings-source")||(t.querySelector(".settings-import").disabled=!0)},g=ml(t.querySelector(".settings-sources-list"),{settings:!0,busy(p){u=p,d()}});async function h(){if(u)return;const p=++i;a=!0,d();const v=t.querySelector(".settings-sources-list");v.textContent="Finding local session sources…";try{const w=await e.getSources();if(n.signal.aborted||p!==i)return;v.innerHTML=vc(w).map(S=>g.option(S)).join("")}catch(w){if(n.signal.aborted||p!==i)return;v.textContent=w instanceof Error?w.message:"Could not detect sources.";const S=document.createElement("button");S.className="secondary-button",S.textContent="Retry",S.addEventListener("click",()=>{h()},s),v.append(S)}finally{p===i&&!n.signal.aborted&&(a=!1,d(),t.querySelector(".settings-import").disabled||=!v.querySelector(".settings-source"))}}t.querySelector(".settings-import").addEventListener("click",async()=>{const p=[...t.querySelectorAll(".settings-source:checked")].map(v=>v.value);c=!0,d(),t.querySelector(".settings-import-progress").textContent="Starting import…";try{await e.importSources(p)}catch(v){c=!1,d(),t.querySelector(".settings-import-progress").textContent=v instanceof Error?v.message:"Import unavailable."}},s);const y=()=>t.close();t.querySelector(".settings-publishing").addEventListener("click",()=>{t.close(),e.publishing()},s);for(const p of[".settings-close",".settings-done"])t.querySelector(p).addEventListener("click",y,s);t.addEventListener("close",()=>{e.visibility(),r?.focus({preventScroll:!0})},s),t.addEventListener("keydown",p=>{p.stopPropagation()},s);function f(p){l=p;for(const[v]of rt){const w=t.querySelector(`[data-tab="${v}"]`);w.setAttribute("aria-selected",String(v===p)),w.tabIndex=v===p?0:-1,t.querySelector(`#settings-${v}`).hidden=v!==p}t.querySelector(".settings-content").scrollTop=0,t.open&&l==="sources"&&h()}for(const p of t.querySelectorAll("[data-tab]"))p.addEventListener("click",()=>f(p.dataset.tab),s),p.addEventListener("keydown",v=>{const w=rt.findIndex(([M])=>M===p.dataset.tab),S=v.key==="Home"?0:v.key==="End"?rt.length-1:["ArrowRight","ArrowDown"].includes(v.key)?(w+1)%rt.length:["ArrowLeft","ArrowUp"].includes(v.key)?(w+rt.length-1)%rt.length:-1;S<0||(v.preventDefault(),f(rt[S][0]),t.querySelector(`[data-tab="${rt[S][0]}"]`).focus())},s);return t.addEventListener("input",p=>{const v=p.target,w=v.dataset.pref;if(!w)return;const S=v.type==="checkbox"?v.checked:v.type==="range"?Number(v.value):v.value;e.change({[w]:S})},s),t.querySelector(".settings-preview").addEventListener("click",e.previewSound,s),t.querySelector(".settings-reset").addEventListener("click",()=>{e.changeArchived(!1),e.change({...Do})},s),{open(p){t.open&&!p||(p&&f(p),t.open||(o.checked=e.getArchived(),r=document.activeElement,t.showModal(),e.visibility(),l==="sources"&&h()),t.querySelector('[aria-selected="true"]').focus())},importStatus(p){const v=c;c=p.running,d(),t.querySelector(".settings-import-progress").textContent=p.running?`Importing · ${p.imported.toLocaleString()} saved`:`${p.imported.toLocaleString()} imported · ${p.unchanged.toLocaleString()} unchanged${p.failed?` · ${p.failed} unavailable`:""}${p.errors.length?` · ${p.errors[0]}`:""}`,v&&!p.running&&t.open&&l==="sources"&&h()},render(p,v,w="saved",S){o.checked=e.getArchived();for(const M of t.querySelectorAll("[data-pref]")){const C=M.dataset.pref;M.type==="checkbox"?M.checked=!!p[C]:M.value=String(p[C]);const E=t.querySelector(`[data-output="${C}"]`);E&&(E.value=`${p[C]}${E.dataset.unit}`),M.disabled=C==="bloom"&&p.quality==="performance"||C==="trailSpeed"&&(!p.trailFlow||p.trails==="off"||p.motion==="off")}t.querySelector(".settings-save-status").textContent=w==="saving"?"Saving preferences…":w==="error"?S||"Could not save preferences.":v?"Saved on this device.":"Preferences storage is unavailable.",t.querySelector(".settings-preview").disabled=p.muted||!p.clickSounds||!p.clickVolume,hs(t)},audioStatus(p){t.querySelector(".settings-audio-status").textContent=p},dispose(){n.abort(),g.dispose(),t.remove()}}}class Fg{constructor(t,n,s=document){this.preferences=t,this.status=n;const o={signal:this.events.signal},r=i=>s!==document||!i.target?.closest?.("[data-graph-audio]");s.addEventListener("click",i=>{if(!i.isTrusted||!r(i))return;const a=i.target?.closest('button, a[href], summary, input[type="checkbox"], [role="option"]');!a||a.matches(":disabled")||a.closest('[data-sound="none"]')||this.play(a.matches('[data-session], [data-related], [role="option"]')?"select":"click")},o),s.addEventListener("change",i=>{i.isTrusted&&r(i)&&i.target?.matches('select, input[type="range"]')&&this.play("click")},o),s.addEventListener("pointerdown",i=>{i.isTrusted&&r(i)&&(this.interacted=!0,this.unlock())},{...o,passive:!0}),s.addEventListener("keydown",i=>{const{repeat:a,key:c}=i;i.isTrusted&&r(i)&&!a&&["Enter"," ","ArrowUp","ArrowDown"].includes(c)&&(this.interacted=!0,this.unlock())},o),document.addEventListener("visibilitychange",()=>this.sync(),o),window.addEventListener("pagehide",()=>{this.active=!1,this.sync()},o),window.addEventListener("pageshow",()=>{this.active=!0,this.sync()},o)}preferences;status;context;master;analyser;voices=new Set;events=new AbortController;disposed=!1;unavailable=!1;clicks=0;lastClick=0;suspendTimer;active=!0;interacted=!1;enabled(){return!this.preferences.muted&&this.preferences.clickSounds&&this.preferences.clickVolume>0}async unlock(){if(!(this.disposed||document.hidden||!this.active||!this.enabled()))try{if(!this.context){this.context=new AudioContext,this.master=this.context.createGain(),this.master.gain.value=0;const t=this.context.createDynamicsCompressor();t.threshold.value=-12,t.ratio.value=6,this.analyser=this.context.createAnalyser(),this.analyser.fftSize=256,this.master.connect(t).connect(this.analyser).connect(this.context.destination),this.context.addEventListener("statechange",()=>this.report(),{signal:this.events.signal})}this.context.state==="suspended"&&await this.context.resume(),this.disposed||this.sync()}catch{this.unavailable=!0,this.report()}}ramp(t,n,s=.15){const o=this.context.currentTime;t.cancelScheduledValues(o),t.setTargetAtTime(n,o,s)}cleanup(t){t.nodes.forEach(n=>n.disconnect()),this.voices.delete(t)}sync(){clearTimeout(this.suspendTimer);const t=this.context;if(!t||this.disposed){this.report();return}const n=this.enabled()&&!document.hidden&&this.active;if(n&&t.state==="suspended"&&t.resume().catch(()=>{this.unavailable=!0,this.report()}),this.ramp(this.master.gain,n?.7:0,.035),!n){const s=()=>{for(const o of this.voices)o.sources.forEach(r=>{try{r.stop()}catch{}}),this.cleanup(o);t.suspend().catch(()=>{})};document.hidden||!this.active?s():this.suspendTimer=setTimeout(s,180)}this.report()}report(){this.status(this.unavailable?"Audio is unavailable in this browser.":this.preferences.muted?"All sound is muted.":document.hidden||!this.active?"Audio paused while the app is hidden.":this.context?.state==="running"?"Audio is ready · pauses automatically in the background.":"Click a control or preview to start audio.")}configure(t){this.preferences=t,this.sync(),!this.context&&this.interacted&&this.unlock()}async play(t="click"){await this.unlock();const n=this.context;if(this.disposed||!n||n.state!=="running"||document.hidden||!this.active||this.preferences.muted||!this.preferences.clickSounds||!this.preferences.clickVolume||performance.now()-this.lastClick<45)return;this.lastClick=performance.now(),this.clicks++;const s=n.createGain(),o=n.createOscillator(),r=n.currentTime;o.type="sine",o.frequency.setValueAtTime(t==="select"?660:900,r),o.frequency.exponentialRampToValueAtTime(t==="select"?990:420,r+.065),s.gain.setValueAtTime(0,r),s.gain.linearRampToValueAtTime(this.preferences.clickVolume/100*.12,r+.004),s.gain.exponentialRampToValueAtTime(1e-4,r+(t==="select"?.19:.065)),o.connect(s).connect(this.master);const i={gain:s,sources:[o],nodes:[o,s]};this.voices.add(i),o.onended=()=>this.cleanup(i),o.start(),o.stop(r+.22)}diagnostics(){const t=new Float32Array(256);return this.analyser?.getFloatTimeDomainData(t),{state:this.context?.state||"unstarted",muted:this.preferences.muted,voices:this.voices.size,clicks:this.clicks,rms:Math.sqrt(t.reduce((n,s)=>n+s*s,0)/t.length)}}dispose(){this.disposed=!0,this.events.abort(),clearTimeout(this.suspendTimer);for(const t of this.voices)t.sources.forEach(n=>{try{n.stop()}catch{}}),this.cleanup(t);this.context?.close().catch(()=>{})}}const vv=e=>e.kind==="message"&&(e.role==="user"||e.role==="assistant"),El=e=>e.kind==="commit"?"#ffd580":e.kind==="message"?e.role==="user"?"#b0e9d6":"#9bbcff":e.kind.startsWith("tool_")?"#eac594":"#d7a1f1",Sl=e=>e.kind==="message"?e.role==="user"?"You":e.role==="assistant"?"Assistant":"Message":{tool_call:"Tool call",tool_result:"Tool result",reasoning:"Reasoning",compaction:"Compaction",file_change:"File change",error:"Error",event:"Event",commit:"Commit"}[e.kind],Se=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]),Hg=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}),qa=e=>e===null?"Time not recorded":Hg.format(e),Ua=e=>`<span class="event-badge" style="--event-color:${El(e)}">${Sl(e)}</span>`;function Wg(e,t,n){const s=document.createElement("aside");s.className="event-panel glass",s.id="message-panel",s.hidden=!0,s.setAttribute("aria-labelledby","event-title"),s.innerHTML=`<header class="event-heading"><h2 id="event-title">Messages</h2><button class="icon-button event-close" aria-label="Close message details">${W("x")}</button></header>
89
+ <div class="event-detail-nav"><button class="secondary-button" data-step="previous" aria-label="Previous message" title="Previous message (← / ↑)">← Previous</button><span class="event-position" role="status"></span><button class="secondary-button" data-step="next" aria-label="Next message" title="Next message (→ / ↓)">Next →</button></div>
90
+ <div class="event-scroll"><article class="event-content" aria-label="Message details" tabindex="0"></article>
91
+ <details class="event-browser"><summary>Browse messages <span class="event-count"></span></summary>
92
+ <nav class="event-list" aria-label="Session messages"></nav><div class="event-pagination"><button class="secondary-button" data-page="previous">← Earlier page</button><button class="secondary-button" data-page="next">Later page →</button></div>
93
+ </details>
94
+ </div><footer class="event-footer"><span class="event-coverage"></span><button class="text-button event-reload">Reload</button></footer>`,e.append(s);const o=b=>s.querySelector(b),r=new AbortController;let i,a,c,l,u="messages",d=!1,g,h,y={};const f=(b,k)=>`<button class="event-row" data-event="${Se(b.id)}" aria-current="${c?.selected?.id===b.id?"true":"false"}"><span class="event-row-top">${Ua(b)}<small>#${c.offset+k+1}</small></span><span class="event-preview">${Se(b.preview||"No text recorded")}</span><time>${qa(b.time)}</time></button>`;function p(){!c||!o(".event-browser").open||(o(".event-list").innerHTML=c.items.map(f).join("")||'<p class="event-empty">No saved messages.</p>')}function v(){if(!c)return;o(".event-count").textContent=`${c.total.toLocaleString()} ${u==="tools"?"tool events":"messages"}${c.partial?" · partial coverage":""}`,p();for(const k of["previous","next"])o(`[data-page="${k}"]`).disabled=!c[`${k}Cursor`];o(".event-coverage").textContent=c.partial?"Partial history":"Saved locally";const b=c.selected;o(".event-position").textContent=b?`${c.offset+c.items.findIndex(k=>k.id===b.id)+1} / ${c.total}`:"No messages";for(const k of["previous","next"])o(`[data-step="${k}"]`).disabled=!c[`${k}Item`];if(!b){o(".event-content").innerHTML='<div class="event-empty"><h3>No messages yet.</h3><p>Refresh the source to import saved user and assistant messages.</p></div>',n.select(null);return}n.select(b),o(".event-content").innerHTML=`<div class="event-detail-heading">${Ua(b)}<h3>${Se(b.name)}</h3><p>${qa(b.time)}</p></div>
95
+ ${b.partial?'<p class="event-warning">Partial message</p>':""}
96
+ ${b.text?`<section class="event-payload"><pre>${Se(b.text)}</pre></section>`:""}
97
+ ${b.input?`<section class="event-payload"><h4>Input</h4><pre>${Se(b.input)}</pre></section>`:""}
98
+ ${b.output?`<section class="event-payload"><h4>Result</h4><pre>${Se(b.output)}</pre></section>`:""}
99
+ ${b.cwd?`<p>Execution directory: <code>${Se(b.cwd)}</code></p>`:""}${b.exitCode!==void 0?`<p>Exit code: ${b.exitCode}</p>`:""}
100
+ ${c.related.length?`<section><h4>Related execution events</h4>${c.related.map(k=>`<button class="event-row" data-event="${Se(k.id)}">${Se(k.name)} · ${Se(k.preview)}</button>`).join("")}</section>`:""}
101
+ <details class="event-provenance"><summary>Source details</summary><dl><dt>Source</dt><dd>${Se(Fe(a?.source))}</dd><dt>Message ID</dt><dd>${Se(b.messageID)}</dd><dt>Timestamp source</dt><dd>${Se(b.timeSource)}</dd></dl></details>`}async function w(b={}){if(!a)return;clearTimeout(h),i?.abort();const k=new AbortController;i=k,y=b,d=!0,s.setAttribute("aria-busy","true"),o(".event-position").textContent="Loading…";for(const D of s.querySelectorAll("[data-step], [data-page]"))D.disabled=!0;const P=o(".event-list").scrollTop,T=c?.offset,m=document.activeElement,$=m instanceof HTMLElement?m.dataset:void 0;try{const D=await t.read(a.id,{filter:u,...b,...l?{revision:l}:{}},k.signal);if(k.signal.aborted)return;c=D,l=c.revision,v(),o(".event-list").scrollTop=c.offset===T?P:0,o(".event-scroll").scrollTop=0;const H=$?.event?`[data-event="${$.event}"]`:"";H&&(document.activeElement===m||!m?.isConnected&&document.activeElement===document.body)&&s.querySelector(H)?.focus({preventScroll:!0}),clearTimeout(h),h=setTimeout(()=>{g?.abort(),g=new AbortController;for(const O of[c?.previousItem,c?.nextItem])O&&t.read(a.id,{item:O,filter:u,revision:l},g.signal).catch(()=>{})},60)}catch(D){if(k.signal.aborted)return;c=void 0,o(".event-position").textContent="Unavailable",o(".event-content").innerHTML=`<div class="event-empty"><h3>Could not load this history.</h3><p>${Se(D instanceof Error?D.message:"Please retry.")}</p><button class="secondary-button" data-retry>Retry</button> <button class="secondary-button" data-reload>Reload current history</button></div>`}finally{i===k&&(d=!1,s.removeAttribute("aria-busy"))}}const S=()=>{t.clear(),l=void 0,c=void 0,w()},M=()=>!s.hidden&&!e.hidden,C=()=>{clearTimeout(h),g?.abort(),i?.abort(),i=void 0,d=!1,c=void 0,s.hidden=!0,s.removeAttribute("aria-busy"),e.classList.remove("has-events"),n.select(null)},E=b=>{if(d)return;const k=b==="next"?c?.nextItem:c?.previousItem;k&&w({item:k})};return s.addEventListener("click",b=>{const k=b.target.closest("button");if(k){if(k.dataset.event&&w({item:k.dataset.event}),k.dataset.step&&E(k.dataset.step==="next"?"next":"previous"),k.dataset.page){const P=k.dataset.page==="next"?c?.nextCursor:c?.previousCursor;P&&w({cursor:P})}k.hasAttribute("data-retry")&&w(y),(k.hasAttribute("data-reload")||k.classList.contains("event-reload"))&&S(),k.classList.contains("event-close")&&(C(),document.querySelector("#scene canvas")?.focus({preventScroll:!0}))}},{signal:r.signal}),o(".event-browser").addEventListener("toggle",p,{signal:r.signal}),{close:C,handleKey(b){return!M()||b.defaultPrevented||b.metaKey||b.ctrlKey||b.altKey||b.shiftKey||document.querySelector("dialog[open]")||b.target.closest('input, select, textarea, [contenteditable="true"], #explorer')?!1:b.key==="Escape"?(b.preventDefault(),C(),document.querySelector("#scene canvas")?.focus({preventScroll:!0}),!0):["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(b.key)?(b.preventDefault(),E(b.key==="ArrowLeft"||b.key==="ArrowUp"?"previous":"next"),!0):!1},open(b,k,P,T="messages"){clearTimeout(h),g?.abort();const m=a?.id===b.id;a=b,l=P,c=void 0,u=T,o("#event-title").textContent=`${Fe(b.source)} ${u==="tools"?"execution evidence":"messages"}`,o(".event-browser summary").firstChild.textContent=u==="tools"?"Browse tool events ":"Browse messages ",o(".event-list").replaceChildren(),o(".event-content").innerHTML='<p class="event-empty">Loading saved history…</p>',o(".event-coverage").textContent="Loading coverage…",m||(o(".event-browser").open=!1),s.hidden=!1,e.classList.add("has-events"),w(k?{item:k}:{})},dispose(){clearTimeout(h),g?.abort(),i?.abort(),r.abort(),s.remove()}}}function jg(e,t,n){const s=new Map;let o,r,i,a,c=0,l=0,u=1;const d=document.createElement("strong"),g=document.createElement("pre"),h=document.createElement("span"),y=()=>{clearTimeout(i),r?.abort(),r=void 0,o=void 0,a=void 0,e.hidden=!0,e.classList.remove("message-tooltip")};function f(v,w){if(!a)return;const S=`${Sl(a)} · ${a.name}`,M=v||"No text recorded.",C=[w,u>1?`${u} nearby items`:"","Click to focus and read · ← / → to navigate"].filter(Boolean).join(" · ");d.textContent!==S&&(d.textContent=S),g.textContent!==M&&(g.textContent=M),h.textContent!==C&&(h.textContent=C),d.parentElement!==e&&e.replaceChildren(d,g,h),e.classList.add("message-tooltip"),e.hidden=!1,e.style.setProperty("--event-color",El(a));const E=e.offsetWidth,b=e.offsetHeight,k=t.getBoundingClientRect(),P=[...document.querySelectorAll(".floating-panel:not([hidden]), .app-header, .map-controls")].map($=>$.getBoundingClientRect()),m=[l+18,l-b-18].flatMap($=>[c+18,c-E-18].map(D=>{D=Math.max(8,Math.min(D,t.clientWidth-E-8)),$=Math.max(8,Math.min($,t.clientHeight-b-8));const H=k.left+D,O=k.top+$,F=P.reduce((B,j)=>B+Math.max(0,Math.min(H+E,j.right+8)-Math.max(H,j.left-8))*Math.max(0,Math.min(O+b,j.bottom+8)-Math.max(O,j.top-8)),0);return{left:D,top:$,overlap:F}})).reduce(($,D)=>D.overlap<$.overlap?D:$);e.style.left=`${m.left}px`,e.style.top=`${m.top}px`}function p(v){const w=[v.text,v.input?`Input
102
+ ${v.input}`:"",v.output?`Output
103
+ ${v.output}`:""].filter(Boolean).join(`
104
+
105
+ `);return{text:w.slice(0,1800),shortened:w.length>1800||!!v.partial}}return{clear:y,show(v,w,S,M,C,E){const b=`${w}:${S}:${v.id}`,k=o!==b;k&&y(),o=b,a=v,c=C,l=E,u=M;const P=s.get(b);f(P?.text||v.preview,P?P.shortened?"Content preview":"":"Loading message…"),!(!k||P)&&(i=setTimeout(async()=>{const T=new AbortController;r=T;try{const m=await n.read(w,{item:v.id,revision:S,filter:v.kind==="commit"?"tools":"messages"},T.signal);if(T.signal.aborted||o!==b||m.selected?.id!==v.id)return;const $=p(m.selected);s.set(b,$),s.size>20&&s.delete(s.keys().next().value),f($.text,$.shortened?"Content preview":"")}catch{!T.signal.aborted&&o===b&&f(v.preview,"Saved excerpt · open for details")}},120))},dispose(){y(),s.clear()}}}const _g=e=>e.length!==40&&e.length!==64;function Bg(e,t,n){const s=new AbortController,o=document.createElement("div");o.className="section-label",o.textContent="Commits";const r=document.createElement("span");o.append(r);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(o,i,a,c);let l,u;async function d(){c.disabled=!0;try{const g=new URLSearchParams({limit:"30",...l?{cursor:l}:{}}),h=await Xe(`/api/sessiongraph/session/${encodeURIComponent(t)}/commits?${g}`,"Could not load commits.",{signal:AbortSignal.any([s.signal,AbortSignal.timeout(3e4)])});if(s.signal.aborted)return;u=h.revision,r.textContent=h.total?h.total.toLocaleString():"",i.hidden=h.total>0,i.textContent=h.coverage.state==="pending"?"Commit indexing pending.":h.coverage.state==="unavailable"?"Commit history unavailable.":"No commits found.";for(const y of h.items){const f=document.createElement("button");f.className="relation";const p=document.createElement("span"),v=document.createElement("strong"),w=document.createElement("small");v.textContent=`${y.sha.slice(0,12)} · ${y.operation}`,w.textContent=`${y.occurredAt===null?"Time not recorded":new Date(y.occurredAt).toLocaleString()} · ${y.repositoryPath}`,f.title=`${y.sha}${_g(y.sha)?" (abbreviated)":""} — inspect execution evidence`,p.append(v,w),f.append(p),f.addEventListener("click",()=>n(y.evidenceEventID,u),{signal:s.signal}),a.append(f)}l=h.nextCursor||void 0,c.hidden=!l,c.textContent="Load more commits"}catch(g){if(s.signal.aborted)return;r.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",()=>{d()},{signal:s.signal}),d(),()=>s.abort()}async function qg(e,t){await bi("plugin:opener|open_url",{url:e,with:t})}function xl(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 $l(e,t=qg){await t(xl(e))}class Ug{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 o=n.filter||"all",r=JSON.stringify([t,n.revision,o,n.item,n.cursor]),i=n.revision?this.pages.get(r):void 0;if(i)return this.pages.delete(r),this.pages.set(r,i),Promise.resolve(i.page);let a=this.pending.get(r);if(!a){const l=new AbortController,u=this.generation,d=new URLSearchParams({filter:o,...n}),g=Xe(`/api/sessiongraph/session/${encodeURIComponent(t)}/events?${d}`,"Could not load events.",{signal:AbortSignal.any([l.signal,AbortSignal.timeout(3e4)])},this.request).catch(f=>{throw f instanceof Tt&&f.status===409&&(!f.code||f.code==="STALE_CURSOR")&&this.clear(),f}).then(f=>{if(l.signal.aborted||u!==this.generation)throw new DOMException("Request cancelled","AbortError");if(f.sessionID!==t||n.revision&&f.revision!==n.revision)throw new Error("Saved history changed. Reload the event explorer.");const p=JSON.stringify([t,f.revision,o,n.item,n.cursor]),v=JSON.stringify(f).length;for(this.characters-=this.pages.get(p)?.characters||0,this.pages.delete(p),this.pages.set(p,{page:f,characters:v}),this.characters+=v;this.pages.size>20||this.characters>2e6;){const w=this.pages.keys().next().value;this.characters-=this.pages.get(w).characters,this.pages.delete(w)}return f});a={controller:l,promise:g,readers:0},this.pending.set(r,a);const h=a,y=()=>{this.pending.get(r)===h&&this.pending.delete(r)};g.then(y,y)}const c=a;return c.readers++,new Promise((l,u)=>{const d=()=>{h(),u(s.reason)};let g=!1;const h=()=>{g||(g=!0,s?.removeEventListener("abort",d),--c.readers===0&&this.pending.get(r)===c&&(this.pending.delete(r),c.controller.abort()))};s?.addEventListener("abort",d,{once:!0}),c.promise.then(y=>{g||(h(),l(y))},y=>{g||(h(),u(y))})})}}async function Gg(){await bi("plugin:process|restart")}class Yg{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,o=0;this.set({phase:"downloading",version:t}),await this.release.download(r=>{r.event==="Started"&&(s=r.data.contentLength,o=0),r.event==="Progress"&&(o+=r.data.chunkLength),this.set({phase:"downloading",version:t,progress:s&&s>0?Math.min(99,Math.floor(o/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 Kg=W("arrow-down"),Zg=W("refresh-cw");function zg(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 o=l=>{const u=["downloading","installing","restarting"].includes(l.phase),d=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",h=l.phase==="downloading"?l.progress===void 0?"Downloading":`${l.progress}%`:l.phase==="installing"?"Installing":l.phase==="restarting"?"Restarting":l.phase==="error"?`${g} · Retry`:d?"Restart":"Update",y=l.phase==="error"?h:l.phase==="restarting"?`Restarting SessionGraph ${l.version}`:d?`Restart to install SessionGraph ${l.version}`:`Update to SessionGraph ${l.version}`;t.hidden=l.phase==="hidden",t.disabled=u,t.dataset.phase=l.phase,t.setAttribute("aria-busy",String(u)),t.setAttribute("aria-label",y),t.title=y;const f=`${d||l.phase==="restarting"?Zg:Kg}<span>${h}</span>`;t.innerHTML!==f&&(t.innerHTML=f);const p=l.phase==="hidden"?"":l.phase==="downloading"?`Downloading SessionGraph ${l.version}`:y;p!==s&&(n.textContent=p,s=p)},r=new Yg(e,o);t.addEventListener("click",()=>{r.activate()});const i=()=>{document.visibilityState==="visible"&&navigator.onLine&&r.check()},a=window.setTimeout(i,1e4),c=window.setInterval(i,240*6e4);return document.addEventListener("visibilitychange",i),window.addEventListener("online",i),{check:()=>r.check(),dispose(){clearTimeout(a),clearInterval(c),r.dispose(),t.remove(),n.remove(),document.removeEventListener("visibilitychange",i),window.removeEventListener("online",i)}}}function Jg(){return vn()?zg({async check(){const{check:e}=await ws(async()=>{const{check:n}=await import("./index-tIWYckIn.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 Gg()}}):{dispose(){}}}var Xg=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=Xg.build();function ir(e,t){return e-t*Math.floor(e/t)}const Ll=1721426;function Ns(e,t,n,s){t=Si(e,t);let o=t-1,r=-2;return n<=2?r=0:Js(t)&&(r=-1),Ll-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+r+s)}function Js(e){return e%4===0&&(e%100!==0||e%400===0)}function Si(e,t){return e==="BC"?1-t:t}function Qg(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const em={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 xn{fromJulianDay(t){let n=t,s=n-Ll,o=Math.floor(s/146097),r=ir(s,146097),i=Math.floor(r/36524),a=ir(r,36524),c=Math.floor(a/1461),l=ir(a,1461),u=Math.floor(l/365),d=o*400+i*100+c*4+u+(i!==4&&u!==4?1:0),[g,h]=Qg(d),y=n-Ns(g,h,1,1),f=2;n<Ns(g,h,3,1)?f=0:Js(h)&&(f=1);let p=Math.floor(((y+f)*12+373)/367),v=n-Ns(g,h,p,1)+1;return new Ue(g,h,p,v)}toJulianDay(t){return Ns(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return em[Js(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Js(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 tm={"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 nm(e,t){return t=me(t,e.calendar),e=ht(e),t=ht(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function sm(e,t){return t=me(t,e.calendar),e=gs(e),t=gs(t),e.era===t.era&&e.year===t.year}function om(e,t){return Vo(e.calendar,t.calendar)&&Ie(e,t)}function Gn(e,t){return Vo(e.calendar,t.calendar)&&nm(e,t)}function Yn(e,t){return Vo(e.calendar,t.calendar)&&sm(e,t)}function Vo(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function rm(e,t){return Ie(e,No(t))}const im={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Il(e,t,n){let s=e.calendar.toJulianDay(e),o=n?im[n]:dm(t),r=Math.ceil(s+1-o)%7;return r<0&&(r+=7),r}function Tl(e){return pt(Date.now(),e)}function No(e){return Kt(Tl(e))}function Ml(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function am(e,t){return Ga(e)-Ga(t)}function Ga(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let ar=null,cm=!1;function xi(){return ar==null&&(ar=new Intl.DateTimeFormat().resolvedOptions().timeZone),ar}function Al(){return cm}function ht(e){return e.subtract({days:e.day-1})}function qr(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function gs(e){return ht(e.subtract({months:e.month-1}))}function lm(e){return qr(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function At(e,t,n){let s=Il(e,t,n);return e.subtract({days:s})}function Ya(e,t,n){return At(e,t,n).add({days:6})}const Ka=new Map,cr=new Map;function Ol(e){if(Intl.Locale){let n=Ka.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Ka.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function dm(e){let t=cr.get(e);if(!t){if(Intl.Locale){let s=new Intl.Locale(e);if("getWeekInfo"in s&&(t=s.getWeekInfo(),t))return cr.set(e,t),t.firstDay}let n=Ol(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&&tm[n]||0};cr.set(e,t)}return t.firstDay}function um(e,t,n){let s=e.calendar.getDaysInMonth(e);return Math.ceil((Il(ht(e),t,n)+s)/7)}function Pl(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Dl(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const fm={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 hm(e,t){let n=e.calendar.toJulianDay(e),s=Math.ceil(n+1)%7;s<0&&(s+=7);let o=Ol(t),[r,i]=fm[o]||[6,0];return s===r||s===i}function $n(e){e=me(e,new xn);let t=Si(e.era,e.year);return Rl(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Rl(e,t,n,s,o,r,i){let a=new Date;return a.setUTCHours(s,o,r,i),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ur(e,t){if(t==="UTC")return 0;if(e>0&&t===xi()&&!Al())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:s,day:o,hour:r,minute:i,second:a}=Vl(e,t);return Rl(n,s,o,r,i,a,0)-Math.floor(e/1e3)*1e3}const Za=new Map;function Vl(e,t){let n=Za.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"}),Za.set(t,n));let s=n.formatToParts(new Date(e)),o={};for(let r of s)r.type!=="literal"&&(o[r.type]=r.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const za=864e5;function pm(e,t,n,s){return(n===s?[n]:[n,s]).filter(r=>gm(e,t,r))}function gm(e,t,n){let s=Vl(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 ut(e,t,n="compatible"){let s=He(e);if(t==="UTC")return $n(s);if(t===xi()&&n==="compatible"&&!Al()){s=me(s,new xn);let c=new Date,l=Si(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 o=$n(s),r=Ur(o-za,t),i=Ur(o+za,t),a=pm(s,t,o-r,o-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(o-r,o-i);case"compatible":case"later":return Math.max(o-r,o-i);case"reject":throw new RangeError("No such absolute time found")}}function Nl(e,t,n="compatible"){return new Date(ut(e,t,n))}function pt(e,t){let n=Ur(e,t),s=new Date(e+n),o=s.getUTCFullYear(),r=s.getUTCMonth()+1,i=s.getUTCDate(),a=s.getUTCHours(),c=s.getUTCMinutes(),l=s.getUTCSeconds(),u=s.getUTCMilliseconds();return new ms(o<1?"BC":"AD",o<1?-o+1:o,r,i,t,n,a,c,l,u)}function Kt(e){return new Ue(e.calendar,e.era,e.year,e.month,e.day)}function He(e,t){let n=0,s=0,o=0,r=0;if("timeZone"in e)({hour:n,minute:s,second:o,millisecond:r}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:s,second:o,millisecond:r}=t),new go(e.calendar,e.era,e.year,e.month,e.day,n,s,o,r)}function me(e,t){if(Vo(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 Fl(e,t,n){if(e instanceof ms)return e.timeZone===t?e:ym(e,t);let s=ut(e,t,n);return pt(s,t)}function mm(e){let t=$n(e)-e.offset;return new Date(t)}function ym(e,t){let n=$n(e)-e.offset;return me(pt(n,t),e.calendar)}const Kn=36e5;function Fo(e,t){let n=e.copy(),s="hour"in n?Cm(n,t):0;Gr(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Yr(n),Hl(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=s,vm(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){let i=n.calendar.isInverseEra?.(n);n.year=o,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 r=n.calendar.getMonthsInYear(n);return n.month>r&&(n.month=r,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Gr(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Yr(e){for(;e.month<1;)Gr(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Gr(e,1)}function vm(e){for(;e.day<1;)e.month--,Yr(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Yr(e)}function Hl(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)),Hl(e)}function Wl(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function jl(e,t){return Fo(e,Wl(t))}function $i(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 po(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),wm(n),n}function bm(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Fs(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Fs(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Fs(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Fs(e.hour,24),t}function wm(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 Fs(e,t){let n=e%t;return n<0&&(n+=t),n}function Cm(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,bm(e)}function Li(e,t,n,s){let o=e.copy();switch(t){case"era":{let r=e.calendar.getEras(),i=r.indexOf(e.era);if(i<0)throw new Error("Invalid era: "+e.era);i=gt(i,n,0,r.length-1,s?.round),o.era=r[i],Qt(o);break}case"year":o.calendar.isInverseEra?.(o)&&(n=-n),o.year=gt(e.year,n,-1/0,9999,s?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=gt(e.month,n,1,e.calendar.getMonthsInYear(e),s?.round);break;case"day":o.day=gt(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(o),Qt(o),o}function _l(e,t,n,s){let o=e.copy();switch(t){case"hour":{let r=e.hour,i=0,a=23;if(s?.hourCycle===12){let c=r>=12;i=c?12:0,a=c?23:11}o.hour=gt(r,n,i,a,s?.round);break}case"minute":o.minute=gt(e.minute,n,0,59,s?.round);break;case"second":o.second=gt(e.second,n,0,59,s?.round);break;case"millisecond":o.millisecond=gt(e.millisecond,n,0,999,s?.round);break;default:throw new Error("Unsupported field "+t)}return o}function gt(e,t,n,s,o=!1){if(o){e+=Math.sign(t),e<n&&(e=s);let r=Math.abs(t);t>0?e=Math.ceil(e/r)*r:e=Math.floor(e/r)*r,e>s&&(e=n)}else e+=t,e<n?e=s-(n-e-1):e>s&&(e=n+(e-s-1));return e}function Bl(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 o=Fo(He(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=ut(o,e.timeZone)}else n=$n(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let s=pt(n,e.timeZone);return me(s,e.calendar)}function km(e,t){return Bl(e,Wl(t))}function Em(e,t,n,s){switch(t){case"hour":{let o=0,r=23;if(s?.hourCycle===12){let y=e.hour>=12;o=y?12:0,r=y?23:11}let i=He(e),a=me(po(i,{hour:o}),new xn),c=[ut(a,e.timeZone,"earlier"),ut(a,e.timeZone,"later")].filter(y=>pt(y,e.timeZone).day===a.day)[0],l=me(po(i,{hour:r}),new xn),u=[ut(l,e.timeZone,"earlier"),ut(l,e.timeZone,"later")].filter(y=>pt(y,e.timeZone).day===l.day).pop(),d=$n(e)-e.offset,g=Math.floor(d/Kn),h=d%Kn;return d=gt(g,n,Math.floor(c/Kn),Math.floor(u/Kn),s?.round)*Kn+h,me(pt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return _l(e,t,n,s);case"era":case"year":case"month":case"day":{let o=Li(He(e),t,n,s),r=ut(o,e.timeZone);return me(pt(r,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function Sm(e,t,n){let s=He(e),o=po($i(s,t),t);if(o.compare(s)===0)return e;let r=ut(o,e.timeZone,n);return me(pt(r,e.timeZone),e.calendar)}const xm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,$m=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function Lm(e){let t=e.match(xm);if(!t)throw $m.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new Ue(lr(t[1],0,9999),lr(t[2],1,12),1);return n.day=lr(t[3],1,n.calendar.getDaysInMonth(n)),n}function lr(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 Im(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 ql(e){let t=me(e,new xn),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 Ul(e){return`${ql(e)}T${Im(e)}`}function Tm(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),r=`${t}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return o!==0&&(r+=`:${String(o).padStart(2,"0")}`),r}function Mm(e){return`${Ul(e)}${Tm(e.offset)}[${e.timeZone}]`}function Ii(e){let t=typeof e[0]=="object"?e.shift():new xn,n;if(typeof e[0]=="string")n=e.shift();else{let i=t.getEras();n=i[i.length-1]}let s=e.shift(),o=e.shift(),r=e.shift();return[t,n,s,o,r]}class Ue{#e;constructor(...t){let[n,s,o,r,i]=Ii(t);this.calendar=n,this.era=s,this.year=o,this.month=r,this.day=i,Qt(this)}copy(){return this.era?new Ue(this.calendar,this.era,this.year,this.month,this.day):new Ue(this.calendar,this.year,this.month,this.day)}add(t){return Fo(this,t)}subtract(t){return jl(this,t)}set(t){return $i(this,t)}cycle(t,n,s){return Li(this,t,n,s)}toDate(t){return Nl(this,t)}toString(){return ql(this)}compare(t){return Ml(this,t)}}class go{#e;constructor(...t){let[n,s,o,r,i]=Ii(t);this.calendar=n,this.era=s,this.year=o,this.month=r,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 go(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new go(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Fo(this,t)}subtract(t){return jl(this,t)}set(t){return $i(po(this,t),t)}cycle(t,n,s){switch(t){case"era":case"year":case"month":case"day":return Li(this,t,n,s);default:return _l(this,t,n,s)}}toDate(t,n){return Nl(this,t,n)}toString(){return Ul(this)}compare(t){let n=Ml(this,t);return n===0?am(this,He(t)):n}}class ms{#e;constructor(...t){let[n,s,o,r,i]=Ii(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=s,this.year=o,this.month=r,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 Bl(this,t)}subtract(t){return km(this,t)}set(t,n){return Sm(this,t,n)}cycle(t,n,s){return Em(this,t,n,s)}toDate(){return mm(this)}toString(){return Mm(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Fl(t,this.timeZone).toDate().getTime()}}let dr=new Map;class Ve{constructor(t,n={}){this.formatter=Gl(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),o=this.formatter.formatToParts(n);return[...s.map(r=>({...r,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(r=>({...r,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return Pm()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Dm(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 Am={true:{ja:"h11"},false:{}};function Gl(e,t={}){if(typeof t.hour12=="boolean"&&Om()){t={...t};let o=Am[String(t.hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=o??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,r)=>o[0]<r[0]?-1:1).join():"");if(dr.has(n))return dr.get(n);let s=new Intl.DateTimeFormat(e,t);return dr.set(n,s),s}let ur=null;function Om(){return ur==null&&(ur=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),ur}let fr=null;function Pm(){return fr==null&&(fr=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),fr}function Dm(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=Gl(e,{...t,timeZone:void 0}),s=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(r=>r.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(r=>r.type==="hour").value,10);if(s===0&&o===23)return"h23";if(s===24&&o===23)return"h24";if(s===0&&o===11)return"h11";if(s===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function Rm(e,t,n,s,o){const r={};for(let a in t){const c=a,l=t[c];l!=null&&(r[c]=Math.floor(l/2),r[c]>0&&l%2===0&&r[c]--)}const i=sn(e,t,n).subtract(r);return ks(e,i,t,n,s,o)}function sn(e,t,n,s,o){let r=e;return t.years?r=gs(e):t.months?r=ht(e):t.weeks&&(r=At(e,n)),ks(e,r,t,n,s,o)}function Ti(e,t,n,s,o){let r={...t};r.days?r.days--:r.weeks?r.weeks--:r.months?r.months--:r.years&&r.years--;let i=sn(e,t,n).subtract(r);return ks(e,i,t,n,s,o)}function ks(e,t,n,s,o,r){return o&&e.compare(o)>=0&&(t=Dl(t,sn(Kt(o),n,s))),r&&e.compare(r)<=0&&(t=Pl(t,Ti(Kt(r),n,s))),t}function Re(e,t,n){const s=Kt(e),o=t?Kt(t):void 0,r=n?Kt(n):void 0;let i=s;return o&&(i=Dl(i,o)),r&&(i=Pl(i,r)),i.compare(s)===0?e:"hour"in e?e.set({year:i.year,month:i.month,day:i.day}):i}function Ja(e,t,n,s,o,r){switch(t){case"start":return sn(e,n,s,o,r);case"end":return Ti(e,n,s,o,r);default:return Rm(e,n,s,o,r)}}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 Xa(e,t,n,s,o){return e?t?.(e,n)?!0:ze(e,s,o):!1}function ze(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function Vm(e,t,n){const s=e.subtract({days:1});return Ie(s,e)||ze(s,t,n)}function Nm(e,t,n){const s=e.add({days:1});return Ie(s,e)||ze(s,t,n)}function Mi(e){let t={...e};for(let n in t)t[n]=1;return t}function Yl(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Kl(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function Zl(e,t,n){const s=n??He(No(t));return new Ve(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Kl(s),calendar:s.calendar.identifier,timeZone:t})}function Qa(e,t,n){const s=n??No(t);return new Ve(e,{month:"long",year:"numeric",era:Kl(s),calendar:s.calendar.identifier,timeZone:t})}function Fm(e,t,n,s,o){let r=n.formatRangeToParts(e.toDate(o),t.toDate(o)),i=-1;for(let l=0;l<r.length;l++){let u=r[l];if(u.source==="shared"&&u.type==="literal")i=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<r.length;l++)l<i?a+=r[l].value:l>i&&(c+=r[l].value);return s(a,c)}function Hs(e,t,n,s){if(!e)return"";let o=e,r=t??e,i=Zl(n,s);return Ie(o,r)?i.format(o.toDate(s)):Fm(o,r,i,(a,c)=>`${a} – ${c}`,s)}var Hm=["sun","mon","tue","wed","thu","fri","sat"];function zl(e){return e!=null?Hm[e]:void 0}function Jl(e,t,n){const s=zl(n);return At(e,t,s)}function Xl(e,t,n,s){const o=t.add({weeks:e}),r=[];let i=Jl(o,n,s);for(;r.length<7;){r.push(i);let a=i.add({days:1});if(Ie(i,a))break;i=a}return r}function Wm(e,t,n,s){const o=zl(s),r=n??um(e,t,o);return[...new Array(r).keys()].map(a=>Xl(a,e,t,s))}function jm(e,t){const n=new Ve(e,{weekday:"long",timeZone:t}),s=new Ve(e,{weekday:"short",timeZone:t}),o=new Ve(e,{weekday:"narrow",timeZone:t});return r=>{const i=r instanceof Date?r:r.toDate(t);return{value:r,short:s.format(i),long:n.format(i),narrow:o.format(i)}}}function _m(e,t,n,s){const o=Jl(e,s,t),r=[...new Array(7).keys()],i=jm(s,n);return r.map(a=>i(o.add({days:a})))}function Bm(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),o=new Ve(e,{month:t,calendar:n.calendar.identifier}),r=[];for(let i=1;i<=s;i++){const a=n.set({month:i});r.push(o.format(a.toDate("UTC")))}return r}function ec(e,t){const n=At(e,t,"mon"),s=n.year,o=n.set({month:1,day:4}),r=At(o,t,"mon"),i=n.calendar.toJulianDay(n),a=r.calendar.toJulianDay(r);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"),u=l.calendar.toJulianDay(l);return 1+Math.floor((i-u)/7)}function qm(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var Um=1900,Gm=2099;function Ym(e,t,n){const s=e.calendar,o=t?.year??me(new Ue(Um,1,1),s).year,r=n?.year??me(new Ue(Gm,12,31),s).year;return{from:o,to:r}}var Km=10;function Zm(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),o=n+s;return o>t+Km?(o-100).toString():o.toString()}return e}}function bn(e){const t=e-e%10,n=[];for(let s=0;s<10;s+=1){const o=t+s;n.push(o)}return n}function as(e,t){const n=No(e??xi());return t?me(n,t):n}function Es(e,t,n,s){return function(r){const{startDate:i,focusedDate:a}=r,c=Yl(i,e);return ze(a,n,s)?{startDate:i,focusedDate:Re(a,n,s),endDate:c}:a.compare(i)<0?{startDate:Ti(a,e,t,n,s),focusedDate:Re(a,n,s),endDate:c}:a.compare(c)>0?{startDate:sn(a,e,t,n,s),endDate:c,focusedDate:Re(a,n,s)}:{startDate:i,endDate:c,focusedDate:Re(a,n,s)}}}function Ql(e,t,n,s,o,r){const i=Es(n,s,o,r),a=t.add(n);return i({focusedDate:e.add(n),startDate:sn(ks(e,a,n,s,o,r),n,s)})}function ed(e,t,n,s,o,r){const i=Es(n,s,o,r);let a=t.subtract(n);return i({focusedDate:e.subtract(n),startDate:sn(ks(e,a,n,s,o,r),n,s)})}function zm(e,t,n,s,o,r,i){const a=Es(s,o,r,i);if(!n&&!s.days)return a({focusedDate:e.add(Mi(s)),startDate:t});if(s.days)return Ql(e,t,s,o,r,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 Jm(e,t,n,s,o,r,i){const a=Es(s,o,r,i);if(!n&&!s.days)return a({focusedDate:e.subtract(Mi(s)),startDate:t});if(s.days)return ed(e,t,s,o,r,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 tc=new Map;function Xm(e){let t=tc.get(e);return t!=null||(t="0123456789"+new Intl.NumberFormat(e,{useGrouping:!1}).format(1234567890),tc.set(e,t)),t}var Qm=(e,t)=>t?Xm(t).includes(e):/\d/.test(e),td=(e,t,n)=>!e||e.length!==1?!0:Qm(e,n)||t.includes(e),ey=(e,t,n)=>e.split("").filter(s=>td(s,t,n)).join(""),nc=new Map;function ty(e){let t=nc.get(e);if(t!=null)return t;const s=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=s?s.value:"/",nc.set(e,t),t}var sc=e=>e!=null&&e.length===4,ny=e=>e!=null&&parseFloat(e)<=12,sy=e=>e!=null&&parseFloat(e)<=31;function oy(e,t,n){const s=ry(t,n);let{year:o,month:r,day:i}=iy(s,e)??{};if(o!=null||r!=null||i!=null){const l=new Date;o||(o=l.getFullYear().toString()),r||(r=(l.getMonth()+1).toString()),i||(i=l.getDate().toString())}if(sc(o)||(o=Zm(o)),sc(o)&&ny(r)&&sy(i))return new Ue(+o,+r,+i);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Ue(l.getFullYear(),l.getMonth()+1,l.getDate())}}function ry(e,t){return new Ve(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:r})=>o==="literal"?`${r}?`:`((?!=<${o}>)\\d+)?`).join("")}function iy(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(s=>{const o=s.match(/<(.+)>/);return!o||o.length<=0?null:s.match(/<(.+)>/)?.[1]}).reduce((s,o,r)=>(o&&(n&&n.length>r?s[o]=n[r+1]:s[o]=null),s),{})}function oc(e,t,n){const s=Kt(Tl(n));switch(e){case"thisWeek":return[At(s,t),Ya(s,t)];case"thisMonth":return[ht(s),s];case"thisQuarter":return[ht(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[ht(s.add({months:-1})),qr(s.add({months:-1}))];case"lastQuarter":return[ht(s.add({months:-((s.month-1)%3)-3})),qr(s.add({months:-((s.month-1)%3)-1}))];case"lastWeek":return[At(s,t).add({weeks:-1}),Ya(s,t).add({weeks:-1})];case"lastYear":return[gs(s.add({years:-1})),lm(s.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var ay=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,cy=e=>e.ids?.root??`datepicker:${e.id}`,ly=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,Kr=e=>e.ids?.content??`datepicker:${e.id}:content`,hr=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,dy=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,uy=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,fy=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,nd=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,sd=e=>e.ids?.control??`datepicker:${e.id}:control`,rc=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,od=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,rd=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,id=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,ad=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,ic=(e,t)=>yh(hn(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Xs=e=>e.getById(od(e)),hn=e=>e.getById(Kr(e)),ns=e=>mh(cd(e),"[data-part=input]"),hy=e=>e.getById(ad(e)),py=e=>e.getById(id(e)),gy=e=>e.getById(nd(e)),ac=e=>e.getById(rd(e)),cd=e=>e.getById(sd(e)),cc=e=>{const t=ns(e);if(t.length===0){Xs(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(r=>r.value!==""),s=Math.max(n,0),o=t[s];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)};function Qs(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 Ws(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function my(e,t){return new Ve(e).formatToParts(new Date).map(n=>t[n.type]??n.value).join("")}var lc=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),yy={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 Er(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return Er(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 Ai(e){return e===0?"day":e===1?"month":"year"}function Oi(e,t,n){return Ai(af(vt(e,0),vt(t,0),vt(n,2)))}function vy(e,t){return vt(e,0)>vt(t,0)}function by(e,t){return vt(e,0)<vt(t,0)}function ld(e,t,n){const s=vt(e,0)+1;return Oi(Ai(s),t,n)}function wy(e,t,n){const s=vt(e,0)-1;return Oi(Ai(s),t,n)}var Cy=["day","month","year"];function ky(e){Cy.forEach(t=>e(t))}var Ey=g1(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale,e.timeZone,e.selectionMode],([e],t)=>{const{startValue:n,endValue:s,locale:o,timeZone:r,selectionMode:i}=t;if(e==="year"){const d=bn(n.year),g=d.at(0).toString(),h=d.at(-1).toString();return{start:g,end:h,formatted:`${g} - ${h}`}}if(e==="month"){const d=new Ve(o,{year:"numeric",timeZone:r,calendar:n.calendar.identifier}),g=d.format(n.toDate(r)),h=d.format(s.toDate(r)),y=i==="range"?`${g} - ${h}`:g;return{start:g,end:h,formatted:y}}const a=new Ve(o,{month:"long",year:"numeric",timeZone:r,calendar:n.calendar.identifier}),c=a.format(n.toDate(r)),l=a.format(s.toDate(r)),u=i==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function Sy(e,t){const{state:n,context:s,prop:o,send:r,computed:i,scope:a}=e,c=s.get("startValue"),l=i("endValue"),u=s.get("value"),d=s.get("focusedValue"),g=s.get("hoveredValue"),h=g?Qs([u[0],g]):[],y=!!o("disabled"),f=!!o("readOnly"),p=!!o("invalid"),v=i("isInteractive"),w=u.length===0,S=o("min"),M=o("max"),C=o("locale"),E=o("timeZone"),b=o("startOfWeek"),k=n.matches("focused"),P=n.matches("open"),T=o("selectionMode")==="range",m=o("selectionMode")==="multiple",$=o("isDateUnavailable"),D=o("maxSelectedDates"),H=m&&D!=null&&u.length>=D,O=s.get("currentPlacement"),F=O?Qc(O):void 0,B=el({...o("positioning"),placement:O}),j=ty(C),Y=Sc(yy,o("translations"));function Me(A=c){const x=o("fixedWeeks")?6:void 0;return Wm(A,C,x,b)}function Le(A={}){const{format:x}=A;return Bm(C,x,d).map((I,R)=>{const z=R+1,de=d.set({month:z}),ue=ze(de,S,M);return{label:I,value:z,disabled:ue}})}function Wt(){const A=Ym(d,S,M);return qm(A).map(I=>({label:I.toString(),value:I,disabled:!Go(I,S?.year,M?.year)}))}function _e(A){return Xa(A,$,C,S,M)}function Ae(A){const x=c??as(E,d.calendar);r({type:"FOCUS.SET",value:x.set({month:A})})}function Nn(A){const x=c??as(E,d.calendar);r({type:"FOCUS.SET",value:x.set({year:A})})}function Be(A){const{value:x,disabled:I}=A,R=d.set({year:x}),de=!bn(c.year).includes(x),ue=Go(x,S?.year,M?.year),N=T&&dn(R,u),_=T&&u[0]&&Yn(R,u[0]),K=T&&u[1]&&Yn(R,u[1]),te=T&&h.length>0,ae=te&&dn(R,h),ne=te&&h[0]&&Yn(R,h[0]),re=te&&h[1]&&Yn(R,h[1]),qe={focused:d.year===A.value,selectable:ue,outsideRange:de,selected:!!u.find(Ke=>Ke&&Ke.year===x),valueText:x.toString(),inRange:N||ae,firstInRange:!!_,lastInRange:!!K,inHoveredRange:!!ae,firstInHoveredRange:!!ne,lastInHoveredRange:!!re,value:R,get disabled(){return I||!qe.selectable}};return qe}function jt(A){const{value:x,disabled:I}=A,R=d.set({month:x}),z=Qa(C,E,d),de=T&&dn(R,u),ue=T&&u[0]&&Gn(R,u[0]),N=T&&u[1]&&Gn(R,u[1]),_=T&&h.length>0,K=_&&dn(R,h),te=_&&h[0]&&Gn(R,h[0]),ae=_&&h[1]&&Gn(R,h[1]),ne={focused:d.month===A.value,selectable:!ze(R,S,M),selected:!!u.find(re=>re&&re.month===x&&re.year===d.year),valueText:z.format(R.toDate(E)),inRange:de||K,firstInRange:!!ue,lastInRange:!!N,inHoveredRange:!!K,firstInHoveredRange:!!te,lastInHoveredRange:!!ae,outsideRange:!1,value:R,get disabled(){return I||!ne.selectable}};return ne}function ot(A){const{value:x,disabled:I,visibleRange:R=i("visibleRange")}=A,z=Zl(C,E,d),de=Mi(i("visibleDuration")),ue=o("outsideDaySelectable"),N=R.start.add(de).subtract({days:1}),_=ze(x,R.start,N),K=T&&dn(x,u),te=T&&u[0]&&Ie(x,u[0]),ae=T&&u[1]&&Ie(x,u[1]),ne=T&&h.length>0,re=ne&&dn(x,h),qe=ne&&h[0]&&Ie(x,h[0]),Ke=ne&&h[1]&&Ie(x,h[1]),ve=u.some(rn=>rn!=null&&Ie(x,rn)),Ze={invalid:ze(x,S,M),disabled:I||!ue&&_||ze(x,S,M)||H&&!ve,selected:ve,unavailable:Xa(x,$,C,S,M)&&!I,outsideRange:_,today:rm(x,E),weekend:hm(x,C),value:x,valueText:z.format(x.toDate(E)),get focused(){return d!=null&&Ie(x,d)&&(!Ze.outsideRange||ue)},get selectable(){return!Ze.disabled&&!Ze.unavailable},inRange:K||re,firstInRange:te,lastInRange:ae,inHoveredRange:re,firstInHoveredRange:qe,lastInHoveredRange:Ke};return Ze}function on(A){const{view:x="day",id:I}=A;return[x,I].filter(Boolean).join(" ")}return{focused:k,open:P,disabled:y,invalid:p,readOnly:f,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:D,isMaxSelected:H,view:s.get("view"),getRangePresetValue(A){return oc(A,C,E)},getWeekNumber(A){const x=A[0];return x?ec(x,C):0},getDaysInWeek(A,x=c){return Xl(A,x,C,b)},getOffset(A){const x=c.add(A),I=l.add(A),R=Qa(C,E,d);return{visibleRange:{start:x,end:I},weeks:Me(x),visibleRangeText:{start:R.format(x.toDate(E)),end:R.format(I.toDate(E))}}},getMonthWeeks:Me,isUnavailable:_e,weeks:Me(),weekDays:_m(c,b,E,C),visibleRangeText:i("visibleRangeText"),value:u,valueAsDate:u.filter(A=>A!=null).map(A=>A.toDate(E)),valueAsString:i("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(E),focusedValueAsString:o("format")(d,{locale:C,timeZone:E}),visibleRange:i("visibleRange"),selectToday(){const A=Re(as(E,d.calendar),S,M);r({type:"VALUE.SET",value:[A]})},setValue(A){const x=A.map(I=>Re(I,S,M));r({type:"VALUE.SET",value:x})},setTime(A,x=0){const I=Array.from(u);let R=I[x];R&&("hour"in R||(R=He(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),I[x]=Re(R,S,M),r({type:"VALUE.SET",value:I}))},clearValue(A={}){const{focus:x=!0}=A;r({type:"VALUE.CLEAR",focus:x})},setFocusedValue(A){r({type:"FOCUS.SET",value:A})},setOpen(A){o("inline")||r({type:A?"OPEN":"CLOSE",replaces:"open"})},focusMonth:Ae,focusYear:Nn,getYears:Wt,getMonths:Le,getYearsGrid(A={}){const{columns:x=1}=A,I=bn(c.year).map(R=>({label:R.toString(),value:R,disabled:!Go(R,S?.year,M?.year)}));return Qi(I,x)},getDecade(){const A=bn(c.year);return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:x=1,format:I}=A;return Qi(Le({format:I}),x)},format(A,x={month:"long",year:"numeric"}){return new Ve(C,{...x,calendar:A.calendar.identifier}).format(A.toDate(E))},setView(A){r({type:"VIEW.SET",view:A})},goToNext(){r({type:"GOTO.NEXT",view:s.get("view")})},goToPrev(){r({type:"GOTO.PREV",view:s.get("view")})},getRootProps(){return t.element({...ee.root.attrs,dir:o("dir"),id:cy(a),"data-state":P?"open":"closed","data-disabled":V(y),"data-readonly":V(f),"data-empty":V(w)})},getLabelProps(A={}){const{index:x=0}=A;return t.label({...ee.label.attrs,id:ay(a,x),dir:o("dir"),htmlFor:rc(a,x),"data-state":P?"open":"closed","data-index":x,"data-disabled":V(y),"data-readonly":V(f),"data-invalid":V(p)})},getControlProps(){return t.element({...ee.control.attrs,dir:o("dir"),id:sd(a),"data-disabled":V(y),"data-placeholder-shown":V(w),"data-invalid":V(p)})},getRangeTextProps(){return t.element({...ee.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...ee.content.attrs,hidden:!P,dir:o("dir"),"data-state":P?"open":"closed","data-placement":O,"data-side":F,"data-inline":V(o("inline")),id:Kr(a),tabIndex:-1,role:"application","aria-label":Y.content})},getTableProps(A={}){const{view:x="day",columns:I=x==="day"?7:4}=A,R=on(A);return t.element({...ee.table.attrs,role:"grid","data-columns":I,"aria-label":i("visibleRangeText").formatted,id:ly(a,R),"aria-readonly":be(f),"aria-disabled":be(y),"aria-multiselectable":be(o("selectionMode")!=="single"),"data-view":x,dir:o("dir"),tabIndex:-1,onKeyDown(z){if(z.defaultPrevented||y)return;const de={Enter(){v&&(x==="day"&&_e(d)||x==="month"&&!jt({value:d.month}).selectable||x==="year"&&!Be({value:d.year}).selectable||r({type:"TABLE.ENTER",view:x,columns:I,focus:!0}))},Space(N){de.Enter?.()},ArrowLeft(){r({type:"TABLE.ARROW_LEFT",view:x,columns:I,focus:!0})},ArrowRight(){r({type:"TABLE.ARROW_RIGHT",view:x,columns:I,focus:!0})},ArrowUp(){r({type:"TABLE.ARROW_UP",view:x,columns:I,focus:!0})},ArrowDown(){r({type:"TABLE.ARROW_DOWN",view:x,columns:I,focus:!0})},PageUp(N){r({type:"TABLE.PAGE_UP",larger:N.shiftKey,view:x,columns:I,focus:!0})},PageDown(N){r({type:"TABLE.PAGE_DOWN",larger:N.shiftKey,view:x,columns:I,focus:!0})},Home(){r({type:"TABLE.HOME",view:x,columns:I,focus:!0})},End(){r({type:"TABLE.END",view:x,columns:I,focus:!0})}},ue=de[xr(z,{dir:o("dir")})];ue&&(ue(z),z.preventDefault(),z.stopPropagation())},onPointerLeave(){r({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){r({type:"TABLE.POINTER_DOWN",view:x})},onPointerUp(){r({type:"TABLE.POINTER_UP",view:x})}})},getTableHeadProps(A={}){const{view:x="day"}=A;return t.element({...ee.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":x,"data-disabled":V(y)})},getTableHeaderProps(A={}){const{view:x="day"}=A;return t.element({...ee.tableHeader.attrs,dir:o("dir"),"data-view":x,"data-disabled":V(y)})},getTableBodyProps(A={}){const{view:x="day"}=A;return t.element({...ee.tableBody.attrs,"data-view":x,"data-disabled":V(y)})},getTableRowProps(A={}){const{view:x="day"}=A;return t.element({...ee.tableRow.attrs,"aria-disabled":be(y),"data-disabled":V(y),"data-view":x})},getWeekNumberHeaderCellProps(A={}){const{view:x="day"}=A;return t.element({...ee.tableCell.attrs,scope:"col","aria-label":Y.weekColumnHeader,"data-view":x,"data-type":"week-number","data-disabled":V(y)})},getWeekNumberCellProps(A){const{weekIndex:x,week:I}=A,R=I[0]?ec(I[0],C):0;return t.element({...ee.tableCell.attrs,role:"rowheader","aria-label":Y.weekNumberCell?.(R),"data-view":"day","data-week-index":x,"data-type":"week-number","data-disabled":V(y)})},getDayTableCellState:ot,getDayTableCellProps(A){const{value:x}=A,I=ot(A);return t.element({...ee.tableCell.attrs,role:"gridcell","aria-disabled":be(!I.selectable),"aria-selected":I.selected||I.inRange,"aria-invalid":be(I.invalid),"aria-current":I.today?"date":void 0,"data-value":x.toString()})},getDayTableCellTriggerProps(A){const{value:x}=A,I=ot(A);return t.element({...ee.tableCellTrigger.attrs,id:hr(a,x.toString()),role:"button",dir:o("dir"),tabIndex:y?-1:I.focused?0:-1,"aria-label":Y.dayCell(I),"aria-disabled":be(!I.selectable),"aria-invalid":be(I.invalid),"data-disabled":V(!I.selectable),"data-selectable":V(I.selectable),"data-selected":V(I.selected),"data-value":x.toString(),"data-view":"day","data-today":V(I.today),"data-focus":V(I.focused),"data-unavailable":V(I.unavailable),"data-range-start":V(I.firstInRange),"data-range-end":V(I.lastInRange),"data-in-range":V(I.inRange),"data-outside-range":V(I.outsideRange),"data-weekend":V(I.weekend),"data-in-hover-range":V(I.inHoveredRange),"data-hover-range-start":V(I.firstInHoveredRange),"data-hover-range-end":V(I.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&I.selectable&&r({type:"CELL.CLICK",cell:"day",value:x})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!I.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&om(x,g)||r({type:"CELL.POINTER_MOVE",cell:"day",value:x,focus:z,outsideRange:I.outsideRange})}:void 0})},getMonthTableCellState:jt,getMonthTableCellProps(A){const{value:x,columns:I}=A,R=jt(A);return t.element({...ee.tableCell.attrs,dir:o("dir"),colSpan:I,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":x})},getMonthTableCellTriggerProps(A){const{value:x}=A,I=jt(A);return t.element({...ee.tableCellTrigger.attrs,id:hr(a,x.toString()),role:"button",dir:o("dir"),tabIndex:y?-1:I.focused?0:-1,"aria-label":I.valueText,"aria-disabled":be(!I.selectable),"data-disabled":V(!I.selectable),"data-selectable":V(I.selectable),"data-selected":V(I.selected),"data-value":x,"data-view":"month","data-focus":V(I.focused),"data-outside-range":V(I.outsideRange),"data-range-start":V(I.firstInRange),"data-range-end":V(I.lastInRange),"data-in-range":V(I.inRange),"data-in-hover-range":V(I.inHoveredRange),"data-hover-range-start":V(I.firstInHoveredRange),"data-hover-range-end":V(I.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&I.selectable&&r({type:"CELL.CLICK",cell:"month",value:x})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!I.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&I.value&&Gn(I.value,g)||r({type:"CELL.POINTER_MOVE",cell:"month",value:I.value,focus:z})}:void 0})},getYearTableCellState:Be,getYearTableCellProps(A){const{value:x,columns:I}=A,R=Be(A);return t.element({...ee.tableCell.attrs,dir:o("dir"),colSpan:I,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":x})},getYearTableCellTriggerProps(A){const{value:x}=A,I=Be(A);return t.element({...ee.tableCellTrigger.attrs,id:hr(a,x.toString()),role:"button",dir:o("dir"),tabIndex:y?-1:I.focused?0:-1,"aria-label":I.valueText,"aria-disabled":be(!I.selectable),"data-disabled":V(!I.selectable),"data-selectable":V(I.selectable),"data-selected":V(I.selected),"data-value":x,"data-view":"year","data-focus":V(I.focused),"data-outside-range":V(I.outsideRange),"data-range-start":V(I.firstInRange),"data-range-end":V(I.lastInRange),"data-in-range":V(I.inRange),"data-in-hover-range":V(I.inHoveredRange),"data-hover-range-start":V(I.firstInHoveredRange),"data-hover-range-end":V(I.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&I.selectable&&r({type:"CELL.CLICK",cell:"year",value:x})},onPointerMove:T?R=>{if(R.pointerType==="touch"||!I.selectable||I.outsideRange)return;const z=!a.isActiveElement(R.currentTarget);g&&I.value&&Yn(I.value,g)||r({type:"CELL.POINTER_MOVE",cell:"year",value:I.value,focus:z})}:void 0})},getNextTriggerProps(A={}){const{view:x="day"}=A,I=y||!i("isNextVisibleRangeValid");return t.button({...ee.nextTrigger.attrs,dir:o("dir"),id:uy(a,x),type:"button","aria-label":Y.nextTrigger(x),disabled:I,"data-disabled":V(I),onClick(R){R.defaultPrevented||r({type:"GOTO.NEXT",view:x})}})},getPrevTriggerProps(A={}){const{view:x="day"}=A,I=y||!i("isPrevVisibleRangeValid");return t.button({...ee.prevTrigger.attrs,dir:o("dir"),id:dy(a,x),type:"button","aria-label":Y.prevTrigger(x),disabled:I,"data-disabled":V(I),onClick(R){R.defaultPrevented||r({type:"GOTO.PREV",view:x})}})},getClearTriggerProps(){return t.button({...ee.clearTrigger.attrs,id:nd(a),dir:o("dir"),type:"button","aria-label":Y.clearTrigger,hidden:!u.length,onClick(A){A.defaultPrevented||v&&r({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ee.trigger.attrs,id:od(a),dir:o("dir"),type:"button","data-placement":O,"data-side":F,"aria-label":Y.trigger(P),"aria-controls":Kr(a),"aria-expanded":P,"data-state":P?"open":"closed","data-placeholder-shown":V(w),"aria-haspopup":"grid",disabled:y,onClick(A){A.defaultPrevented||v&&r({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:x="day"}=A;return t.element({...ee.view.attrs,"data-view":x,hidden:s.get("view")!==x})},getViewTriggerProps(A={}){const{view:x="day"}=A,I=ld(x,o("minView"),o("maxView")),R=I!==x,z=y||!R;return t.button({...ee.viewTrigger.attrs,"data-view":x,dir:o("dir"),id:fy(a,x),type:"button",disabled:z,"data-disabled":V(z),"aria-label":Y.viewTrigger(x,R?I:void 0),onClick(de){de.defaultPrevented||v&&r({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:x="day"}=A;return t.element({...ee.viewControl.attrs,"data-view":x,dir:o("dir")})},getInputProps(A={}){const{index:x=0,fixOnBlur:I=!0}=A;return t.input({...ee.input.attrs,id:rc(a,x),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":x,"data-state":P?"open":"closed","data-placeholder-shown":V(w),readOnly:f,disabled:y,required:o("required"),"aria-invalid":be(p),"data-invalid":V(p),placeholder:o("placeholder")||my(C,Y.placeholder(C)),defaultValue:i("valueAsString")[x],onBeforeInput(R){const{data:z}=ci(R);td(z,j,C)||R.preventDefault()},onClick(R){R.defaultPrevented||o("openOnClick")&&v&&r({type:"OPEN",src:"input.click"})},onFocus(){r({type:"INPUT.FOCUS",index:x})},onBlur(R){const z=R.currentTarget.value.trim();r({type:"INPUT.BLUR",value:z,index:x,fixOnBlur:I})},onKeyDown(R){if(R.defaultPrevented||!v)return;const de={Enter(ue){Hf(ue)||_e(d)||ue.currentTarget.value.trim()!==""&&r({type:"INPUT.ENTER",value:ue.currentTarget.value,index:x})}}[R.key];de&&(de(R),R.preventDefault())},onInput(R){const z=R.currentTarget.value;r({type:"INPUT.CHANGE",value:ey(z,j,C),index:x})}})},getMonthSelectProps(){return t.select({...ee.monthSelect.attrs,id:id(a),"aria-label":Y.monthSelect,disabled:y,dir:o("dir"),defaultValue:c.month,onChange(A){Ae(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...ee.yearSelect.attrs,id:ad(a),disabled:y,"aria-label":Y.yearSelect,dir:o("dir"),defaultValue:c.year,onChange(A){Nn(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:rd(a),...ee.positioner.attrs,dir:o("dir"),style:B.floating})},getPresetTriggerProps(A){const x=Array.isArray(A.value)?A.value:oc(A.value,C,E),I=x.filter(R=>R!=null).map(R=>R.toDate(E).toDateString());return t.button({...ee.presetTrigger.attrs,"aria-label":Y.presetTrigger(I),type:"button",onClick(R){R.defaultPrevented||v&&r({type:"PRESET.CLICK",value:x})}})}}}var pr="__live-region-debug__",xy="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;",$y=100,Ly=200,Iy={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 Ty(e={}){const{level:t="polite",document:n=document,root:s,delay:o=0,debug:r=!1}=e,i=n.defaultView??window,a=()=>(typeof s=="function"?s():s)??n.body;let c;function l(){if(!r)return;let p=n.getElementById(pr);return p||(p=n.createElement("div"),p.id=pr,p.dataset.liveAnnouncerDebug="true",p.setAttribute("aria-hidden","true"),p.style.cssText=xy,a().appendChild(p),p)}function u(){const p=n.createElement("span");return p.dataset.liveAnnouncer="true",p.setAttribute("aria-live",t),p.setAttribute("aria-atomic","true"),p.setAttribute("role",t==="assertive"?"alert":"status"),Object.assign(p.style,Iy),a().appendChild(p),d=Date.now()+Ly,p}let d=0,g=u();function h(){i.clearTimeout(c),c=void 0}function y(p,v=o){h(),g?.isConnected||(g=u());const w=g;w.textContent="",c=i.setTimeout(()=>{c=void 0,w.textContent=p;const S=l();S&&(S.textContent=p)},Math.max(v,$y,d-Date.now()))}function f(){h(),g?.remove(),g=null,r&&n.getElementById(pr)?.remove()}return{announce:y,cancel:h,destroy:f,toJSON(){return"live-region"}}}var{and:Ee}=il();function My(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 js(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var Ay=al({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",s=e.selectionMode||"single",o=e.numOfMonths||1;let r;if(e.createCalendar){const y=new Intl.DateTimeFormat(t).resolvedOptions().calendar;y!=="gregory"&&y!=="iso8601"&&(r=e.createCalendar(y))}const i=h=>!r||h.calendar.identifier===r.identifier?h:me(h,r),a=e.defaultValue?Ws(e.defaultValue).map(h=>Re(i(h),e.min,e.max)):void 0,c=e.value?Ws(e.value).map(h=>Re(i(h),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||as(n,r);l=Re(i(l),e.min,e.max);const u=e.minView||"day",d=e.maxView||"year",g=Oi(e.defaultView||e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:s,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(h,{locale:y,timeZone:f}){return new Ve(y,{timeZone:f,day:"2-digit",month:"2-digit",year:"numeric",calendar:r?.identifier}).format(h.toDate(f))},parse(h,{locale:y,timeZone:f}){return oy(h,y,f)},...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 o=n(),r=o.get("view"),i=o.get("value"),a=js(i,e);e("onFocusChange")?.({value:i,valueAsString:a,view:r,focusedValue:s})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:My,hash:s=>s.map(o=>o?.toString()??"").join(","),onChange(s){const o=n(),r=js(s,e);e("onValueChange")?.({value:s,valueAsString:r,view:o.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:Ja(s,"start",{months:e("numOfMonths")},e("locale")),isEqual:Lt,hash:o=>o.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})=>Yl(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>Ey({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})=>!Vm(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!Nm(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>js(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:s,computed:o}){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([()=>o("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})=>vy(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,o=n("maxSelectedDates");if(o==null)return!0;const r=t.get("value"),i=ss(e,s.value??t.get("focusedValue"));return r.some(c=>Lt(c,i))?!0:r.length<o},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=cd(n);return Dr(s,()=>ac(n),{...t("positioning"),defer:!0,onComplete(r){e.set("currentPlacement",r.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",Ty({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:[()=>ac(e)],exclude:[...ns(e),Xs(e),gy(e)],onInteractOutside(r){n.set("restoreFocus",!r.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(r){r.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable",focusVisible:!0})}})}},actions:{setNextView({context:e,prop:t}){const n=ld(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=wy(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"),o=t("locale"),r=t("timeZone");let i;if(t("selectionMode")==="range"){const[a,c]=s;a&&c?i=Hs(a,c,o,r):a?i=Hs(a,null,o,r):c?i=Hs(c,null,o,r):i=""}else i=s.map(a=>Hs(a,null,o,r)).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}){gh({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&&oe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){we(()=>{ns(e).forEach((s,o)=>{Is(s,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;oe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;oe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;oe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;oe(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(o=>Re(o,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")),o=t.get("activeIndex"),r=s[o],i=ss(e,n.value??t.get("focusedValue"));s[o]=_s(r,i),t.set("value",Qs(s))},resetSelection(e){const{context:t,event:n}=e,s=t.get("value")[0],o=ss(e,n.value??t.get("focusedValue"));t.set("value",[_s(s,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,s=ss(e,n.value??t.get("focusedValue")),o=t.get("value"),r=o.findIndex(i=>Lt(i,s));if(r===-1){const i=[...o,s];t.set("value",Ws(i))}else{const i=Array.from(o);i.splice(r,1),t.set("value",Ws(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"),o=n[s],r=e.get("focusedValue").copy();n[s]=_s(o,r),e.set("value",Qs(n));const i=t("valueAsString");e.set("inputValue",i[s])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});oe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});oe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});oe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});oe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:s}=e,o=Ql(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));Bs(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:s}=e,o=ed(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));Bs(e,o)},focusSectionStart(e){const{context:t}=e;oe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;oe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:s,prop:o}=e,r=zm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),o("locale"),o("min"),o("max"));r&&Bs(e,r)},focusPreviousSection(e){const{context:t,event:n,computed:s,prop:o}=e,r=Jm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),o("locale"),o("min"),o("max"));r&&Bs(e,r)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});oe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});oe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});oe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});oe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,s=t.get("focusedValue").calendar;oe(e,as(n("timeZone"),s))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({months:n.columns});oe(e,s)},focusNextMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({months:n.columns});oe(e,s)},focusPreviousYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({years:n.columns});oe(e,s)},focusNextYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({years:n.columns});oe(e,s)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMinimumMonthInYear?.(n)??1;oe(e,n.set({month:s}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMonthsInYear(n);oe(e,n.set({month:s}))},focusFirstYear(e){const{context:t}=e,n=bn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[0]});oe(e,s)},focusLastYear(e){const{context:t}=e,n=bn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[n.length-1]});oe(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");ic(e,s)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&we(()=>{const s=t.get("view");ic(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=Oy(t);we(()=>{sa(e.getActiveElement(),[n])||Xs(e)?.focus(s)})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&we(()=>{const[n]=ns(e);(n??Xs(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){we(()=>cc(e))},restoreFocusToInput({scope:e}){const t=hn(e);we(()=>{sa(e.getActiveElement(),[t])||cc(e)})},syncMonthSelectElement({scope:e,context:t}){const n=py(e);Is(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=hy(e);Is(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=ns(e),o=n.index??t.get("activeIndex");Is(s[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!lc(o)||oe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!lc(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Re(o,n("min"),n("max"));const r=Array.from(e.get("value"));r[t.index]=_s(r[t.index],o);const i=Qs(r);e.set("value",i);const a=js(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 r=Ja(s,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",r)},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})}}}}),ss=(e,t)=>{const{context:n,prop:s}=e,o=n.get("view");let r=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return ky(i=>{by(i,s("minView"))&&(r=r.set({[i]:i==="day"?1:0}))}),r},_s=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let s=t;return"hour"in t||(n?s=Fl(He(t),e.timeZone):s=He(t)),s.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function oe(e,t){const{context:n,prop:s,computed:o}=e;if(!t)return;const r=ss(e,t);if(Lt(n.get("focusedValue"),r))return;const a=Es(o("visibleDuration"),s("locale"),s("min"),s("max"))({focusedDate:r,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Bs(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 Oy(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function dd(e){return Array.isArray(e)?e.map(t=>dd(t)):e instanceof Date?new Ue(e.getFullYear(),e.getMonth()+1,e.getDate()):Lm(e)}const gr=e=>W(`chevron-${e}`),mr=e=>{try{return/^\d{4}-\d{2}-\d{2}$/.test(e)?dd(e):void 0}catch{return}};function Py(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>
106
+ <div class="date-positioner" popover="manual"><section class="date-popover">
107
+ <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>
108
+ <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>
109
+ <div class="date-presets"><button type="button" data-preset="last7Days">Last 7 days</button><button type="button" data-preset="last30Days">Last 30 days</button><button type="button" data-preset="thisMonth">This month</button></div>
110
+ <div class="date-calendar"><div class="date-navigation"><button type="button" class="icon-button date-prev">${gr("left")}</button><button type="button" class="date-view"></button><button type="button" class="icon-button date-next">${gr("right")}</button></div><div class="date-grids"></div></div>
111
+ <footer class="date-footer"><span class="date-status" role="status"></span><button id="apply-dates" class="primary-button" type="button">Apply range ${gr("right")}</button></footer>
112
+ </section></div>`;const s=f=>e.querySelector(f),o=s(".date-trigger"),r=s(".date-positioner"),i=s(".date-popover"),a=[s("#from-date"),s("#to-date")],c=s("#apply-dates"),l=new pl(Ay,{id:"timeline-dates",selectionMode:"range",closeOnSelect:!1,fixedWeeks:!0,outsideDaySelectable:!0,locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,format:f=>f.toString(),parse:mr,placeholder:"YYYY-MM-DD",positioning:{placement:"top-end",strategy:"fixed",gutter:12,slide:!0},onOpenChange({open:f}){f&&n()}}),u=()=>Sy(l.service,ul),d=["day","month","year"].map(f=>{const p=document.createElement("table");p.dataset.calendarView=f;const v=p.createTHead(),w=v.insertRow();if(f==="day")for(let E=0;E<7;E++)w.append(document.createElement("th"));const S=p.createTBody(),M=f==="day"?6:4,C=f==="day"?7:3;for(let E=0;E<M;E++){const b=S.insertRow();for(let k=0;k<C;k++){const P=document.createElement("button");P.type="button",b.insertCell().append(P)}}return s(".date-grids").append(p),{view:f,table:p,head:v,body:S}});function g(){const f=a.map(w=>mr(w.value)),p=!!(f[0]&&f[1]&&f[0].compare(f[1])<=0);c.disabled=!p;for(const[w,S]of a.entries())S.setAttribute("aria-invalid",String(!!S.value&&!f[w]));const v=p?"Both dates included":"Choose a start and end date";s(".date-status").textContent!==v&&(s(".date-status").textContent=v)}function h(){const f=u();ie(e,f.getRootProps()),ie(s(".date-control"),f.getControlProps()),ie(o,{...f.getTriggerProps(),"aria-label":"Custom date range"}),ie(r,f.getPositionerProps()),ie(i,{...f.getContentProps(),"aria-label":"Custom date range"}),a.forEach((w,S)=>ie(w,{...f.getInputProps({index:S}),"aria-label":S?"To date":"From date"})),ie(s(".date-prev"),f.getPrevTriggerProps({view:f.view})),ie(s(".date-next"),f.getNextTriggerProps({view:f.view}));const p=f.view==="day"?f.visibleRangeText.start:f.view==="month"?String(f.visibleRange.start.year):`${f.getDecade().start} – ${f.getDecade().end}`,v=s(".date-view");ie(v,f.getViewTriggerProps({view:f.view})),v.textContent!==p&&(v.textContent=p);for(const{view:w,table:S,head:M,body:C}of d){S.hidden=f.view!==w,ie(S,f.getTableProps({view:w,columns:w==="day"?7:3})),ie(M,f.getTableHeaderProps({view:w})),ie(C,f.getTableBodyProps({view:w})),w==="day"&&f.weekDays.forEach((b,k)=>{const P=M.rows[0].cells[k];P.scope="col",P.setAttribute("aria-label",b.long),P.textContent!==b.short&&(P.textContent=b.short)});const E=w==="day"?f.weeks:w==="month"?f.getMonthsGrid({columns:3,format:"short"}):f.getYearsGrid({columns:3});Array.from(C.rows).forEach((b,k)=>{ie(b,f.getTableRowProps({view:w})),Array.from(b.cells).forEach((P,T)=>{const m=E[k]?.[T],$=P.firstElementChild;if(P.hidden=!m,!!m)if(w==="day"){const D=f.weeks[k][T];ie(P,f.getDayTableCellProps({value:D})),ie($,f.getDayTableCellTriggerProps({value:D})),$.textContent!==String(D.day)&&($.textContent=String(D.day))}else{const D=m;ie(P,w==="month"?f.getMonthTableCellProps({...D,columns:3}):f.getYearTableCellProps({...D,columns:3})),ie($,w==="month"?f.getMonthTableCellTriggerProps({...D}):f.getYearTableCellTriggerProps({...D})),$.textContent!==D.label&&($.textContent=D.label)}})})}r.hidden=!f.open,f.open&&!r.matches(":popover-open")&&r.showPopover?.(),!f.open&&r.matches(":popover-open")&&r.hidePopover?.(),o.classList.toggle("active",f.open),g()}s(".date-close").addEventListener("click",()=>u().setOpen(!1));for(const f of e.querySelectorAll("[data-preset]"))f.addEventListener("click",()=>{const p=u(),v=p.getRangePresetValue(f.dataset.preset);p.setValue(v),p.setFocusedValue(v[0]),p.setView("day")});c.addEventListener("click",()=>{g(),c.disabled||(t(a[0].value,a[1].value),u().setOpen(!1))}),i.addEventListener("input",g),e.addEventListener("keydown",f=>f.stopPropagation());const y=l.subscribe(h);return l.start(),h(),{setRange(f,p){const v=[f,p].map(mr).filter(w=>w!==void 0);u().setValue(v),v[0]&&u().setFocusedValue(v[0])},dispose(){y(),l.stop(),e.replaceChildren()}}}const Dy="Cosmic Wobbly Disco Sneaky Bouncy Galactic Crispy Dizzy Fuzzy Noodle Groovy Sleepy Spicy Jolly Loopy Squishy Turbo Giggly Velvet Soggy Zippy Fluffy Moonwalking Wiggly Fizzy Snazzy Goofy Jazzy Tiny Chunky Dapper Wacky".split(" "),Ry="Wombat Pickle Pancake Badger Potato Narwhal Noodle Goblin Otter Turnip Hamster Comet Dumpling Goose Biscuit Llama Muffin Squid Raccoon Toaster Waffle Penguin Yeti Pudding Walrus Taco Jellybean Platypus Sloth Cactus Donut Mongoose".split(" ");function Vy(e,t){let n=5457746;const s=(()=>(n=Math.imul(n,1664525)+1013904223>>>0,n/2**32)),o=Dy.flatMap(r=>Ry.map(i=>`${r} ${i}`));for(let r=o.length-1;r>0;r--){const i=Math.floor(s()*(r+1));[o[r],o[i]]=[o[i],o[r]]}return Array.from({length:e},(r,i)=>`Project ${"Mega".repeat(Math.floor(i/o.length))}${o[i%o.length]}`)}const Ny={tokens:"Tokens",timestamps:"Session times",messageCounts:"Message counts",messageTimestamps:"Message times",model:"Models",harness:"Harness"},mo={tokens:!0,timestamps:!0,messageCounts:!0,messageTimestamps:!0,model:!0,harness:!0};function Fy(e){const t={...mo};if(ud(e))for(const n of Object.keys(t))typeof e[n]=="boolean"&&(t[n]=e[n]);return(!t.timestamps||!t.messageCounts)&&(t.messageTimestamps=!1),t}function dc(e){return e.timestamps?Math.max(e.timestamps.created,e.timestamps.lastMessageAt??0):0}function bv(e,t){return dc(t)-dc(e)||t.id-e.id}const uc=1e4,Hy=2e6,Wy=1e5,jy="Visible on your profile and in Explore. Names, messages, code, paths, and costs stay private.",_y=/^(?:gpt-[3-6](?:\.[0-9])?(?:-(?:turbo|mini|nano|pro|codex|astra|instant|thinking|chat|latest|preview|[0-9]{4,8}))*|o[1-4](?:-(?:mini|pro|preview|[0-9]{4,8}))*|claude-(?:(?:sonnet|opus|haiku)-[3-5](?:[.-][0-9])?|[3-5](?:-[0-9])?-(?:sonnet|opus|haiku))(?:-(?:latest|thinking|[0-9]{8}))*|gemini-[1-4](?:\.[0-9])?-(?:pro|flash)(?:-(?:lite|preview|exp|latest|[0-9]{2,4}))*|deepseek-(?:chat|reasoner|v[3-4](?:\.[0-9])?|r1)|grok-[2-5](?:\.[0-9])?(?:-(?:fast|code|reasoning|non-reasoning|[0-9]))*|kimi-k[1-3](?:\.[0-9])?(?:-thinking)?|minimax-m[1-3](?:\.[0-9])?)$/i,By=e=>{const t=e.split("/").at(-1)||"";return t.length<=100&&_y.test(t)?t.toLowerCase():null},ud=e=>!!e&&typeof e=="object"&&!Array.isArray(e),un=(e,t)=>ud(e)&&Object.keys(e).length===t.length&&t.every(n=>Object.hasOwn(e,n)),yo=(e,t=Number.MAX_SAFE_INTEGER)=>Number.isSafeInteger(e)&&e>=0&&e<=t,yr=e=>yo(e,Date.UTC(2100,0,1)),vr=e=>e===null||yo(e);function qy(e){const t=()=>{throw new Error("Invalid anonymous graph. Reopen the publishing preview and try again.")};if(!un(e,["version","settings","sessions"])||e.version!==1||!Array.isArray(e.sessions)||!un(e.settings,Object.keys(mo))||Object.values(e.settings).some(a=>typeof a!="boolean"))return t();const n=e.settings;if(n.messageTimestamps&&(!n.timestamps||!n.messageCounts))return t();if(e.sessions.length<1||e.sessions.length>uc)throw new Error(`Choose between 1 and ${uc.toLocaleString("en")} sessions to publish.`);const s=["id","group","parent","fork",...n.timestamps?["timestamps"]:[],...n.tokens?["tokens"]:[],...n.messageCounts?["messages"]:[],...n.messageTimestamps?["messageTimes"]:[],...n.model?["model"]:[],...n.harness?["harness"]:[]];let o=0;for(let a=0;a<e.sessions.length;a++){const c=e.sessions[a];if(!un(c,s)||c.id!==a||!yo(c.group,e.sessions.length-1))return t();for(const l of["parent","fork"])if(c[l]!==null&&(!yo(c[l],e.sessions.length-1)||c[l]===a))return t();if(n.timestamps&&(!un(c.timestamps,["created","lastMessageAt"])||!yr(c.timestamps.created)||c.timestamps.lastMessageAt!==null&&!yr(c.timestamps.lastMessageAt))||n.tokens&&!vr(c.tokens)||n.messageCounts&&(!un(c.messages,["count","untimed","partial"])||!vr(c.messages.count)||!vr(c.messages.untimed)||typeof c.messages.partial!="boolean")||n.messageTimestamps&&(!un(c.messageTimes,["values","limited"])||!Array.isArray(c.messageTimes.values)||c.messageTimes.values.length>2e3||typeof c.messageTimes.limited!="boolean"||c.messageTimes.values.some(l=>!yr(l))||(o+=c.messageTimes.values.length,o>Wy))||n.model&&c.model!==null&&(typeof c.model!="string"||By(c.model)!==c.model)||n.harness&&c.harness!==null&&(typeof c.harness!="string"||!Ou(c.harness)))return t()}const r=e.sessions,i=new Uint8Array(r.length);for(let a=0;a<r.length;a++){if(i[a])continue;const c=[[a,!1]];for(;c.length;){const[l,u]=c.pop();if(u){i[l]=2;continue}if(i[l]===1)return t();if(i[l]!==2){i[l]=1,c.push([l,!0]);for(const d of[r[l].parent,r[l].fork])d!==null&&c.push([d,!1])}}}if(new TextEncoder().encode(JSON.stringify(e)).length>Hy)throw new Error("This graph is too large. Choose a smaller date range.");return e}function wv(e,t){const n=qy(e),s=n.sessions.filter(a=>!t||t.has(a.id)).map(a=>({id:String(a.id),projectID:String(a.group),title:`Session ${a.id+1}`,directory:"",created:a.timestamps?.created??a.id*36e5,updated:a.timestamps?.created??a.id*36e5,tokens:a.tokens??null,cost:null,archived:!1,model:a.model??"",provider:"",agent:"",source:a.harness??void 0,activity:{firstMessageAt:null,lastMessageAt:a.timestamps?.lastMessageAt??null,userMessages:0,untimedUserMessages:0},...a.parent===null?{}:{parentID:String(a.parent)},...a.fork===null?{}:{forkID:String(a.fork)}})),o=Vy(Math.max(...n.sessions.map(a=>a.group))+1),r=[...new Set(n.sessions.map(a=>a.group))].map(a=>({id:String(a),name:o[a],directory:"",worktrees:[]})),i=yc(s.map(a=>({...a,source:void 0})),r);i.calendarTime=n.settings.timestamps;for(const a of i.nodes)a.session.source=n.sessions[Number(a.session.id)].harness??void 0;return i}function Uy(e,t,n){e.open&&(e.addEventListener("close",()=>n(t),{once:!0}),e.close())}function Gy(e,t,n){const s=document.createDocumentFragment(),o=document.createElement("header");o.className="sharing-header";const r=document.createElement("h2");r.id=`sharing-${t}-title`,r.textContent="Share",e.setAttribute("aria-labelledby",r.id);const i=document.createElement("button");i.type="button",i.className="text-button",i.textContent="Close",i.setAttribute("aria-label","Close sharing"),i.onclick=()=>e.close();const a=document.createElement("div");a.className="sharing-modes",a.setAttribute("role","group"),a.setAttribute("aria-label","Share method");for(const c of["publish","video"]){const l=document.createElement("button");l.type="button",l.dataset.shareMode=c,l.textContent=c==="publish"?"Publish":"Video",l.setAttribute("aria-pressed",String(c===t)),l.onclick=()=>{c!==t&&Uy(e,c,n)},a.append(l)}return o.append(r,a,i),s.append(o),s}function Yy(e,t,n){const s=document.createElement("dialog");s.className="publishing-dialog",s.setAttribute("aria-labelledby","publishing-title"),s.innerHTML=`<div class="publishing-account"><span data-account hidden></span><span class="publishing-account-placeholder" role="status" hidden><span class="sr-only">Checking sign-in…</span></span><button class="text-button" data-account-retry hidden>Couldn’t check sign-in. Retry</button><button class="secondary-button" data-login hidden><span data-login-label>Sign in with GitHub</span></button></div>
113
+ <div class="publishing-connect" hidden><p>Confirm this code in your browser: <strong data-code></strong></p><a class="secondary-button" data-connect target="_blank" rel="noopener noreferrer">Continue in browser ↗</a><button class="text-button" data-check>Check login</button><label class="publishing-browser-link">Browser link<input type="text" data-connect-url readonly aria-label="Browser sign-in link"></label><button class="text-button" data-copy-link>Copy browser link</button></div>
114
+ <p class="publishing-disclosure"></p>
115
+ <details class="publishing-settings"><summary><span class="publishing-scope"></span><span>Shared details</span></summary><fieldset class="publishing-fields" aria-label="Shared details">${Object.entries(Ny).map(([O,F])=>`<label><input type="checkbox" data-field="${O}" checked><span>${F}</span></label>`).join("")}</fieldset><button class="text-button" data-json aria-pressed="false" aria-controls="publishing-json" disabled>View JSON</button></details>
116
+ <div class="publishing-error" hidden><p role="alert" data-preview-error></p><button class="secondary-button" data-retry>Retry preview</button></div>
117
+ <div class="publishing-preview"></div><pre class="publishing-json" id="publishing-json" tabindex="0" aria-label="Public graph JSON" hidden></pre>
118
+ <p role="status" class="publishing-status"></p>
119
+ <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(Gy(s,"publish",()=>t()));const o=O=>s.querySelector(O);o(".publishing-disclosure").textContent=jy,o("[data-login]").prepend(Cr("github"));let r=[],i={...mo},a,c,l=n.preloadedUsername,u=!1,d="checking",g=0,h=!1,y=!1,f=!1,p=0,v=!1,w=!1,S=0,M,C;const E=O=>{o(".publishing-status").textContent=O},b=(O,F="GET",B,j)=>Xe(`/api/sessiongraph/publishing/${O}`,"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 k(){const O=d==="ready";o("[data-publish]").disabled=h||!c||!O||!l||f,o("[data-publish]").textContent=y?"Preparing…":f?"Published":u?"Update graph":"Publish graph",o("[data-publish]").title=O?l?c?"":"Waiting for a preview":"Sign in to publish":"Waiting for account status",o("[data-remove]").hidden=!u,o("[data-remove]").disabled=h||!O,o("[data-login]").hidden=!O||!!l||!!M,o("[data-login]").disabled=h||w,o("[data-login-label]").textContent=w?"Opening sign-in…":"Sign in with GitHub",o("[data-login]").setAttribute("aria-busy",String(w)),o("[data-account]").hidden=!l&&!M,o("[data-account]").textContent=l?`@${l}`:M?"Waiting for browser approval":"",o(".publishing-account-placeholder").hidden=d!=="checking"||!!l||!!M,o("[data-account-retry]").hidden=d!=="failed",o("[data-json]").disabled=!c,o("[data-retry]").disabled=h||y;for(const B of s.querySelectorAll("[data-field]")){const j=B.dataset.field;B.checked=i[j],B.disabled=h||j==="messageTimestamps"&&(!i.timestamps||!i.messageCounts),B.closest("label").title=j==="messageTimestamps"&&B.disabled&&!h?"Enable session times and message counts first":""}const F=o(".publishing-link");F.hidden=!l||!u,l&&(F.href=`https://sessiongraph.ai/@${l}`)}function P(O){o(".publishing-json").hidden=!O,o(".publishing-preview").hidden=O,o("[data-json]").textContent=O?"Back to graph":"View JSON",o("[data-json]").setAttribute("aria-pressed",String(O)),O&&(o(".publishing-json").textContent=c?JSON.stringify(c.graph,null,2):"",o(".publishing-json").focus())}function T(O){o(".publishing-error").hidden=!O,o("[data-preview-error]").textContent=O}async function m(){const O=++g;c=void 0,f=!1;const F=()=>s.open&&O===g;C?.abort();const B=new AbortController;if(C=B,y=!!r.length,T(""),P(!1),o(".publishing-json").textContent="",k(),o(".publishing-preview").setAttribute("aria-busy",String(y)),!r.length){o(".publishing-preview").textContent="Choose sessions on the map to share.";return}a||(o(".publishing-preview").textContent="Preparing preview…");try{const j=await b("preview","POST",{ids:r,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 ws(async()=>{const{createPublicViewer:Me}=await import("./public-viewer-B1aKDYpa.js");return{createPublicViewer:Me}},__vite__mapDeps([0,1,2,3]));if(!F())return;a=Y(o(".publishing-preview"),j.graph)}c=j,i=j.graph.settings}catch(j){F()&&(c=void 0,a?.dispose(),a=void 0,o(".publishing-preview").textContent="",T(j.message))}finally{F()&&(y=!1,o(".publishing-preview").setAttribute("aria-busy","false"),k())}}async function $(){const O=S;d="checking",k();try{const F=await n.check();if(!s.open||O!==S)return;({username:l,published:u}=F),d="ready",l&&(M=void 0,o(".publishing-connect").hidden=!0,window.clearInterval(p),p=0)}catch{if(!s.open||O!==S)return;d="failed"}return k(),d==="ready"}async function D(){if(v||!s.open)return;const O=S;v=!0,o("[data-check]").disabled=!0;try{const F=await b("poll","POST",{});if(!s.open||O!==S)return;if(F.username){window.clearInterval(p),p=0,M=void 0,o(".publishing-connect").hidden=!0,l=F.username,k();const B=await $();s.open&&O===S&&E(B&&!l?"Sign-in expired. Please try again.":"Signed in.")}}catch(F){if(!s.open||O!==S)return;[400,401].includes(F.status)&&(window.clearInterval(p),p=0,M=void 0,o(".publishing-connect").hidden=!0,k()),E(F.message)}finally{v=!1,o("[data-check]").disabled=!1}}o("[data-login]").onclick=async()=>{if(d!=="ready"||l||w||M)return;const O=++S;w=!0,k(),E("Preparing browser sign-in…");let F=null;if(!vn())try{F=window.open("about:blank","_blank"),F&&(F.opener=null)}catch{F=null}try{const B=await b("login","POST",{});if(!s.open||O!==S){F?.close();return}const j=xl(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.");M=j,o("[data-code]").textContent=B.code,o("[data-connect]").href=j,o("[data-connect-url]").value=j,o(".publishing-connect").hidden=!1,window.clearInterval(p),p=window.setInterval(()=>{D()},4e3),o("[data-connect]").focus(),E("Continue in your browser to connect this app."),vn()?await H(o("[data-connect]")):F&&(F.location.replace(j),E("Sign in in the browser tab and confirm the matching code, then return here."))}catch(B){F?.close(),O===S&&E(B.message)}finally{O===S&&(w=!1,k())}};async function H(O){if(O.getAttribute("aria-busy")==="true")return;O.setAttribute("aria-busy","true");const F=S,B=O.hasAttribute("data-connect");try{await $l(O.href),B&&s.open&&F===S&&E("Browser opened. Sign in and confirm the matching code, then return here.")}catch{s.open&&F===S&&E(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{O.removeAttribute("aria-busy")}}s.addEventListener("click",O=>{const F=O.target.closest('a[target="_blank"]');!F||!vn()||O.defaultPrevented||O.button!==0||(O.preventDefault(),H(F))}),o("[data-copy-link]").onclick=async()=>{const O=o("[data-connect-url]");try{await navigator.clipboard.writeText(O.value),E("Browser link copied. Paste it into your browser to sign in and confirm the code.")}catch{O.focus(),O.select(),E("Browser link selected. Copy it and paste it into your browser.")}},o("[data-account-retry]").onclick=()=>{$()},o("[data-check]").onclick=()=>{D()};for(const O of s.querySelectorAll("[data-field]"))O.onchange=()=>{i=Fy({...i,[O.dataset.field]:O.checked}),E(""),m()};return o("[data-retry]").onclick=()=>{E(""),m()},o("[data-publish]").onclick=async()=>{if(!(h||!c||d!=="ready"||!l||f)){h=!0,k(),E("Publishing…");try{await b("publish","POST",{id:c.id,confirmed:!0}),u=!0,f=!0,T(""),E("Published.")}catch(O){E(""),T(O.message),O.status===401&&(l=null,u=!1)}finally{h=!1,k()}}},o("[data-remove]").onclick=async()=>{if(!(h||d!=="ready"||!l||!u)){h=!0,k();try{await b("unpublish","POST",{}),u=!1,E("Unpublished."),await m()}catch(O){E(O.message),O.status===401&&(l=null,u=!1)}finally{h=!1,k()}}},o("[data-json]").onclick=()=>{c&&P(o(".publishing-json").hidden)},s.addEventListener("close",()=>{s.open||(g++,S++,w=!1,window.clearInterval(p),p=0,C?.abort(),a?.dispose(),a=void 0,c=void 0,e())}),{async open(O){if(s.open)return;g++,S++,window.clearInterval(p),p=0,a?.dispose(),a=void 0,i={...mo},o(".publishing-settings").open=!1,r=[...O],d="checking",c=void 0,f=!1,y=!0,w=!1,E(""),T(""),P(!1),o(".publishing-preview").textContent="Preparing preview…",o(".publishing-connect").hidden=!M,o(".publishing-scope").textContent=`${r.length.toLocaleString()} sessions selected`,k(),s.showModal(),e();const F=S,B=$().then(()=>{s.open&&F===S&&M&&!l&&!p&&(p=window.setInterval(()=>{D()},4e3),D())});await Promise.all([m(),B])},dispose(){g++,S++,C?.abort(),window.clearInterval(p),a?.dispose(),a=void 0,s.close(),s.remove()}}}const Ky=3e4;function Zy(e=fetch){let t,n,s=!1;async function o(){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 r=()=>t??=o().finally(()=>{t=void 0});return r().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<Ky?Promise.resolve(i.account):r()}}}const zy=Zy(),We=()=>hs(),L=e=>document.querySelector(e),X=e=>e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]),fd=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e),le=e=>e.toLocaleString("en"),Jy=[new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}),new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"})],Xy=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}),Qy=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),ys=(e,t=!1)=>Jy[Number(t)].format(e),vo=e=>Xy.format(e),fc=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`};let U,se={nodes:[],edges:[],lanes:[],start:0,end:0},he=[],Pi=[],hd=new Set,cs=new Map,vs=new Map,pd=new Map,Q,gd=!0,os,G=new URLSearchParams(location.search).get("session"),Qe,Te,eo=0,kt="",Ln="",et="",en=wi.days,Dt="",Rt="",In=!0,tn=!1,to=0,Zr,zr,Di=0,Vt=!1,ce=1,bo=0,ls=0,ct=vl([]),Jr="",md=wl([]),no,br,hc,Zn=0,zn=!1,Z={...Do},nn=!0,Ho,Ne,bs=!1,Xr="";try{Z=Cl(localStorage)}catch{nn=!1}const yd=matchMedia("(prefers-reduced-motion: reduce)");L("#app").innerHTML=`
120
+ <main class="map" aria-label="Session map">
121
+ <h1 class="sr-only">SessionGraph — Explore &amp; visualize all your LLM sessions</h1>
122
+ <div id="scene"></div>
123
+ <div class="canvas-vignette"></div>
124
+ <div id="graph-message" class="graph-message"><div class="loading-orbit"><span></span><span></span><span></span></div><h3>Loading sessions…</h3></div>
125
+ <div id="tooltip" class="node-tooltip" hidden></div>
126
+ </main>
127
+ <header class="app-header glass">
128
+ <a class="brand" href="/" aria-label="SessionGraph home" title="Explore &amp; visualize all your LLM sessions"><img src="/brand/mark.svg" alt=""/><span>SessionGraph</span></a>
129
+ <span class="connection" role="status" title="Connecting"><span class="status-dot"></span><span id="connection-label" class="sr-only">Connecting</span></span>
130
+ <span class="toolbar-divider"></span>
131
+ ${at("search","Toggle sessions",{id:"toggle-explorer","aria-controls":"explorer","aria-expanded":"true"},"Sessions","Sessions")}
132
+ </header>
133
+ <nav class="map-controls glass" aria-label="Map controls">
134
+ ${at("center-focus","Fit view",{id:"reset-camera"},"Fit view (F)")}
135
+ ${at("clock","Toggle timeline",{id:"toggle-timeline","aria-controls":"timeline","aria-expanded":"true"},"Timeline")}
136
+ ${at("panel-right","Toggle session details",{id:"toggle-inspector","aria-controls":"inspector","aria-expanded":"false",hidden:!0},"Session details")}
137
+ ${at("circle-help","Help",{id:"help","aria-haspopup":"dialog"})}
138
+ ${at("volume-2","Mute sound",{id:"mute-audio","aria-pressed":"false","data-sound":"none"})}
139
+ ${at("settings-2","Settings",{id:"open-settings","aria-haspopup":"dialog"})}
140
+ ${at("share-2","Share SessionGraph",{id:"open-publishing","aria-haspopup":"dialog"})}
141
+ </nav>
142
+ <aside class="sidebar floating-panel glass" id="explorer" aria-label="Sessions">
143
+ <div class="panel-heading"><h2 class="panel-title">Sessions <span class="small-badge" id="list-count">—</span></h2><button class="icon-button" id="refresh" aria-label="Refresh sessions" title="Refresh sessions">${W("refresh-cw")}</button><button class="icon-button" id="close-explorer" aria-label="Close sessions">${W("x")}</button></div>
144
+ <button class="search-box search-trigger" id="search" aria-label="Search all sessions">${W("search")}<span>Search everything…</span><kbd>/</kbd></button>
145
+ <div class="filters">
146
+ <div class="filter-row"><div class="select-wrap"><select id="source" data-source-icons="/sources" aria-label="Session source"><option value="">All sources</option></select>${W("chevron-down")}</div><button class="icon-button" id="manage-sources" aria-label="Manage sources" title="Import sources">${W("sliders-horizontal")}</button></div>
147
+ <div class="select-wrap">${W("folder")}<select id="project" aria-label="Project"><option value="">All projects</option></select>${W("chevron-down")}</div>
148
+ <div class="select-wrap">${W("git-branch")}<select id="directory" aria-label="Worktree or directory"><option value="">All directories</option></select>${W("chevron-down")}</div>
149
+ <div class="filter-toggles"><label><input type="checkbox" id="children" checked/><span>Subagent sessions</span></label></div>
150
+ </div>
151
+ <nav class="session-list" id="session-list" aria-label="Sessions"><div class="list-loading">${[0,1,2,3,4].map(()=>'<div class="skeleton"></div>').join("")}</div></nav>
152
+ </aside>
153
+ <div class="inspector-stack floating-panel" id="inspector" hidden><aside class="inspector glass" id="session-inspector" aria-label="Session details"></aside></div>
154
+ <div class="timeline-dock floating-panel" id="timeline">
155
+ <div class="playback-share"><button id="share-playback" class="primary-button" disabled>${W("share-2")}Share SessionGraph</button></div>
156
+ <section class="timeline-panel glass timeline-controls" aria-label="Timeline controls">
157
+ ${Dg(`<span class="panel-title" id="date-label">Timeline</span><div class="range-buttons" role="group" aria-label="Date range"><button data-days="7">7D</button><button data-days="30">30D</button><button data-days="90">90D</button><button data-days="ytd" class="active" title="Year to date" aria-pressed="true">YTD</button><button data-days="0">All</button></div><div class="custom-dates"></div><button class="icon-button" id="close-timeline" aria-label="Close timeline">${W("x")}</button>`,{play:"play",histogram:"histogram",scrubber:"scrubber",cursor:"timeline-cursor",date:"playback-date",period:"playback-period",summary:"playback-summary",sessions:"playback-sessions",tokens:"playback-tokens"},{showCoverage:!1})}
158
+ </section>
159
+ </div>
160
+ ${xu("help-dialog",["search","fit","panels","clear"],`
161
+ <div class="graph-legend"><span><i class="legend-node"></i>Session orb</span><span><i class="legend-node message"></i>Message</span><span><i class="legend-line lane"></i>Session lifetime</span><span><i class="legend-line fork"></i>Fork</span><span><i class="legend-line child"></i>Child</span><span id="file-legend" hidden><i class="legend-file"></i>File</span></div>
162
+ <p>Search also opens with ⌘/Ctrl K. Each trail follows a session to its latest saved message. Only fork and child links represent ancestry.</p>`)}
163
+ <div id="toast" class="toast" role="status" hidden></div>
164
+ ${Eu(["search","fit","panels","clear"],"shortcut-hints")}
165
+ `;We();const Ge=document.createElement("dialog");Ge.className="welcome-screen";Ge.setAttribute("aria-labelledby","welcome-title");Ge.setAttribute("aria-describedby","welcome-tagline");Ge.innerHTML=`<div class="welcome-content">
166
+ <img src="/brand/mark.svg" width="64" height="64" alt="">
167
+ <h2 id="welcome-title">SessionGraph</h2>
168
+ <p id="welcome-tagline">Explore your coding agent history as an interactive graph.</p>
169
+ <button type="button" class="primary-button" aria-describedby="welcome-permission" autofocus>Start ${W("arrow-right")}</button>
170
+ <small id="welcome-permission">After you click Start, your system may ask for permission to access your files.</small>
171
+ </div>`;document.body.append(Ge);let Ri=!1,pc=!1;function Vi(){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 Tn=new Vu(L("#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:${pd.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")}">${kn(n.source)}${X(Fe(n.source))}</span><span title="${n.activity?.lastMessageAt?"Latest saved message":"Session created; message time unavailable"}">${Qy.format(s)}</span></span></span></button>`}else t.innerHTML=`<div class="list-date">${e.label}<span>${e.year}</span></div>`;return t.content.firstElementChild}});Jg();mg();const vd=Py(L(".custom-dates"),(e,t)=>{en=0,Dt=e,Rt=t,Ye(!0)},ge),xt=()=>{const e=!!document.querySelector("dialog[open]");e&&Vt&&ge(),Q?.setSuspended(e)},Ni=new Ug,tt=jg(L("#tooltip"),L("#scene"),Ni);let Qr;const Pn=Wg(L("#inspector"),Ni,{select:e=>{const t=e?.sessionID===G?e:null;tt.clear(),Q?.selectEvent(t?.id||null),t&&!Vt&&(ce=1,Rn(),Q?.focusEvent(Te?.items.find(n=>n.id===t.id)||t))}});function Fi(e){const t=U?.sessions.find(n=>n.id===G);t&&(tt.clear(),ge(),pe("inspector",!0),Pn.open(t,e,e?Te?.revision:void 0,Te?.items.find(n=>n.id===e)?.kind==="commit"?"tools":"messages"))}const Dn=Ng({publishing:_o,change:bd,getArchived:()=>tn,changeArchived:e=>{tn=e,Ye()},visibility:xt,previewSound:()=>{wo.play("select")},getSources:()=>Et.sources(),importSources:e=>Et.select(e)}),wo=new Fg(Z,Dn.audioStatus);function Ss(){Q?.applyPreferences(Z),wo.configure(Z);const e=document.documentElement.dataset.density!==Z.density;document.documentElement.dataset.density=Z.density,e&&Tn.resetHeights(),document.documentElement.dataset.motion=String(Vg(Z,yd.matches)),document.documentElement.style.setProperty("--panel-opacity",`${Z.panelOpacity}%`);const t=L("#mute-audio"),n=Su(Z.muted);t.setAttribute("aria-pressed",String(Z.muted)),t.setAttribute("aria-label",n.label),t.title=n.label,t.innerHTML=W(n.glyph),Dn.render(Z,nn||bs,Ne?.state||"saved",Ne?.error),We()}function bd(e){const t=e.autoImport!==void 0&&e.autoImport!==Z.autoImport;Z=Ro({...Z,...e});try{nn=kl(localStorage,Z)}catch{nn=!1}Ss(),U&&Z.grouping!==wn&&Ye(!0),Hi({preferences:{...Z},...t?{autoImport:Z.autoImport}:{}})}function Hi(e){Ne?.save(e)}function ei(){return{sourceID:Ln,projectID:kt,directory:et,days:en,fromDate:Dt,toDate:Rt,includeChildren:In,includeArchived:tn}}L("#open-settings").addEventListener("click",()=>Dn.open());L("#mute-audio").addEventListener("click",()=>bd({muted:!Z.muted}));const ev=()=>Ss();yd.addEventListener("change",ev);const tv=e=>{if(e.key===Ei)try{Z={...Cl(localStorage),autoImport:Z.autoImport},Ss(),U&&Z.grouping!==wn&&Ye(!0)}catch{}};window.addEventListener("storage",tv);Ss();Ne=new $g(async e=>{await Xe("/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=>{Dn.render(Z,nn||bs,e,Ne?.error),e==="error"&&Ht(Ne?.error||"Could not save settings."),e==="saved"&&Ho?.check()});const nv=yg(xt),Et=kg(e=>Bi(e),xt,Ht);Ho=new xg({eligible:()=>Z.autoImport&&!Ne?.pending&&document.visibilityState==="visible"&&!!(U&&!U.onboarding&&U.sources?.some(e=>e.selected)),busy:()=>Et.busy||!!document.querySelector("dialog[open]"),refresh:()=>Et.refresh(!0)});const Wo=new AbortController,xs=()=>{document.visibilityState==="visible"&&(Ne?.state==="error"&&Ne.flush(),Ho?.check())};window.addEventListener("focus",xs,{signal:Wo.signal});document.addEventListener("visibilitychange",xs,{signal:Wo.signal});window.setInterval(xs,Eg);L("#manage-sources").addEventListener("click",()=>Dn.open("sources"));document.addEventListener("sessiongraph-import-status",e=>{const t=e.detail;Ho?.activity(),Dn.importStatus(t),U&&(U.importing=t.running),he.length||jo(),L("#refresh").classList.toggle("spinning",t.running),L(".connection").title=t.running?`Importing ${Fe(t.source)} · ${t.imported} sessions saved`:t.failed?t.errors[0]||"Import failed.":"Local library · SQLite"},{signal:Wo.signal});const Wi=Ru(Vn,xt,e=>{nv.open(e)});L("#search").addEventListener("click",Wi.open);function pe(e,t){Vt&&(e==="timeline"?!t:t)&&ge();const n=L(`#${e}`);n.hidden=!t,L(`#toggle-${e}`).setAttribute("aria-expanded",String(t)),t&&innerWidth<760&&e!=="timeline"&&pe(e==="explorer"?"inspector":"explorer",!1)}pe("explorer",innerWidth>=760);let wr=[];for(const e of["explorer","timeline","inspector"])L(`#toggle-${e}`).addEventListener("click",()=>pe(e,L(`#${e}`).hidden));L("#close-explorer").addEventListener("click",()=>{pe("explorer",!1),L("#toggle-explorer").focus()});L("#close-timeline").addEventListener("click",()=>{ge(),pe("timeline",!1),L("#toggle-timeline").focus()});function Ht(e){L("#toast").textContent=e,L("#toast").hidden=!1,window.setTimeout(()=>{L("#toast").hidden=!0},3500)}function ji(){Qr?.(),pe("inspector",!1),Pn.close(),tt.clear(),L("#session-inspector").replaceChildren(),L("#toggle-inspector").hidden=!0}ji();async function sv(){try{const{TimelineScene:e}=await ws(async()=>{const{TimelineScene:t}=await import("./scene-BCuZ73oU.js");return{TimelineScene:t}},__vite__mapDeps([1,2]));Q=new e(L("#scene"),{onSelect:t=>{t?(wo.play("select"),Vn(t)):Gi()},onPlaybackInterrupt:ge,onEvent:t=>{wo.play("select"),Fi(t)},onEventHover:(t,n,s,o)=>{os=void 0,t&&G&&Te?tt.show(t,G,Te.revision,n,s,o):tt.clear()},onHover:(t,n,s)=>{const o=L("#tooltip");o.classList.contains("message-tooltip")&&(tt.clear(),os=void 0),o.hidden!==!t&&(o.hidden=!t),t&&(os!==t.session&&(os=t.session,o.innerHTML=`<strong>${X(t.session.title)}</strong><span>${X(Fe(t.session.source))} · ${t.session.activity?.lastMessageAt?`Last message ${vo(t.session.activity.lastMessageAt)}`:"Message time unavailable"}<br>Started ${vo(t.session.created)}</span>`),o.style.left=`${Math.min(n+18,L("#scene").clientWidth-280)}px`,o.style.top=`${Math.max(8,Math.min(s-32,L("#scene").clientHeight-110))}px`)}},{panels:[L("#explorer"),L("#inspector"),L("#timeline")]}),Q.applyPreferences(Z),Q.setSuspended(!!document.querySelector("dialog[open]")),U&&(Q.setGraph(se,!0),G&&(Q.select(G),Q.focus(G)),Qe&&Q.setFiles(Qe.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{gd=!1,U&&jo()}}L("#scene").addEventListener("scene-error",e=>Ht(e.detail));async function _i(e,t,n="Could not load session details."){const s=AbortSignal.timeout(18e4);return Xe(e,n,{signal:t?AbortSignal.any([t,s]):s})}async function Bi(e=!1){const t=L("#refresh");t.disabled=!0,t.classList.add("spinning");try{const n=Ne?.revision,s=await _i("/api/sessiongraph",void 0,"Could not load the library."),o=U,r=G?cs.get(G):void 0,i=!!(o&&se.nodes.length);if(U=s,!Ne?.pending&&n===Ne?.revision){Z={...Ro(s.preferences||Z),autoImport:s.autoImport===!0};try{nn=kl(localStorage,Z)}catch{nn=!1}if(!bs){const c=Ig(s.viewState);({sourceID:Ln,projectID:kt,directory:et,days:en,fromDate:Dt,toDate:Rt,includeChildren:In,includeArchived:tn}=c),L("#children").checked=In,Xr=JSON.stringify(c),s.preferences||Hi({preferences:{...Z}})}Ss()}if(bs=!0,L("#connection-label").textContent="Local library",L(".connection").classList.add("connected"),L(".connection").title=`Connected · ${le(U.sessions.length)} sessions`,!e&&U.onboarding&&!Ri&&Vi(),!U.onboarding&&!pc&&(pc=!0,requestAnimationFrame(()=>{window.setTimeout(()=>{sv()},0)})),o&&Z.grouping===wn&&JSON.stringify(o.sessions)===JSON.stringify(s.sessions)&&JSON.stringify(o.projects)===JSON.stringify(s.projects)){jo();return}Ni.clear(),cs=new Map(U.sessions.map(c=>[c.id,c])),L("#source").innerHTML='<option value="">All sources</option>'+(U.sources||[]).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${c.sessions.toLocaleString()}</option>`).join(""),L("#source").value=Ln,Wi.setData(U);const a=new Map;if(U.sessions.forEach(c=>a.set(c.projectID,(a.get(c.projectID)||0)+1)),L("#project").innerHTML='<option value="">All projects</option>'+[...U.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(""),L("#project").value=kt,qi(),G&&!o){const c=U.sessions.find(d=>d.id===G),{min:l,max:u}=yl(ei());c&&(c.created<l||c.created>u)&&(en=0,Dt="",Rt=""),c?.archived&&(tn=!0)}if(Ye(!i,i),G&&!o)Vn(G);else if(G){const c=cs.get(G);if(c&&JSON.stringify(r)!==JSON.stringify(c)){const l=L(".detail-scroll")?.scrollTop||0;Qe=void 0,Te=void 0,Ed(c,!1),L(".detail-scroll").scrollTop=l,Co(c.id),Yi(c)}}else ji();!e&&U.warnings.length&&Ht(U.warnings.join(" "))}catch(n){const s=n instanceof Tt?n.message:"Could not load the library.";if(e&&U){L(".connection").title=s;return}L("#connection-label").textContent="Connection unavailable",L(".connection").title="Connection unavailable",L(".connection").classList.remove("connected"),L("#graph-message").hidden=!1;const o=n instanceof Tt&&n.code==="LIBRARY_VERSION";L("#graph-message").innerHTML=`${W("terminal")}<h3>Local library unavailable</h3><p role="alert">${X(s)}</p>${o?"":`<button class="primary-button" id="retry">Retry ${W("arrow-right")}</button>`}`,L("#retry")?.addEventListener("click",()=>{Bi().then(xs)}),U||(L("#session-list").innerHTML='<p class="empty-list">Your sessions will appear here once connected.</p>',L("#list-count").textContent="Offline"),We()}finally{t.disabled=!1,t.classList.remove("spinning")}}function qi(){const e=U?.sessions.filter(s=>!kt||s.projectID===kt)||[],t=[...new Set(e.map(s=>s.directory))].sort((s,o)=>It(s).localeCompare(It(o))),n=new Set(U?.projects.flatMap(s=>s.worktrees));L("#directory").innerHTML='<option value="">All directories</option>'+t.map(s=>`<option value="${X(s)}">${n.has(s)?"⑂ ":""}${X(It(s))}</option>`).join(""),t.includes(et)||(et=""),L("#directory").value=et}let wn;function Ye(e=!1,t=!1){if(!U)return;wn!==Z.grouping&&(e=!0,t=!1),wn=Z.grouping,t||(ge(),ce=1);const n=document.activeElement?.closest("[data-session]")?.dataset.session,{min:s,max:o}=yl(ei());he=U.sessions.filter(a=>Rg(a,Ln)&&(!kt||a.projectID===kt)&&(!et||a.directory===et)&&(In||!a.parentID||!!a.forkID)&&(tn||!a.archived)&&a.created>=s&&a.created<=o),Pi=[...he].sort((a,c)=>Zt(c)-Zt(a)),hd=new Set(he.map(a=>a.id)),Wi.setScope(he.map(a=>a.id)),se=yc(he,U.projects,t?se:void 0,wn),pd=new Map(se.nodes.map(a=>[a.session.id,a.color])),Q?.setCutoff(ce),Q?.setGraph(se,e,t),jo(),document.querySelectorAll("[data-days]").forEach(a=>{const c=!Dt&&!Rt&&a.dataset.days===String(en);a.classList.toggle("active",c),a.setAttribute("aria-pressed",String(c))}),ov(t),t&&n&&Tn.getElement(vs.get(n))?.focus({preventScroll:!0}),rv(),G&&!he.some(a=>a.id===G)?Gi():G&&Qe&&Q?.setFiles(Qe.files),G&&Te&&Q?.setEvents(Te.items),We();const r=ei(),i=JSON.stringify(r);bs&&i!==Xr&&(Xr=i,Hi({viewState:r}))}function jo(){Ui();const e=L("#graph-message");e.hidden=!!(he.length&&Q),he.length?Q||(e.innerHTML=gd?"<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=U?.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>':U&&!U.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>`,L("#clear-filters")?.addEventListener("click",()=>wd()),L("#empty-sources")?.addEventListener("click",()=>{U?.onboarding?Vi():Et.open()}),We()}function Ui(e=!1){const t=!!(he.length&&Q);(e||!t)&&(window.clearTimeout(Zn),Zn=0,zn=!1),L(".playback-share").classList.toggle("ready",zn&&t),L("#share-playback").disabled=!zn||!t,t&&!zn&&!Zn&&(Zn=window.setTimeout(()=>{Zn=0,zn=!0,Ui()},1e3))}function wd(e){Ln="",L("#source").value="",kt="",et="",en=e?0:wi.days,Dt="",Rt="",In=!0,tn=e?.archived===!0,L("#project").value="",L("#children").checked=!0,vd.setRange("",""),qi(),Ye(!0)}function ov(e=!1){L("#list-count").textContent=le(he.length);const t=[];vs=new Map;let n="";for(const s of Pi){const o=Zt(s),r=ys(o,!0);r!==n&&t.push({label:ys(o),year:new Date(o).getFullYear()}),n=r,vs.set(s.id,t.length),t.push({session:s})}Tn.setItems(t,e),L("#session-list").querySelector(".empty-list")?.remove(),t.length||L("#session-list").insertAdjacentHTML("beforeend",'<p class="empty-list">No sessions match your filters.</p>')}function Cd(e){for(const t of[e,G]){const n=t?Tn.getElement(vs.get(t)):void 0;n&&(n.classList.toggle("selected",t===G),n.setAttribute("aria-pressed",String(t===G)))}}function rv(){ct=vl(he),md=wl(he),Jr="";const e=Pg(he.map(Zt),se.start,se.end),t=Math.max(...e,1);L("#histogram").innerHTML=e.map(n=>`<span style="height:${Math.max(4,n/t*100)}%;opacity:${n?.8:.15}" title="${n} session endpoints"></span>`).join(""),L("#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&&vd.setRange(Dt||fc(se.start),Rt||fc(se.end)),Rn()}function Rn(e=!1){L("#scrubber").value=String(Math.round(ce*1e3)),L("#timeline-cursor").style.left=`${ce*100}%`,L("#histogram").style.setProperty("--progress",`${ce*100}%`);const t=se.start+(se.end-se.start)*ce;L("#playback-date").textContent=se.start?ys(t,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear()):"—";const n=se.nodes.length?Og(t,se.end-se.start):"—";L("#playback-period").textContent!==n&&(L("#playback-period").textContent=n);const s=ct.at(t,ce>=1),o=md(t,ce>=1),r=`${s.tokens}:${s.sessions}:${o}`;r!==Jr&&(Jr=r,L("#playback-summary").hidden=he.length===0,L("#playback-sessions").textContent=le(o),L("#playback-tokens").textContent=ct.recorded?fd(s.tokens):"—",L("#playback-summary").title=`${le(o)} sessions started. ${ct.recorded?`${le(s.tokens)} burnt tokens`:"Token usage unavailable"}. Token totals are added at the latest saved message, including cache where reported. ${le(ct.missing)} sessions have no recorded total.${ct.partial?` ${le(ct.partial)} recorded totals are partial.`:""}${ct.untimed?` ${le(ct.untimed)} totals have no message timestamp and are included only at the end.`:""}`),Q?.setCutoff(ce,e)}function ge(){if(Vt=!1,ls=0,L("#app").classList.remove("playback-mode"),no){const e=no;no=void 0,pe("explorer",e.explorer),pe("inspector",e.inspector&&!!G)}Q?.setPlaying(!1),cancelAnimationFrame(Di),L("#play").innerHTML=W("play"),L("#play").setAttribute("aria-label","Play timeline"),We()}function kd(e){if(!Vt)return;const t=Math.max(0,e-bo);bo=e,document.hidden||(ce<1?ce=Math.min(1,ce+t*Z.playbackSpeed/Ci):ls+=t),Rn(),Q?.setPlaybackOutro(ce>=1?Math.min(1,ls/ps):null),ce>=1&&ls>=ps+bl?ge():Di=requestAnimationFrame(kd)}function Gi(){const e=G;Zr?.abort(),zr?.abort(),L("#file-legend").hidden=!0,to++,eo++,G=null,Qe=void 0,Te=void 0,Q?.select(null),history.replaceState(null,"",location.pathname),ji(),Cd(e)}const ds=3;function iv(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"}]:[],o=U.sessions.filter(c=>c.forkID===t.id||!c.forkID&&c.parentID===t.id),r=[...s,...o.map(c=>({id:c.id,label:c.forkID?"Fork":"Child",kind:c.forkID?"git-fork":"network"}))];if(!r.length){e.hidden=!0;return}const i=c=>(c?r:r.slice(0,ds)).map(l=>{const u=cs.get(l.id);return`<button class="relation" data-related="${X(l.id)}" ${u?"":"disabled"}>${W(l.kind)}<span><small>${l.label}</small><strong>${X(u?.title||"Session no longer available")}</strong></span>${W("arrow-up-right")}</button>`}).join(""),a=c=>c?"Show fewer connections":`Show all ${le(r.length)} connections`;e.innerHTML=`<div class="section-label">Connections<span>${le(r.length)}</span></div><div id="connection-list">${i(n)}</div>
172
+ ${r.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,u=l.getAttribute("aria-expanded")!=="true";e.querySelector("#connection-list").innerHTML=i(u),l.setAttribute("aria-expanded",String(u)),l.textContent=a(u),u||l.scrollIntoView({block:"nearest"}),We()})}function Ed(e,t=!0){const n=U.projects.find(c=>c.id===e.projectID),s=e.forkID?"Fork":e.parentID?"Child session":"Session",o=n?.worktrees.includes(e.directory),r=t?!0:L("#session-inspector").querySelector(".session-info")?.open??!0,i=!t&&L("#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":fd(e.tokens)],["dollar-sign",e.usage?.costEstimated?"Cost (harness estimate)":"Recorded cost",e.cost===null?"Not recorded":`$${e.cost.toFixed(2)}`]];L("#session-inspector").innerHTML=`
173
+ <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>
174
+ <div class="detail-scroll">
175
+ <div class="detail-title"><span class="source-badge" data-source="${X(e.source||"opencode")}">${kn(e.source)}${X(Fe(e.source))}</span><h2>${X(e.title)}</h2><div class="detail-title-meta"><span class="detail-date">${vo(e.created)}</span><button id="focus-session" class="icon-button" title="Focus node" aria-label="Focus node">${W("crosshair")}</button></div></div>
176
+ <section id="message-detail" class="detail-section"></section>
177
+ ${ku(a,`<div class="directory-card"><span>${W(o?"git-branch":"folder")}${o?"Worktree":"Directory"}</span><code>${X(e.directory)}</code></div>`,r)}
178
+ <section id="commit-detail" class="detail-section"></section>
179
+ <section id="pull-request-detail" class="detail-section" hidden></section>
180
+ ${e.linkedSessionIDs?.length?`<section class="detail-section"><div class="section-label">Linked provider history</div>${e.linkedSessionIDs.map(c=>`<button class="relation" data-history="${X(c)}">${kn(c.split(":")[0])}<span>${X(Fe(c.split(":")[0]))}</span>${W("arrow-up-right")}</button>`).join("")}</section>`:""}
181
+ <div id="file-detail"><section class="detail-section"><div class="section-label">Changed files</div><div class="detail-loading">${W("loader-circle","spinning")}Loading changes…</div></section></div>
182
+ <section id="session-connections" class="detail-section"></section>
183
+ <div id="session-tools"></div>
184
+ </div>
185
+ `,L("#toggle-inspector").hidden=!1,t&&pe("inspector",!0),L("#close-inspector").addEventListener("click",()=>{pe("inspector",!1),L("#toggle-inspector").focus()}),L("#focus-session").addEventListener("click",()=>{ge(),Q?.focus(e.id)}),iv(L("#session-connections"),e,i),Sd(),Qr?.(),Qr=Bg(L("#commit-detail"),e.id,(c,l)=>{tt.clear(),ge(),Pn.open(e,c,l,"tools")}),We()}function Sd(e){const t=e?.items.filter(s=>s.kind==="commit").length??0,n=e?[`${le(e.total)} ${e.total===1?"message":"messages"}`,t?`${le(t)} ${t===1?"commit marker":"commit markers"}`:"",e.limited?"Map limit reached":""].filter(Boolean):["Loading messages…"];L("#message-detail").innerHTML=`<div class="section-label">Session timeline</div><div class="event-key"><span style="--event-color:#ffffff"><i></i>User & assistant messages</span></div><p class="coverage-note">${n.map(X).join(" · ")}</p><button class="secondary-button explore-events">Explore messages ${W("arrow-right")}</button>`,L(".explore-events").addEventListener("click",()=>Fi()),We()}async function Yi(e,t=!1){const n=++eo;zr?.abort();const s=new AbortController;zr=s;try{const o=await _i(`/api/sessiongraph/session/${encodeURIComponent(e.id)}/event-markers`,s.signal,"Could not load message markers.");if(s.signal.aborted||n!==eo||G!==e.id)return;Te=o,Q?.setEvents(o.items,t),Sd(o)}catch(o){if(s.signal.aborted||n!==eo||G!==e.id)return;const r=o instanceof Tt?o.message:"Could not load message markers.";L("#message-detail").innerHTML=`<div class="section-label">Session timeline</div><p class="coverage-note" role="alert">${X(r)}</p><button class="secondary-button explore-events">Explore messages</button><button class="load-more" id="retry-timeline">Retry message markers</button>`,L(".explore-events").addEventListener("click",()=>Fi()),L("#retry-timeline").addEventListener("click",()=>{Yi(e)})}}function av(e,t){const n=new Map(e.files.map(o=>[o.path,{...o}]));for(const o of t.files){const r=n.get(o.path);n.set(o.path,{...o,steps:(r?.steps||0)+o.steps,source:r?.source==="snapshot"?"snapshot":o.source})}const s=new Map(e.tools.map(o=>[o.name,o.count]));return t.tools.forEach(o=>s.set(o.name,(s.get(o.name)||0)+o.count)),{...t,pullRequests:t.pullRequests??e.pullRequests,files:[...n.values()].sort((o,r)=>r.steps-o.steps||o.path.localeCompare(r.path)),tools:[...s].map(([o,r])=>({name:o,count:r})).sort((o,r)=>r.count-o.count),locations:[...e.locations,...t.locations],messagesScanned:e.messagesScanned+t.messagesScanned,snapshotSteps:e.snapshotSteps+t.snapshotSteps}}function gc(e){const t=L("#pull-request-detail"),n=e.pullRequests||[];t.hidden=!n.length,t.innerHTML=n.length?`<div class="section-label">Pull requests<span>${le(n.length)}</span></div>${n.map(l=>`<a class="relation" href="${X(l.url)}" target="_blank" rel="noopener noreferrer">${W("git-branch")}<span><small>${X(l.host)}</small><strong>${X(l.repository)} #${l.number}</strong></span>${W("arrow-up-right")}</a>`).join("")}`:"",vn()&&t.querySelectorAll("a").forEach(l=>l.addEventListener("click",u=>{u.preventDefault(),$l(l.href).catch(()=>Ht("Could not open the pull request in your browser."))}));const s=e.files,o=L("#file-detail"),r=L("#session-tools"),i=r.querySelector("details")?.open??!1,a=o.querySelector("#toggle-files")?.getAttribute("aria-expanded")==="true",c=l=>l.map(u=>`<li title="${X(u.path)} · ${u.source}">${W("file-code-2")}<div><strong>${X(It(u.path))}</strong>${u.path.includes("/")?`<span>${X(u.path.slice(0,u.path.lastIndexOf("/")))}</span>`:""}</div><small>${u.steps}×</small></li>`).join("");L("#file-legend").hidden=!s.length,o.innerHTML=`
186
+ <section class="detail-section"><div class="section-label">Changed files<span>${le(s.length)}${e.partial?"+":""}</span></div>
187
+ ${s.length?`<ul class="file-list" id="changed-file-list">${c(a?s:s.slice(0,ds))}</ul>`:'<div class="no-files"><p>No file changes found.</p></div>'}
188
+ ${s.length>ds?`<button class="load-more" id="toggle-files" type="button" aria-controls="changed-file-list" aria-expanded="${a}">${a?"Show fewer files":`Show all ${le(s.length)} files`}</button>`:""}
189
+ ${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>`:""}
190
+ ${e.nextCursor?'<p class="coverage-note" id="history-loading" role="status">Loading full history…</p>':""}</section>
191
+ ${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>${vo(l.time)}</span><code>${X(l.directory)}</code></div>`).join("")}</details>`:""}
192
+ `,r.innerHTML=e.tools.length?`<details class="more-details detail-section"${i?" open":""}><summary>Tools used <span>${le(e.tools.reduce((l,u)=>l+u.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>`:"",o.querySelector("#toggle-files")?.addEventListener("click",l=>{const u=l.currentTarget,d=u.getAttribute("aria-expanded")!=="true";L("#changed-file-list").innerHTML=c(d?s:s.slice(0,ds)),u.setAttribute("aria-expanded",String(d)),u.textContent=d?"Show fewer files":`Show all ${le(s.length)} files`,d||u.scrollIntoView({block:"nearest"}),We()}),Q?.setFiles(s),We()}async function Co(e){const t=++to;Zr?.abort();const n=new AbortController;Zr=n;let s,o;const r=new Set;try{do{const i=await _i(`/api/sessiongraph/session/${encodeURIComponent(e)}${s?`?cursor=${encodeURIComponent(s)}`:""}`,n.signal);if(n.signal.aborted||t!==to||G!==e)return;if(o&&i.revision!==o.revision)throw new Error("History changed. Retry to load the latest version.");if(o=o?av(o,i):i,Qe=o,!s||!i.nextCursor?gc(o):L("#history-loading")&&(L("#history-loading").textContent=`Loading full history… ${le(o.messagesScanned)} messages`),s=i.nextCursor||void 0,s&&r.has(s))throw new Error("History could not be loaded. Please retry.");s&&r.add(s)}while(s)}catch(i){if(n.signal.aborted||t!==to||G!==e)return;if(Qe){gc(Qe);const a=L("#history-loading");a&&(a.innerHTML='History loading interrupted. <button class="text-button" id="retry-detail">Retry</button>'),L("#retry-detail")?.addEventListener("click",()=>{Co(e)})}else L("#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>`,L("#retry-detail").addEventListener("click",()=>Co(e))}}function Vn(e){const t=cs.get(e);if(!t)return;const n=G;Pn.close(),tt.clear(),hd.has(e)||wd(t),ge(),ce=1,Rn(),G=e,Qe=void 0,Te=void 0,L("#file-legend").hidden=!0,history.replaceState(null,"",`?session=${encodeURIComponent(e)}`),Q?.select(e),Ed(t),Q?.focus(e),Cd(n),Co(e),Yi(t,!0)}L("#session-list").addEventListener("click",e=>{const t=e.target.closest("[data-session]");t?.dataset.session&&Vn(t.dataset.session)});L("#inspector").addEventListener("click",e=>{const t=e.target.closest("[data-history]")?.dataset.history;if(t){tt.clear(),ge(),pe("inspector",!0),Pn.open({id:t,source:t.split(":")[0]});return}const n=e.target.closest("[data-related]");n?.dataset.related&&Vn(n.dataset.related)});L("#project").addEventListener("change",e=>{kt=e.target.value,et="",qi(),Ye(!0)});L("#source").addEventListener("change",e=>{Ln=e.target.value,Ye(!0)});L("#directory").addEventListener("change",e=>{et=e.target.value,Ye(!0)});L("#children").addEventListener("change",e=>{In=e.target.checked,Ye()});document.querySelectorAll("[data-days]").forEach(e=>e.addEventListener("click",()=>{en=e.dataset.days==="ytd"?"ytd":Number(e.dataset.days),Dt="",Rt="",Ye(!0)}));L("#reset-camera").addEventListener("click",()=>{ge(),Q?.reset()});L("#refresh").addEventListener("click",()=>{U?.onboarding?Vi():Et.refresh()});L("#scrubber").addEventListener("input",e=>{ge(),ce=Number(e.target.value)/1e3,Rn(!0)});L("#play").addEventListener("click",()=>{if(he.length){if(Vt)return ge();ce>=1&&(ce=0),Rn(),no={explorer:!L("#explorer").hidden,inspector:!L("#inspector").hidden},pe("explorer",!1),pe("inspector",!1),pe("timeline",!0),tt.clear(),os=void 0,L("#app").classList.add("playback-mode"),Ui(!0),Vt=!0,ls=0,Q?.setPlaying(!0),bo=performance.now(),L("#play").innerHTML=W("pause"),L("#play").setAttribute("aria-label","Pause timeline"),We(),Di=requestAnimationFrame(kd)}});document.addEventListener("visibilitychange",()=>{bo=performance.now()},{signal:Wo.signal});async function cv(){const e=L("#share-playback");e.disabled=!0;try{if(!br){const{createPlaybackShare:t}=await ws(async()=>{const{createPlaybackShare:n}=await import("./share-mJrTMarx.js");return{createPlaybackShare:n}},__vite__mapDeps([4,1,2]));br=t(xt,()=>{_o()})}se.nodes.length&&br.open(se,Z)}catch{Ht("Could not open video sharing. Please try again.")}finally{e.disabled=!he.length||!Q}}async function _o(){try{hc??=Yy(xt,()=>{cv()},zy),await hc.open(he.map(e=>e.id))}catch{Ht("Could not open publishing. Please try again.")}}L("#share-playback").addEventListener("click",_o);L("#open-publishing").addEventListener("click",_o);L("#help").addEventListener("click",()=>{L("#help-dialog").showModal(),xt()});L("#help-dialog").addEventListener("close",xt);L("#help-dialog [data-close-help]").addEventListener("click",()=>L("#help-dialog").close());document.addEventListener("keydown",e=>{if(!e.defaultPrevented&&!document.querySelector("dialog[open]")){if(Vt&&e.key==="Escape"){e.preventDefault(),ge();return}if(!Pn.handleKey(e)){if(e.key==="Escape"){G?Gi():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=Pi,s=n.findIndex(i=>i.id===G),o=e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:1,r=n[Math.max(0,Math.min(n.length-1,s+o))];if(r&&(e.preventDefault(),Vn(r.id),t.closest(".session-card"))){const i=vs.get(r.id);Tn.scrollToIndex(i),Tn.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=>!L(`#${n}`).hidden);t.length?(wr=t,t.forEach(n=>pe(n,!1))):(wr.length?wr:["explorer","timeline"]).forEach(n=>{(n!=="inspector"||G)&&pe(n,!0)})}}}}});Bi().then(()=>{U?.importing?Et.resume():xs()});export{Su as A,mg as B,fv as C,Do as D,yl as E,dc as F,bv as G,ps as H,Fg as I,bl as J,kr as K,Fn as L,vv as M,lv as N,Vg as O,Ci as P,Lu as Q,hv as R,pv as S,dv as T,yv as U,Vu as V,uv as W,ws as _,Cr as a,vl as b,wl as c,Zt as d,gv as e,ki as f,mv as g,Og as h,vn as i,bi as j,wv as k,at as l,ft as m,W as n,$l as o,Vy as p,Dg as q,Eu as r,Gy as s,Pg as t,xu as u,qy as v,Pu as w,Fe as x,ku as y,Tg as z};