@rubytech/create-maxy-code 0.1.438 → 0.1.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +18 -4
  3. package/payload/platform/plugins/docs/references/admin-identity-gate.md +32 -17
  4. package/payload/platform/plugins/docs/references/admin-ui.md +1 -1
  5. package/payload/platform/plugins/docs/references/internals.md +4 -0
  6. package/payload/platform/plugins/docs/references/outlook-guide.md +2 -2
  7. package/payload/platform/plugins/docs/references/plugins-guide.md +2 -0
  8. package/payload/platform/plugins/docs/references/troubleshooting.md +8 -0
  9. package/payload/platform/plugins/graph/.claude-plugin/plugin.json +19 -0
  10. package/payload/platform/plugins/graph/PLUGIN.md +10 -4
  11. package/payload/platform/plugins/graph-viewer/.claude-plugin/plugin.json +13 -0
  12. package/payload/platform/plugins/graph-viewer/PLUGIN.md +1 -1
  13. package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +193 -0
  14. package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/package.json +3 -0
  15. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.d.ts +2 -0
  16. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.d.ts.map +1 -0
  17. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.js +55 -0
  18. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.js.map +1 -0
  19. package/payload/platform/plugins/outlook/mcp/dist/index.js +1 -1
  20. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  21. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts +17 -0
  22. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts.map +1 -1
  23. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js +84 -21
  24. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js.map +1 -1
  25. package/payload/platform/plugins/outlook/references/graph-surfaces.md +15 -1
  26. package/payload/platform/scripts/__tests__/account-schema-owned-dirs.test.sh +100 -0
  27. package/payload/platform/scripts/lib/account-schema-owned-dirs.py +207 -0
  28. package/payload/platform/scripts/lib/account-schema-owned-dirs.sh +33 -0
  29. package/payload/platform/scripts/lib/provision-account-dir.sh +7 -0
  30. package/payload/platform/scripts/setup-account.sh +10 -0
  31. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  32. package/payload/platform/services/claude-session-manager/dist/http-server.js +6 -4
  33. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  34. package/payload/platform/services/claude-session-manager/dist/index.js +36 -0
  35. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  36. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.d.ts +58 -0
  37. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.d.ts.map +1 -0
  38. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.js +196 -0
  39. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.js.map +1 -0
  40. package/payload/server/{chunk-UGPQCVIW.js → chunk-WC4WJR6X.js} +0 -6
  41. package/payload/server/maxy-edge.js +1 -1
  42. package/payload/server/public/assets/{AdminLoginScreens-DeR71H29.js → AdminLoginScreens-CukwQufW.js} +1 -1
  43. package/payload/server/public/assets/AdminShell-BwEBH6tT.js +2 -0
  44. package/payload/server/public/assets/{admin-C15h-NL0.js → admin-CdFRCUUZ.js} +1 -1
  45. package/payload/server/public/assets/{browser-B7xQLIRK.js → browser-BWR59IkB.js} +1 -1
  46. package/payload/server/public/assets/{calendar-A-vGm6pL.js → calendar-kuTcxX1t.js} +1 -1
  47. package/payload/server/public/assets/chat-ejnq2rck.js +1 -0
  48. package/payload/server/public/assets/data-dZbOyLdT.js +1 -0
  49. package/payload/server/public/assets/{graph-D0orIRAh.js → graph-NgQDY0Pb.js} +1 -1
  50. package/payload/server/public/assets/{operator-DZzuotDB.js → operator-oSaB1mya.js} +1 -1
  51. package/payload/server/public/assets/{page-Ck_pLhAk.js → page-DEkI-Gl1.js} +1 -1
  52. package/payload/server/public/assets/{page-3g0A19Rv.js → page-DMeJHVfA.js} +5 -5
  53. package/payload/server/public/assets/{public-WFUQw9AD.js → public-C54tl6V4.js} +1 -1
  54. package/payload/server/public/assets/{useCopyFeedback-CSk9KjhY.js → useCopyFeedback-DHoYHiK9.js} +1 -1
  55. package/payload/server/public/assets/{useVoiceRecorder-DCyJQkFK.js → useVoiceRecorder-b7HzTFs0.js} +1 -1
  56. package/payload/server/public/browser.html +2 -2
  57. package/payload/server/public/calendar.html +2 -2
  58. package/payload/server/public/chat.html +5 -5
  59. package/payload/server/public/data.html +3 -3
  60. package/payload/server/public/graph.html +3 -3
  61. package/payload/server/public/index.html +5 -5
  62. package/payload/server/public/operator.html +6 -6
  63. package/payload/server/public/public.html +5 -5
  64. package/payload/server/server.js +186 -112
  65. package/payload/server/public/assets/AdminShell-DlAVQUda.js +0 -2
  66. package/payload/server/public/assets/chat-DAae6Z51.js +0 -1
  67. package/payload/server/public/assets/data-BNWpKx1d.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,T as n,_ as r,a as i,b as a,d as o,g as s,i as c,l,m as u,n as d,o as f,p,s as m,t as h,u as g,x as _}from"./useSubAccountSwitcher-DLJFISqf.js";import{a as ee,d as v,f as te,l as ne,m as re,n as ie,o as y,p as ae,s as oe,u as se}from"./file-download-4mKJxUi-.js";async function b(){try{let e=await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`logout`})});return e.ok?(await e.json().catch(()=>({})))?.logged_out===!0:(console.error(`[admin-ui] claude-logout http-status=${e.status}`),!1)}catch(e){return console.error(`[admin-ui] claude-logout fetch failed: ${e instanceof Error?e.message:String(e)}`),!1}}var x=e(t(),1),S=_(),C={sm:14,md:16,lg:18},w={sm:30,md:38,lg:46};function T({variant:e=`primary`,size:t=`md`,icon:n,iconPosition:r=`leading`,loading:i=!1,fullWidth:a=!1,disabled:o=!1,type:s=`button`,onClick:c,"aria-label":l,style:u,className:d,children:f}){let p=[`btn`,`btn--${e}`,t===`md`?``:`btn--${t}`,a?`btn--full`:``,d].filter(Boolean).join(` `),m=C[t],h={...e===`send`?{width:w[t],height:w[t]}:{},...u},g=Object.keys(h).length>0;return(0,S.jsxs)(`button`,{type:s,className:p,disabled:i||o,onClick:c,"aria-label":l,style:g?h:void 0,children:[(0,S.jsxs)(`span`,{className:`btn__content`,style:{visibility:i?`hidden`:`visible`},children:[n&&r===`leading`&&(0,S.jsx)(n,{size:m}),f,n&&r===`trailing`&&(0,S.jsx)(n,{size:m})]}),i&&(0,S.jsx)(`span`,{className:`btn__spinner`,children:`✱`})]})}var ce=s(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),E=s(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),D=s(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),le=s(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),ue=s(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),de=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),fe=s(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),pe=s(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),O=s(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),me=s(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),k=`maxy-shell-side-px`;function A(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function j(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-A());return Math.min(Math.max(e,248),n)}function he(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(k);if(!e)return 264;let t=parseInt(e,10);if(!Number.isFinite(t))return console.warn(`[admin-ui] sidebar-width-parse-failed stored=${JSON.stringify(e)} fallback=264`),264;if(t>=248)return j(t)}catch{}return 264}function ge({targetSelector:e=`.platform`}){let t=(0,x.useRef)(null),[n,r]=(0,x.useState)(()=>he()),i=(0,x.useRef)(n);(0,x.useLayoutEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,x.useCallback)(()=>{r(e=>{let t=j(e);return t===e?e:t})},[]);(0,x.useEffect)(()=>{a(),window.addEventListener(`resize`,a);let t=document.querySelector(e),n=null;return t instanceof HTMLElement&&(n=new MutationObserver(a),n.observe(t,{attributes:!0,attributeFilter:[`data-artefact`,`class`]})),()=>{window.removeEventListener(`resize`,a),n?.disconnect()}},[a,e]);let o=e=>{e.preventDefault();let n=t.current;if(!n)return;n.setPointerCapture(e.pointerId),n.classList.add(`dragging`);let a=!1,o=e=>{a=!0,r(j(Math.round(e.clientX)))},s=()=>{if(n.releasePointerCapture(e.pointerId),n.classList.remove(`dragging`),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),!a)return;let t=i.current;try{window.localStorage.setItem(k,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=j(264);r(e);try{window.localStorage.removeItem(k)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,S.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var M=n();function _e({anchorRef:e,onClose:t,className:n,role:r,ariaLabel:i,children:a}){let o=(0,x.useRef)(null),[s,c]=(0,x.useState)({position:`fixed`,visibility:`hidden`}),l=(0,x.useCallback)(()=>{let t=e.current,n=o.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.right-i.width;a<4&&(a=4);let s=window.innerHeight-r.bottom<i.height+8&&r.top>i.height+8?r.top-i.height:r.bottom;c({position:`fixed`,left:a,top:s,visibility:`visible`})},[e]);return(0,x.useLayoutEffect)(()=>{if(l(),typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>l());return o.current&&e.observe(o.current),()=>e.disconnect()},[l]),(0,x.useEffect)(()=>{let n=e=>{e.key===`Escape`&&t()},r=n=>{let r=n.target;e.current?.contains(r)||o.current?.contains(r)||t()},i=n=>{let r=e.current;r&&n.target instanceof Node&&n.target.contains(r)&&t()},a=()=>t();return document.addEventListener(`keydown`,n),document.addEventListener(`pointerdown`,r),window.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`keydown`,n),document.removeEventListener(`pointerdown`,r),window.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,a)}},[e,t]),(0,M.createPortal)((0,S.jsx)(`div`,{ref:o,className:n,role:r,"aria-label":i,style:s,children:a}),document.body)}function ve({actions:e,disabled:t}){let[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(null),o=(0,x.useRef)(null),s=(0,x.useCallback)(()=>{r(!1),a(null)},[]);return(0,S.jsxs)(`div`,{className:`conv-actions`,children:[(0,S.jsx)(`button`,{ref:o,type:`button`,className:`conv-action conv-actions-overflow`,onClick:()=>r(e=>!e),disabled:t,"aria-haspopup":`menu`,"aria-expanded":n,"aria-label":`Session actions`,title:`Session actions`,children:(0,S.jsx)(g,{size:12})}),n&&(0,S.jsx)(_e,{anchorRef:o,onClose:s,className:`conv-actions-menu`,role:`menu`,children:e.map(e=>e.panel?(0,S.jsxs)(`div`,{className:`conv-actions-menu-disclosure`,children:[(0,S.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-haspopup":`dialog`,"aria-expanded":i===e.key,disabled:t,onClick:()=>a(t=>t===e.key?null:e.key),children:[e.icon,(0,S.jsx)(`span`,{children:e.menuLabel})]}),i===e.key&&(0,S.jsx)(`div`,{className:`conv-actions-menu-panel`,children:e.panel()})]},e.key):(0,S.jsxs)(`button`,{type:`button`,role:`menuitem`,className:e.danger?`conv-action-danger`:void 0,"aria-busy":e.busy,disabled:t,onClick:t=>{e.onClick?.(t),s()},children:[e.icon,(0,S.jsx)(`span`,{children:e.menuLabel})]},e.key))})]})}var N=`claude-opus-4-8[1m]`,P=`claude-sonnet-5`,F=`claude-haiku-4-5`,I={[N]:`Opus 4.8 (1M context)`,[P]:`Sonnet 5`,[F]:`Haiku 4.5`};function L(e){return I[e]??e}var R=[N,P,F];function z(e){return e.replace(/\[1m\]$/,``)}function ye(e){return R.find(t=>z(t)===z(e))??e}var be=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`],B=[`low`,`medium`,`high`,`xhigh`];[...be],[...B],[...B];var xe=[N,P,F],Se={default:`Ask permissions`,acceptEdits:`Accept edits`,plan:`Plan mode`,auto:`Auto mode`,bypassPermissions:`Bypass permissions`},Ce=be.map(e=>({value:e,label:Se[e]??e})),we={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Highest`},Te=B.map(e=>({value:e,label:we[e]??e}));function V(e){if(e){let t=xe.find(t=>z(t)===z(e));if(t)return t}return N}function Ee({row:e,adminFetch:t,onError:n}){let[r,i]=(0,x.useState)(()=>V(e.model)),[a,s]=(0,x.useState)(``),[c,l]=(0,x.useState)(``),[u,d]=(0,x.useState)(!1),f=(0,x.useRef)(!1);(0,x.useEffect)(()=>{i(V(e.model))},[e.model]);let p=async()=>{if(!f.current){f.current=!0,d(!0);try{let i=await t(`/api/admin/session-reseat`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fromSessionId:e.sessionId,model:r,...a?{permissionMode:a}:{},...c?{effort:c}:{}})});if(!i.ok){n(`Could not reset ${e.title} (status ${i.status})`),console.error(`[admin-ui] dashboard-reseat-failed sessionId=${e.sessionId} status=${i.status}`),f.current=!1,d(!1);return}let o=await i.json().catch(()=>({}));o.target?window.location.assign(o.target):(n(`Reset of ${e.title} returned no target`),f.current=!1,d(!1))}catch(t){n(`Could not reset ${e.title} (network error)`),console.error(`[admin-ui] dashboard-reseat-failed sessionId=${e.sessionId} error=${t instanceof Error?t.message:String(t)}`),f.current=!1,d(!1)}}};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`label`,{className:`reseat-field`,children:[(0,S.jsx)(`span`,{children:`Model`}),(0,S.jsx)(`select`,{"data-kind":`model`,value:r,disabled:u,onChange:e=>i(e.target.value),children:xe.map(e=>(0,S.jsx)(`option`,{value:e,children:L(e)},e))})]}),(0,S.jsxs)(`label`,{className:`reseat-field`,children:[(0,S.jsx)(`span`,{children:`Mode`}),(0,S.jsxs)(`select`,{"data-kind":`mode`,value:a,disabled:u,onChange:e=>s(e.target.value),children:[(0,S.jsx)(`option`,{value:``,children:`Keep current`}),Ce.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),(0,S.jsxs)(`label`,{className:`reseat-field`,children:[(0,S.jsx)(`span`,{children:`Effort`}),(0,S.jsxs)(`select`,{"data-kind":`effort`,value:c,disabled:u,onChange:e=>l(e.target.value),children:[(0,S.jsx)(`option`,{value:``,children:`Keep current`}),Te.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),(0,S.jsx)(`button`,{type:`button`,className:`reseat-apply`,disabled:u,"aria-busy":u,onClick:()=>void p(),children:u?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(o,{size:12,className:`spin`,"aria-hidden":`true`}),`Resetting…`]}):`Reset`})]})}function H(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n>0?`${t}m ${n}s`:`${t}m`}function De(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}async function U(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function Oe({target:e,onConfirm:t,onCancel:n}){return e?(0,S.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,S.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Confirm delete session`,children:[(0,S.jsxs)(`div`,{className:`claude-info-header`,children:[(0,S.jsx)(`span`,{children:`Delete this conversation?`}),(0,S.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[`This permanently removes the transcript. It is not moved to Archive and cannot be recovered.`,e.live&&(0,S.jsx)(`div`,{style:{marginTop:`8px`},children:`This session is running; deleting stops it first.`})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,style:{display:`flex`,gap:`8px`,padding:`10px 14px`},children:[(0,S.jsx)(T,{variant:`danger`,size:`sm`,style:{flex:1},onClick:t,children:`Delete`}),(0,S.jsx)(T,{variant:`secondary`,size:`sm`,style:{flex:1},onClick:n,children:`Cancel`})]})]})}):null}var ke=`auth-refresh-failed`;function Ae({error:e,onClose:t}){if(!e)return null;let n=e.reason===ke,r=n?`Claude sign-in expired`:`Session didn’t open`,i=n?`Your claude.ai login has expired. Re-authenticate to resume sessions.`:`The session did not bind within 60 seconds, so there is no live conversation to open.`;return(0,S.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,S.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Session could not be opened`,children:[(0,S.jsxs)(`div`,{className:`claude-info-header`,children:[(0,S.jsx)(`span`,{children:r}),(0,S.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:`✕`})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[i,(0,S.jsxs)(`div`,{className:`claude-info-row`,style:{marginTop:`8px`},children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Reason`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:e.reason})]}),e.sessionId&&(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,S.jsxs)(`span`,{className:`claude-info-value`,children:[e.sessionId.slice(0,8),`…`]})]})]})]})})}function je(e){let{show:t,onClose:n,claudeInfo:r,messages:i,sessionElapsed:a,sessionId:o,cacheKey:s}=e,[c,l]=(0,x.useState)(null);if(!t)return null;let u=i.flatMap(e=>e.events?.filter(e=>e.type===`usage`)??[]),d=u.at(-1),f=d?.peak_request_pct==null?d?.context_window?Math.round((d.input_tokens+d.cache_creation_tokens+d.cache_read_tokens)/d.context_window*100):0:Math.round(d.peak_request_pct*100),p=u.reduce((e,t)=>e+t.input_tokens+t.cache_creation_tokens+t.cache_read_tokens+t.output_tokens,0),m=i.flatMap(e=>e.events?.filter(e=>e.type===`rate_limit`)??[]).at(-1),h=u.reduce((e,t)=>e+(t.total_cost_usd??0),0),g=r?.account?.subscriptionType,_=e=>{let t=e*1e3-Date.now();if(t<=0)return`now`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h ${r}m`:`${r}m`};return(0,S.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,S.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`claude-info-header`,children:[(0,S.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`claude-info-icon`}),(0,S.jsx)(`span`,{children:`Claude Code`}),(0,S.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,children:[(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Version`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:r?r.version:`…`})]}),(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Email`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:r?.account?.email??`…`})]})]}),(g||m||h>0)&&(0,S.jsxs)(`div`,{className:`claude-info-section`,children:[g&&(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Plan`}),(0,S.jsx)(`span`,{className:`claude-info-value`,style:{textTransform:`capitalize`},children:g})]}),m&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Usage`}),(0,S.jsxs)(`span`,{className:`claude-info-value`,children:[Math.round(m.utilization*100),`%`]})]}),(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Resets in`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:_(m.resetsAt)})]}),m.isUsingOverage&&(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Overage`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:`Active`})]})]}),h>0&&(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Session cost`}),(0,S.jsxs)(`span`,{className:`claude-info-value`,children:[`$`,h<.01?h.toFixed(4):h.toFixed(2)]})]})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,children:[(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Model`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:r?.model??`…`})]}),(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Context used`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:f>0?`${f}%`:`—`})]}),(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Tokens`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:p>0?De(p):`—`})]}),(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,S.jsx)(`span`,{className:`claude-info-value`,children:H(a)})]}),(o||s)&&(()=>{let e=o??s??``;return(0,S.jsxs)(`div`,{className:`claude-info-row`,children:[(0,S.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,S.jsx)(`button`,{type:`button`,className:`claude-info-value claude-info-id-copy`,title:`${e} (${o?`flushed`:`pre-flush`}) — click to copy`,onClick:async()=>{l(await U(e)?`copied`:`failed`),setTimeout(()=>l(null),1200)},children:c===`copied`?`copied ✓`:c===`failed`?`copy failed ✕`:`${e.slice(0,8)}…`})]})})()]})]})})}function Me({open:e,onConnect:t,onClose:n}){return e?(0,S.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,S.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Claude is not connected`,children:[(0,S.jsxs)(`div`,{className:`claude-info-header`,children:[(0,S.jsx)(`span`,{children:`Claude isn’t connected`}),(0,S.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,S.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`,display:`flex`,flexDirection:`column`,gap:`10px`},children:[(0,S.jsx)(`span`,{children:`This needs Claude, which is currently disconnected. Connect to continue — the rest of the dashboard stays available either way.`}),(0,S.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,S.jsx)(T,{variant:`primary`,size:`sm`,onClick:t,children:`Connect Claude`}),(0,S.jsx)(`button`,{type:`button`,className:`claude-info-close`,style:{fontSize:`11px`},onClick:n,children:`Not now`})]})]})]})}):null}function W(e){let t=Math.round(e/6e4),n=Math.floor(t/60),r=t%60;return`${n}h ${String(r).padStart(2,`0`)}m`}function Ne(e){return e.activeMs.thinking+e.activeMs.messaging+e.activeMs.toolUse}function G(e){return e.toLocaleString(`en-GB`)}function K(e){return`£${e.toFixed(2)}`}function Pe(e){let t=[`Day`,`Active`,`Output tokens`,`Input tokens`,`Cache write`,`Cache read`,`Opus 4.8 (GBP)`,`Sonnet 4.6 (GBP)`],n=(e,t)=>[e,W(Ne(t)),String(t.tokens.output),String(t.tokens.input),String(t.tokens.cacheWrite),String(t.tokens.cacheRead),t.costGBP.opus.toFixed(2),t.costGBP.sonnet.toFixed(2)];return[t,...e.days.map(e=>n(e.date,e)),n(`TOTAL (${e.days.length} d)`,e.totals)].map(e=>e.join(`,`)).join(`
2
+ `)}function q({label:e,d:t,bold:n}){let r=n?`th`:`td`;return(0,S.jsxs)(`tr`,{className:n?`usage-total-row`:void 0,children:[(0,S.jsx)(r,{className:`usage-day`,children:e}),(0,S.jsx)(r,{children:W(Ne(t))}),(0,S.jsx)(r,{children:G(t.tokens.output)}),(0,S.jsx)(r,{children:G(t.tokens.input)}),(0,S.jsx)(r,{children:G(t.tokens.cacheWrite)}),(0,S.jsx)(r,{children:G(t.tokens.cacheRead)}),(0,S.jsx)(r,{children:K(t.costGBP.opus)}),(0,S.jsx)(r,{children:K(t.costGBP.sonnet)})]})}function Fe({show:e,onClose:t,sessionId:n,summary:r,loading:a,error:o}){if(!e)return null;let s=!!r&&r.days.length>0,c=()=>{if(!r)return;let e=new Blob([Pe(r)],{type:`text/csv;charset=utf-8`}),t=URL.createObjectURL(e),i=document.createElement(`a`);i.href=t,i.download=`usage-${n?n.slice(0,8):`session`}.csv`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(t)};return(0,S.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,S.jsxs)(`div`,{className:`claude-info-modal usage-modal`,onClick:e=>e.stopPropagation(),role:`dialog`,"aria-label":`Session usage and cost`,children:[(0,S.jsxs)(`div`,{className:`claude-info-header`,children:[(0,S.jsxs)(`span`,{children:[`Usage & cost`,n?` · ${n.slice(0,8)}`:``]}),s&&(0,S.jsx)(`button`,{className:`usage-download`,onClick:c,"aria-label":`Download as CSV`,title:`Download as CSV`,children:(0,S.jsx)(re,{size:14})}),(0,S.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:(0,S.jsx)(i,{size:14})})]}),(0,S.jsxs)(`div`,{className:`claude-info-section usage-body`,children:[a&&(0,S.jsx)(`div`,{className:`usage-note`,children:`Computing usage…`}),!a&&o&&(0,S.jsx)(`div`,{className:`usage-note usage-error`,children:o}),!a&&!o&&r&&r.days.length===0&&(0,S.jsx)(`div`,{className:`usage-note`,children:`No usage recorded for this session yet.`}),!a&&!o&&r&&r.days.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`usage-table-scroll`,children:(0,S.jsxs)(`table`,{className:`usage-table`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{children:[(0,S.jsx)(`th`,{className:`usage-day`,children:`Day`}),(0,S.jsx)(`th`,{children:`Active`}),(0,S.jsx)(`th`,{children:`Output tok`}),(0,S.jsx)(`th`,{children:`Input tok`}),(0,S.jsx)(`th`,{children:`Cache write`}),(0,S.jsx)(`th`,{children:`Cache read`}),(0,S.jsx)(`th`,{children:`Opus 4.8 (£)`}),(0,S.jsx)(`th`,{children:`Sonnet 4.6 (£)`})]})}),(0,S.jsxs)(`tbody`,{children:[r.days.map(e=>(0,S.jsx)(q,{label:e.date,d:e},e.date)),(0,S.jsx)(q,{label:`TOTAL (${r.days.length} d)`,d:r.totals,bold:!0})]})]})}),(0,S.jsxs)(`div`,{className:`usage-note usage-caveats`,children:[`Prices dated `,r.pricing.opusPriceDate,` · £/$ `,r.pricing.usdPerGbp,` · Sonnet tokenizer factor `,r.pricing.tokenizerFactor,`. Idle human-wait dominates the calendar span; cache-read tokens dominate cost; Sonnet is a tokenizer-adjusted estimate.`]})]})]})]})})}var Ie=`https://claude.ai/code`,Le=200,Re=[500,1e3,1500,2e3,2500,3e3,3e3];function ze(e,t,n){if(e&&n.target)return{kind:`navigate`,url:n.target,sameOrigin:!0};let r=n.slug??n.bridgeSessionId??null;if(e&&r)return{kind:`navigate`,url:`${Ie}/${r}`,sameOrigin:!1};let i=n.reason||n.error||`status ${t}`;return{kind:`error`,sessionId:n.sessionId??null,reason:i}}function Be(e){if(!e)return``;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function Ve(e){let{businessName:t,cacheKey:n,onConnectClaude:i,role:o,userName:s,userAvatar:d,onSelectProjects:h,onSelectPeople:g,onSelectTasks:_,onSelectAgents:b,onCloseMobileDrawer:C,collapsed:w,selectedWhatsappId:T,onSelectWhatsappConversation:k,initialWhatsappSurface:A=!1,onSelectData:j,onCloseData:he,initialDataSurface:ge=!1}=e,M=c(n),_e=(0,x.useCallback)(e=>({key:`reseat`,label:`Reset session ${e.title} (model, mode, effort)`,menuLabel:`Reset`,title:`Reset — move this session onto a chosen model, mode, and effort`,icon:(0,S.jsx)(O,{size:12}),panel:()=>(0,S.jsx)(Ee,{row:e,adminFetch:M,onError:e=>H({message:e,failed:!0})})}),[M]),N=r.productName,P=typeof s==`string`?s:s===null?`name unavailable`:t||N,F=(P.trim().charAt(0)||`?`).toUpperCase(),[I,L]=(0,x.useState)(ge?`data`:A?`whatsapp`:`sessions`),[R,z]=(0,x.useState)([]),[ye,be]=(0,x.useState)(!1),[B,xe]=(0,x.useState)(null),[Se,Ce]=(0,x.useState)(!1),[we,Te]=(0,x.useState)(`file`),[V,H]=(0,x.useState)(null),[De,U]=(0,x.useState)(null),[ke,je]=(0,x.useState)(!1),[W,Ne]=(0,x.useState)([]),[G]=(0,x.useState)(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`session`)),[K,Pe]=(0,x.useState)(!1),[q,Ie]=(0,x.useState)(null),[Ve,He]=(0,x.useState)(!1),[J,Ke]=(0,x.useState)(!1),[Y,qe]=(0,x.useState)(!1),[Je,Ye]=(0,x.useState)(null),[X,Xe]=(0,x.useState)(new Set),[Ze,Qe]=(0,x.useState)(null),[$e,et]=(0,x.useState)(new Set),[tt,nt]=(0,x.useState)(new Set),[rt,it]=(0,x.useState)(new Set),[at,ot]=(0,x.useState)(null),[st,Z]=(0,x.useState)(``),[ct,lt]=(0,x.useState)(!1),[ut,dt]=(0,x.useState)(null),[ft,pt]=(0,x.useState)(null),[mt,ht]=(0,x.useState)(!1),[gt,_t]=(0,x.useState)(null),[vt,yt]=(0,x.useState)(!1),bt=(0,x.useRef)(0),[xt,St]=(0,x.useState)([]),[Ct,wt]=(0,x.useState)(!1),[Tt,Et]=(0,x.useState)(null),[Dt,Ot]=(0,x.useState)(`whatsapp`),kt=(0,x.useCallback)(e=>{if(C(),!n){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=no-cache-key`),H({message:`Session not ready — try again`,failed:!0});return}if(!e.downloadPath){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=not-downloadable`),H({message:`${e.name} can’t be downloaded`,failed:!0});return}console.info(`[admin-ui] artefact-download id=${e.id} root=${e.downloadRoot??`data`} path=${e.downloadPath}`),ie(n,e.downloadPath,e.downloadRoot??`data`),H({message:`Downloading ${e.name}`,failed:!1})},[n,C]);(0,x.useEffect)(()=>{if(!V)return;let e=setTimeout(()=>H(null),2500);return()=>clearTimeout(e)},[V]);let At=G!=null&&W.some(e=>e.sessionId===G);(0,x.useEffect)(()=>{G==null||!K||console.info(`[sidebar-sessions] op=select-highlight session=${G.slice(0,8)} matched=${At}`)},[G,At,K]);let jt=(0,x.useCallback)(async()=>{if(n){Ce(!0),xe(null);try{let e=await M(`/api/admin/sidebar-artefacts`);if(!e.ok)throw Error(`status ${e.status}`);z((await e.json()).artefacts??[]),be(!0)}catch(e){let t=e instanceof Error?e.message:String(e);xe(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{Ce(!1)}}},[n,M]),Q=(0,x.useCallback)(async()=>{if(!n)return null;let e=++bt.current;He(!0),Ie(null);try{let t=await M(`/api/admin/sidebar-sessions`);if(!t.ok)throw Error(`status ${t.status}`);let n=await t.json(),r=n.sessions??[];return e===bt.current?(Ne(r),Ye(n.accountId??null),Pe(!0),r):(console.info(`[admin-ui] sidebar-sessions-stale-response-dropped token=${e}`),r)}catch(t){let n=t instanceof Error?t.message:String(t);return e===bt.current&&Ie(`Failed to load sessions: ${n}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${n}`),null}finally{e===bt.current&&He(!1)}},[n,M]),Mt=(0,x.useCallback)(async()=>{if(n){Et(null);try{let e=await M(`/api/whatsapp-reader/conversations`);if(!e.ok)throw Error(`status ${e.status}`);St((await e.json()).conversations??[]),wt(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Et(`Couldn't load conversations.`),console.error(`[admin-ui] channel-convos fetch failed: ${t}`)}}},[n,M]);(0,x.useEffect)(()=>{!n||K||Q()},[n,K,Q]),(0,x.useEffect)(()=>{if(!n)return;let e=null;return Mt(),e=setInterval(()=>{Mt()},Ue),()=>{e!==null&&clearInterval(e)}},[n,Mt]),(0,x.useEffect)(()=>{if(!n)return;let e=null;function t(){console.info(`[admin-ui] sidebar-refresh surface=sessions trigger=poll`),Q()}function r(){e===null&&(e=setInterval(t,We))}function i(){e!==null&&(clearInterval(e),e=null)}function a(){document.hidden?i():(t(),r())}return document.hidden||r(),document.addEventListener(`visibilitychange`,a),()=>{i(),document.removeEventListener(`visibilitychange`,a)}},[n,Q]);let Nt=(0,x.useMemo)(()=>{let e=new Map;for(let t of y)e.set(t,[]);for(let t of xt)e.get(t.channel)?.push(t);for(let t of y)console.info(`[admin-ui] sidebar-nav surface=${t} count=${e.get(t).length}`);return e},[xt]),Pt={whatsapp:`WhatsApp`,telegram:`Telegram`,webchat:`Webchat`},Ft=()=>{k(null),L(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${ye?R.length:0} collapsed=${w}`),jt()},$=1.5,It=()=>{console.info(`[admin-ui] sidebar-refresh surface=artefacts`),jt()},Lt=()=>{k(null),L(`sessions`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${K?W.length:0} collapsed=${w}`),K||Q()},Rt=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions trigger=manual`),Q()},zt=()=>{L(`data`),console.info(`[admin-ui] sidebar-nav surface=data collapsed=${w}`),j(),C()},Bt=e=>{he?.(),L(`whatsapp`),Ot(e),console.info(`[admin-ui] sidebar-nav surface=${e} count=${Nt.get(e)?.length??0} collapsed=${w}`)},Vt=(0,x.useCallback)(async e=>{if($e.has(e.sessionId))return;et(t=>{let n=new Set(t);return n.add(e.sessionId),n});let t=window.open(``,`_blank`);try{let n=await M(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId,...e.accountId?{targetAccountId:e.accountId}:{}})}),r=await n.json().catch(()=>({})),i=ze(n.ok,n.status,{...r,sessionId:r.sessionId??e.sessionId});console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} status=${n.status} outcome=${i.kind} slug=${r.slug??r.bridgeSessionId??`none`}`),i.kind===`navigate`?(C(),t?t.location.href=i.url:window.open(i.url,`_blank`)):(t?.close(),console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${n.status} reason=${i.reason}`),U(i))}catch(n){t?.close();let r=n instanceof Error?n.message:String(n);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${r}`),U({sessionId:e.sessionId,reason:r})}finally{et(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[M,C,$e]),Ht=(0,x.useCallback)(async e=>{let t=e.slice(0,8);for(let n=1;n<=Re.length;n++){await new Promise(e=>setTimeout(e,Re[n-1]));let r=await Q();if(r&&r.some(t=>t.sessionId===e)){console.info(`[admin-ui] sidebar-new-session-converged sessionId=${t} via=retry attempts=${n}`);return}}console.error(`[admin-ui] sidebar-new-session-converge-timeout sessionId=${t}`)},[Q]),Ut=(0,x.useCallback)(async()=>{if(!vt){yt(!0);try{let e=await M(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),t=await e.json().catch(()=>({})),n=ze(e.ok,e.status,t);console.info(`[admin-ui] sidebar-new-session-spawned status=${e.status} outcome=${n.kind} slug=${t.slug??t.bridgeSessionId??`none`}`),n.kind===`navigate`?n.sameOrigin?window.location.assign(n.url):(window.open(n.url,`_blank`),t.sessionId?Ht(t.sessionId):console.error(`[admin-ui] sidebar-new-session-converge-skipped reason=no-session-id`)):e.status===503||n.reason===`claude-auth-dead`?(console.info(`[admin-ui] op=llm-action-blocked action=spawn reason=claude-disconnected`),je(!0)):(console.error(`[admin-ui] sidebar-new-session-failed status=${e.status} reason=${n.reason}`),U(n))}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-new-session-failed error=${t}`),U({sessionId:null,reason:t})}finally{yt(!1)}}},[M,vt,Ht]),Wt=(0,x.useCallback)((e,t)=>{e.stopPropagation(),Qe(t)},[]),Gt=(0,x.useCallback)(async(e,t)=>{e.stopPropagation(),dt(t),pt(null),_t(null),ht(!0);try{let e=await M(`/api/admin/session-usage?sessionId=${encodeURIComponent(t.sessionId)}`),n=await e.json().catch(()=>({}));e.ok?pt(n):_t(n.error??`status ${e.status}`)}catch(e){_t(e instanceof Error?e.message:String(e))}finally{ht(!1)}},[M]),Kt=(0,x.useCallback)(async e=>{if(!X.has(e.sessionId)){Xe(t=>{let n=new Set(t);return n.add(e.sessionId),n});try{let t=await M(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId})});if(!t.ok){let n=await t.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${e.sessionId} status=${t.status} error=${n.error??`unknown`}`),H({message:`Delete failed: ${n.error??`status ${t.status}`}`,failed:!0});return}let n=await t.json();console.info(`[admin-ui] sidebar-session-delete sessionId=${e.sessionId} live=${e.live} confirmed=true pidKilled=${n.pidKilled??`?`} deleted=${n.deleted??`?`}`),Ne(t=>t.filter(t=>t.sessionId!==e.sessionId)),Q()}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${e.sessionId} error=${n}`),H({message:`Delete failed: ${n}`,failed:!0})}finally{Xe(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}}},[M,X,Q]),qt=(0,x.useCallback)(async(e,t)=>{if(e.stopPropagation(),!tt.has(t.sessionId)){nt(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await M(`/api/admin/session-stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),H({message:`Stop failed: ${n.error??`status ${e.status}`}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-stop sessionId=${t.sessionId}`),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} error=${n}`),H({message:`Stop failed: ${n}`,failed:!0})}finally{nt(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[M,tt,Q]),Jt=(0,x.useCallback)(async(e,t,n)=>{if(e.stopPropagation(),!rt.has(t.sessionId)){it(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await M(`/api/admin/session-archive`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,mode:n})});if(!e.ok){let r=await e.json().catch(()=>({})),i=r.detail??r.error??`status ${e.status}`;console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} status=${e.status} error=${r.error??`unknown`}`),H({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${i}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-archive sessionId=${t.sessionId} mode=${n}`),Q()}catch(e){let r=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} error=${r}`),H({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${r}`,failed:!0})}finally{it(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[M,rt,Q]),Yt=(0,x.useCallback)(async e=>{let t=st.trim();if(!t){H({message:`Title can’t be empty`,failed:!0});return}if(t.length>Le){H({message:`Title too long (max ${Le})`,failed:!0});return}lt(!0);try{let n=await M(`/api/admin/session-rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,title:t})});if(!n.ok){let t=await n.json().catch(()=>({})),r=t.reason??t.error??`status ${n.status}`;console.error(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=rejected reason=${r}`),H({message:`Rename failed: ${r}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=ok`),ot(null),Z(``),Q()}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=rejected reason=${n}`),H({message:`Rename failed: ${n}`,failed:!0})}finally{lt(!1)}},[M,st,Q]);return(0,S.jsxs)(`aside`,{className:`side`,children:[(0,S.jsx)(`div`,{className:`side-new-session-row`,children:(0,S.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:Ut,disabled:vt,"aria-busy":vt,children:[(0,S.jsx)(te,{size:14}),(0,S.jsx)(`span`,{children:vt?`Spawning…`:`New session`})]})}),(0,S.jsxs)(`nav`,{className:`side-nav`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),g(),C()},children:[(0,S.jsx)(me,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`People`}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),b(),C()},children:[(0,S.jsx)(D,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`Agents`}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),h(),C()},children:[(0,S.jsx)(le,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:a().term}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),_(),C()},children:[(0,S.jsx)(fe,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row${I===`artefacts`?` active`:``}`,onClick:Ft,children:[(0,S.jsx)(ae,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row${I===`sessions`?` active`:``}`,onClick:Lt,children:[(0,S.jsx)(de,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,S.jsx)(`span`,{className:`kbd`})]}),(0,S.jsxs)(`button`,{type:`button`,className:`nav-row${I===`data`?` active`:``}`,onClick:zt,children:[(0,S.jsx)(u,{size:20,strokeWidth:$}),(0,S.jsx)(`span`,{className:`label`,children:`Data`}),(0,S.jsx)(`span`,{className:`kbd`})]}),Ct&&y.filter(e=>Nt.get(e).length>0).map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`nav-row${I===`whatsapp`&&Dt===e?` active`:``}`,onClick:()=>Bt(e),children:[(0,S.jsx)(ne,{channel:e,size:16}),(0,S.jsx)(`span`,{className:`label`,children:Pt[e]}),(0,S.jsx)(`span`,{className:`kbd`})]},e)),Tt&&(0,S.jsx)(`div`,{className:`nav-row`,style:{color:`var(--text-tertiary)`,cursor:`default`},"aria-disabled":`true`,children:(0,S.jsx)(`span`,{className:`label`,children:Tt})})]}),I===`artefacts`&&(0,S.jsxs)(`div`,{className:`side-list`,children:[(0,S.jsxs)(`div`,{className:`group-head`,children:[(0,S.jsx)(`span`,{children:`Artefacts`}),(0,S.jsxs)(`span`,{className:`group-head-meta`,children:[(0,S.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh artefacts`,"aria-label":`Refresh artefacts`,onClick:It,disabled:Se,children:(0,S.jsx)(v,{size:12,className:Se?`spinning`:void 0})}),(0,S.jsx)(`span`,{children:Se?`…`:String(R.length)})]})]}),B&&(0,S.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:B}),ye&&!B&&R.length>0&&(()=>{let e=R.filter(e=>e.kind===`agent-template`).length,t=R.length-e;return(0,S.jsx)(`div`,{className:`artefact-filter-chips`,children:[{key:`all`,label:`All`,count:R.length},{key:`agent`,label:`Agents`,count:e},{key:`file`,label:`Files`,count:t}].map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`artefact-filter-chip${we===e.key?` active`:``}`,onClick:()=>Te(e.key),disabled:e.count===0&&e.key!==`all`,children:[e.label,(0,S.jsx)(`span`,{className:`artefact-filter-chip-count`,children:e.count})]},e.key))})})(),ye&&!B&&R.length===0&&(0,S.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),R.filter(e=>we===`all`?!0:we===`agent`?e.kind===`agent-template`:e.kind!==`agent-template`).map(e=>{let t=e.kind===`agent-template`,n=t?D:ae,r=Be(e.updatedAt),i=e.downloadPath!==null;return(0,S.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>kt(e),disabled:!i,style:i?void 0:{cursor:`default`},title:i?`Download ${e.name}`:`${e.name} can’t be downloaded`,children:[(0,S.jsx)(n,{size:14,className:`conv-icon`,"data-kind":t?`agent`:`file`,"aria-label":t?`agent template`:`file`}),(0,S.jsxs)(`span`,{className:`conv-stack`,children:[(0,S.jsx)(`span`,{className:`conv-name-line`,children:(0,S.jsx)(`span`,{className:`conv-name`,children:e.name})}),r&&(0,S.jsx)(`span`,{className:`conv-timestamp`,children:r})]}),i&&(0,S.jsx)(re,{size:12,className:`conv-rc-icon`,"aria-hidden":`true`})]},e.id)})]}),I===`sessions`&&(()=>{let e=W.filter(e=>J?!0:!e.isSubagent).filter(e=>Y?!0:!e.archived),t=W.some(e=>e.isSubagent),n=W.some(e=>e.archived);return(0,S.jsxs)(`div`,{className:`side-list`,children:[(0,S.jsxs)(`div`,{className:`group-head`,children:[(0,S.jsx)(`span`,{children:`Sessions`}),(0,S.jsxs)(`span`,{className:`group-head-meta`,children:[(0,S.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh sessions`,"aria-label":`Refresh sessions`,onClick:Rt,disabled:Ve,children:(0,S.jsx)(v,{size:12,className:Ve?`spinning`:void 0})}),(0,S.jsx)(`span`,{children:Ve?`…`:String(e.length)})]})]}),Je&&(0,S.jsx)(`div`,{className:`side-account-id`,title:`This install's accountId. The first 8 characters match the truncated UUID label on the live Remote Control daemon entry in claude.ai/code.`,children:(0,S.jsx)(`code`,{children:Je})}),(t||n)&&(0,S.jsxs)(`div`,{className:`artefact-filter-chips`,children:[t&&(0,S.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${J?` active`:``}`,"aria-pressed":J,onClick:()=>Ke(e=>!e),title:J?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`}),n&&(0,S.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${Y?` active`:``}`,"aria-pressed":Y,onClick:()=>qe(e=>!e),title:Y?`Hide archived sessions`:`Show archived sessions`,children:`Archived`})]}),q&&(0,S.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:q}),K&&!q&&e.length===0&&(0,S.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No sessions yet`}),e.map(e=>{let t=Be(e.startedAt),n=$e.has(e.sessionId),r=X.has(e.sessionId),i=tt.has(e.sessionId),a=rt.has(e.sessionId),o=n||r||i||a,s=()=>{window.location.assign(`/chat?session=${e.sessionId}`)},c=[{key:`open`,label:`Resume session ${e.title} in claude.ai/code`,menuLabel:`Resume in claude.ai/code`,title:`Resume in a fresh local Remote Control PTY`,icon:(0,S.jsx)(p,{size:12}),busy:n,onClick:()=>{Vt(e)}},{key:`message`,label:`Open session ${e.title} in admin webchat`,menuLabel:`Open in webchat`,title:`Open in admin webchat (/chat) — sending resumes this session`,icon:(0,S.jsx)(pe,{size:12}),onClick:()=>{s()}},{key:`usage`,label:`Usage and cost for session ${e.title}`,menuLabel:`Usage & cost`,title:`Per-day active time, tokens, and estimated GBP cost`,icon:(0,S.jsx)(ue,{size:12}),onClick:t=>{Gt(t,e)}},...e.live?[{key:`stop`,label:`Stop session ${e.title}`,menuLabel:`Stop`,title:`Stop session process (keeps the conversation, can resume later)`,icon:(0,S.jsx)(m,{size:12}),busy:i,onClick:t=>{qt(t,e)}}]:[],e.archived?{key:`unarchive`,label:`Unarchive session ${e.title}`,menuLabel:`Unarchive`,title:`Unarchive (move back to the active list)`,icon:(0,S.jsx)(ce,{size:12}),busy:a,onClick:t=>{Jt(t,e,`unarchive`)}}:{key:`archive`,label:`Archive session ${e.title}`,menuLabel:`Archive`,title:`Archive (hide from the list, keeps the conversation resumable)`,icon:(0,S.jsx)(E,{size:12}),busy:a,onClick:t=>{Jt(t,e,`archive`)}},{key:`rename`,label:`Rename session ${e.title}`,menuLabel:`Rename`,title:`Rename this session`,icon:(0,S.jsx)(l,{size:12}),busy:ct&&at===e.sessionId,onClick:t=>{t.stopPropagation(),ot(e.sessionId),Z(e.personName??e.title)}},{key:`delete`,label:`Delete session ${e.title}`,menuLabel:`Delete`,title:`Delete session (stops the process, removes the conversation)`,icon:(0,S.jsx)(f,{size:12}),danger:!0,busy:r,onClick:t=>{Wt(t,e)}},_e({sessionId:e.sessionId,model:e.model??null,title:e.personName??e.title})],u=e.channel===`whatsapp`?` conv-channel-whatsapp`:e.channel===`telegram`?` conv-channel-telegram`:``,d=e.channel===`whatsapp`||e.channel===`telegram`||e.channel===`webchat`,h=y.includes(e.channel??``)&&e.senderId&&e.titleSource===`prefix`?ee({operatorName:e.personName??null,whatsappName:null,senderId:e.senderId,title:e.title}):e.personName??e.title;return(0,S.jsxs)(`div`,{className:`conv conv-with-actions${u}${e.sessionId===G?` active`:``}`,children:[(0,S.jsxs)(`div`,{className:`conv-main-static conv-main-clickable`,role:`button`,tabIndex:0,"aria-label":`Open ${h} in webchat`,onClick:()=>{at!==e.sessionId&&s()},onKeyDown:t=>{at!==e.sessionId&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s())},children:[(0,S.jsx)(`span`,{className:`conv-live-dot`,"data-live":e.live?`1`:`0`,"aria-label":e.live?`live session`:`ended session`}),(0,S.jsxs)(`span`,{className:`conv-stack`,children:[(0,S.jsxs)(`span`,{className:`conv-name-line`,children:[d&&(0,S.jsx)(se,{channel:e.channel,size:13}),at===e.sessionId?(0,S.jsx)(`input`,{className:`conv-name conv-name-edit`,autoFocus:!0,value:st,disabled:ct,"aria-label":`New title for session ${e.title}`,onChange:e=>Z(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),Yt(e)):t.key===`Escape`&&(t.preventDefault(),ot(null),Z(``))},onBlur:()=>{at===e.sessionId&&!ct&&(ot(null),Z(``))}}):(0,S.jsx)(`span`,{className:`conv-name`,title:h,children:h})]}),(0,S.jsxs)(`span`,{className:`conv-timestamp`,children:[(0,S.jsx)(`code`,{className:`conv-session-id`,title:`First 8 characters of this session's id — distinguishes rows with identical auto-titles. The resume/delete buttons act on the full id.`,children:e.sessionId.slice(0,8)}),t&&(0,S.jsxs)(`span`,{children:[` · `,t]})]})]})]}),(0,S.jsx)(ve,{actions:c,disabled:o})]},e.sessionId)})]})})(),I===`whatsapp`&&(0,S.jsxs)(`div`,{className:`side-list`,children:[(0,S.jsxs)(`div`,{className:`group-head`,children:[(0,S.jsx)(`span`,{children:Pt[Dt]}),(0,S.jsxs)(`span`,{className:`group-head-meta`,children:[(0,S.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh conversations`,"aria-label":`Refresh conversations`,onClick:()=>{Mt()},children:(0,S.jsx)(v,{size:12})}),(0,S.jsx)(`span`,{children:String(Nt.get(Dt).length)})]})]}),Nt.get(Dt).map(e=>{let t=Be(e.lastMessageAt),n=oe(e);return(0,S.jsxs)(`div`,{className:`conv conv-with-actions${e.source===`store`?e.scope===`admin`?` conv-scope-admin`:` conv-scope-public`:``}${T===n?` active`:``}`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`conv-main-static conv-main-btn`,onClick:()=>{k(e),C()},title:e.title,children:[(0,S.jsx)(ne,{channel:e.channel,size:14}),(0,S.jsxs)(`span`,{className:`conv-stack`,children:[(0,S.jsx)(`span`,{className:`conv-name-line`,children:(0,S.jsx)(`span`,{className:`conv-name`,children:ee(e)})}),t&&(0,S.jsx)(`span`,{className:`conv-timestamp`,children:t})]})]}),e.source===`session`&&(0,S.jsx)(ve,{actions:[_e({sessionId:e.sessionId,model:e.model,title:e.title})],disabled:!1})]},n)})]}),(0,S.jsx)(Ge,{}),(0,S.jsxs)(`div`,{className:`side-foot`,children:[(0,S.jsx)(`div`,{className:`avatar`,children:d?(0,S.jsx)(`img`,{src:d,alt:P}):F}),(0,S.jsxs)(`div`,{className:`who`,children:[(0,S.jsx)(`span`,{className:`name`,children:P}),(0,S.jsx)(`span`,{className:`role`,children:o??`operator`})]})]}),V&&(0,S.jsx)(`div`,{className:`copy-toast${V.failed?` copy-toast-failed`:``}`,role:`status`,children:V.message}),(0,S.jsx)(Ae,{error:De,onClose:()=>U(null)}),(0,S.jsx)(Me,{open:ke,onConnect:()=>{je(!1),i?.()},onClose:()=>je(!1)}),(0,S.jsx)(Oe,{target:Ze,onCancel:()=>Qe(null),onConfirm:()=>{let e=Ze;Qe(null),e&&Kt(e)}}),(0,S.jsx)(Fe,{show:ut!==null,onClose:()=>{dt(null),pt(null),_t(null)},sessionId:ut?.sessionId??null,summary:ft,loading:mt,error:gt})]})}var He=5e3,Ue=3e4,We=3e4;function Ge(){let[e,t]=(0,x.useState)(null);if((0,x.useEffect)(()=>{let e=!1,n=null;async function r(){try{let n=await fetch(`/api/admin/system-stats`);if(!n.ok){console.error(`[admin-ui] system-stats-fetch-failed status=${n.status}`);return}let r=await n.json();e||t(r)}catch(e){console.error(`[admin-ui] system-stats-fetch-failed reason=${e instanceof Error?e.message:String(e)}`)}}function i(){n===null&&(r(),n=setInterval(()=>{r()},He))}function a(){n!==null&&(clearInterval(n),n=null)}function o(){document.hidden?a():i()}return document.hidden||i(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,a(),document.removeEventListener(`visibilitychange`,o)}},[]),!e||e.platform===`darwin`)return null;let n=e.cpuPct,r=e.memUsedPct,i=n!==null&&n>=.9,a=n!==null&&n>=.98,o=r!==null&&r>=.9,s=r!==null&&r>=.98,c=i||o,l=a||s,u=e=>e===null?`—`:`${Math.round(e*100)}%`,d=e=>{if(e===null)return{width:`0%`,background:`var(--text-tertiary)`};let t=Math.min(1,Math.max(0,e)),n=Math.round(140*(1-t));return{width:`${Math.round(t*100)}%`,background:`hsl(${n}, 65%, 45%)`}},f=[`system-stats`];return c&&f.push(`system-stats--warn`),l&&f.push(`system-stats--crit`),(0,S.jsxs)(`div`,{className:f.join(` `),role:`status`,"aria-label":`host CPU and RAM`,children:[(0,S.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,S.jsxs)(`span`,{className:i?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`CPU `,u(n)]}),(0,S.jsx)(`div`,{className:`system-stats__bar`,children:(0,S.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(n)})})]}),(0,S.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,S.jsxs)(`span`,{className:o?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`RAM `,u(r)]}),(0,S.jsx)(`div`,{className:`system-stats__bar`,children:(0,S.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(r)})})]})]})}var J=`admin-sidebar-collapsed`,Ke=`admin-sidebar-drawer-open`;function Y(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(J)===`1`}catch{return!1}}function qe(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(J,`1`):window.sessionStorage.removeItem(J)}catch{}}function Je(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(Ke)===`1`}catch{return!1}}function Ye(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(Ke,`1`):window.sessionStorage.removeItem(Ke)}catch{}}function X(e){let[t,n]=(0,x.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches);return(0,x.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Xe=720;function Ze(e,t){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?wa=${encodeURIComponent(t.remoteJid??``)}&acct=${encodeURIComponent(t.accountId??``)}`}}function Qe(e){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?data=1`}}function $e(e,t){if(e!==`/`)return null;let n=new URLSearchParams(t),r=n.get(`wa`),i=n.get(`acct`);return!r||!i?null:{sessionId:``,projectDir:``,title:``,senderId:null,startedAt:``,channel:`whatsapp`,role:`public`,operatorName:null,whatsappName:null,lastMessageAt:null,modelGated:!1,model:null,source:`store`,accountId:i,remoteJid:r}}function et(e,t){return e===`/`?new URLSearchParams(t).has(`data`):!1}function tt(e,t){return t===`operator`&&e===`chat`||e===`dashboard`?`/`:e===`data`?`/data`:e===`graph`?`/graph`:e===`calendar`?`/calendar`:e===`chat`?`/chat`:`/browser`}function nt(e){let{cacheKey:t,businessName:n,variant:r=`admin`,onLogout:i,onDisconnect:o,disconnecting:s,claudeConnected:c,onConnectClaude:l,userName:u,userAvatar:f,role:p,onOpenConversations:m,children:g,footer:_}=e,{subAccounts:ee,activeAccountId:v,switching:te,switchAccount:ne,refreshAccounts:re}=h(t),[ie,y]=(0,x.useState)(!0);(0,x.useEffect)(()=>{if(c!==void 0||r!==`admin`)return;let e=!1,t=async()=>{try{let t=await fetch(`/api/health`);if(!t.ok)return;let n=await t.json();e||y(n.auth_status!==`dead`&&n.auth_status!==`missing`)}catch{}};t();let n=setInterval(t,6e4);return()=>{e=!0,clearInterval(n)}},[c,r]);let ae=c??ie,se=l??(()=>{window.location.assign(`/?connect=claude`)}),[b,C]=(0,x.useState)(()=>Y()),[w,T]=(0,x.useState)(()=>Je()),ce=X(`(max-width: ${Xe}px)`),[E,D]=(0,x.useState)(()=>typeof window>`u`||et(window.location.pathname,window.location.search)?null:$e(window.location.pathname,window.location.search)),[le]=(0,x.useState)(()=>E!==null),[ue,de]=(0,x.useState)(()=>typeof window>`u`?!1:et(window.location.pathname,window.location.search)),[fe]=(0,x.useState)(()=>ue),pe=(0,x.useCallback)(e=>{qe(e),C(e)},[]),O=(0,x.useCallback)(e=>{Ye(e),T(e)},[]);(0,x.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} variant=${r} sidebar=${r===`operator`?`none`:`present`} collapsed=${b} drawer=${w}`)},[]),(0,x.useEffect)(()=>{typeof window>`u`||!E||(console.info(`[admin-ui] wa-hydrate route=/ remoteJid=${E.remoteJid??``}`),window.history.replaceState(null,``,`/`))},[]),(0,x.useEffect)(()=>{typeof window>`u`||!ue||(console.info(`[admin-ui] data-hydrate route=/`),window.history.replaceState(null,``,`/`))},[]);let me=(0,x.useCallback)(e=>{if(de(!1),e===null){D(null);return}let t=typeof window<`u`?window.location.pathname:`/`,n=Ze(t,e);console.info(`[admin-ui] wa-open route=${t} via=${n.via} sessionId=${e.sessionId.slice(0,8)}`),n.via===`in-place`?D(e):window.location.href=n.href},[]),k=(0,x.useCallback)(()=>{let e=typeof window<`u`?window.location.pathname:`/`,t=Qe(e);if(console.info(`[admin-ui] data-open route=${e} via=${t.via}`),t.via===`navigate`){window.location.href=t.href;return}D(null),de(!0)},[]),A=ce?w:!b,j=(0,x.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Xe}px)`).matches){let e=w;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),O(!e)}else{let e=b;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),pe(!e)}},[b,w,pe,O]),he=(0,x.useCallback)(e=>{let t=tt(e,r);console.info(`[admin-ui] header-menu-nav target=${e} dest=${t}`),window.location.href=t},[r]),M={collapsed:b,mobileDrawerOpen:w,sidebarOpen:A,onToggleSidebar:j,setMobileDrawerOpen:O,selectedWhatsapp:E,onClearWhatsapp:()=>D(null),dataOpen:ue};return r===`operator`?(0,S.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,S.jsx)(d,{businessName:n,variant:r,onNavigate:he,onOpenConversations:m,onToggleSidebar:j,sidebarOpen:A,onLogout:i,onDisconnect:o,disconnecting:s,cacheKey:t,subAccounts:ee,activeAccountId:v,switchingAccount:te,onSwitchAccount:ne,refreshAccounts:re}),(0,S.jsx)(`div`,{className:`platform platform-operator`,children:typeof g==`function`?g(M):g}),_]}):(0,S.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,S.jsx)(d,{businessName:n,variant:r,onNavigate:he,onOpenConversations:m,onToggleSidebar:j,sidebarOpen:A,onLogout:i,onDisconnect:o,disconnecting:s,claudeConnected:ae,onConnectClaude:se,cacheKey:t,subAccounts:ee,activeAccountId:v,switchingAccount:te,onSwitchAccount:ne,refreshAccounts:re}),(0,S.jsxs)(`div`,{className:`platform${w?` menu-open`:``}${b?` sidebar-collapsed`:``}`,"data-artefact":`closed`,children:[(0,S.jsx)(Ve,{businessName:n,cacheKey:t,onConnectClaude:se,role:p??null,userName:u,userAvatar:f??null,onSelectProjects:()=>{window.location.href=`/graph?label=${a().label}`},onSelectPeople:()=>{window.location.href=`/graph?label=Person`},onSelectTasks:()=>{window.location.href=`/tasks`},onSelectAgents:()=>{window.location.href=`/graph?label=Agent`},onCloseMobileDrawer:()=>O(!1),collapsed:b,mobileDrawerOpen:w,selectedWhatsappId:E?oe(E):null,onSelectWhatsappConversation:me,initialWhatsappSurface:le,onSelectData:k,onCloseData:()=>de(!1),initialDataSurface:fe}),!ce&&(0,S.jsx)(ge,{}),typeof g==`function`?g(M):g]}),w&&(0,S.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>O(!1)}),_]})}export{E as _,je as a,b,N as c,L as d,me as f,D as g,ue as h,Me as i,P as l,fe as m,X as n,U as o,O as p,ze as r,F as s,nt as t,ye as u,ce as v,T as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,r as n,w as r,x as i}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as a,t as o}from"./AdminLoginScreens-DeR71H29.js";import{s}from"./useVoiceRecorder-DCyJQkFK.js";import{a as c,t as l}from"./AdminShell-DlAVQUda.js";import"./Checkbox-B629mOPp.js";import{n as u,r as d}from"./page-Ck_pLhAk.js";import{a as f,s as p}from"./file-download-4mKJxUi-.js";import"./graph-labels-B8YAdo3Z.js";var m=r(),h=e(t(),1),g=i();function _({onOpen:e}){return(0,g.jsx)(`footer`,{className:`admin-footer`,children:(0,g.jsxs)(`div`,{className:`powered-by`,role:`button`,tabIndex:0,onClick:e,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},"aria-label":`Powered by Claude Code — show details`,children:[(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`powered-by-icon`}),(0,g.jsx)(`span`,{children:`Powered by Claude Code`})]})})}function v(){let e=a(),[t,r]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let i=(0,h.useCallback)(async()=>{let t=e.claudeInfo!=null;if(r(!0),t){console.info(`[admin-ui] claude-info-open cached=true ms=0`);return}let n=Date.now();try{let t=await fetch(`/api/admin/claude-info`);if(t.ok){let n=await t.json();e.setClaudeInfo(n)}console.info(`[admin-ui] claude-info-open cached=false ms=${Date.now()-n}`)}catch(e){console.error(`[admin-ui] claude-info-fetch-failed ms=${Date.now()-n} error="${e instanceof Error?e.message:String(e)}"`)}},[e]),m=(0,h.useCallback)(({code:t,path:n})=>{console.warn(`[admin-auth] outcome=chat-tab-logout-on-401 code=${t} path=${n}`),e.handleLogout()},[e]);return e.appState===`chat`?(0,g.jsx)(n,{cacheKey:e.cacheKey,onSessionExpired:m,surface:`chat`,children:(0,g.jsx)(l,{cacheKey:e.cacheKey,businessName:e.businessName,sessionId:e.sessionId,onLogout:e.handleLogout,onDisconnect:e.handleDisconnect,disconnecting:e.disconnecting,claudeConnected:e.claudeConnected,onConnectClaude:()=>e.setAppState(`connect-claude`),userName:e.userName,userAvatar:e.userAvatar,role:e.role,footer:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(_,{onOpen:i}),(0,g.jsx)(c,{show:t,onClose:()=>r(!1),claudeInfo:e.claudeInfo,messages:[],sessionElapsed:0,sessionId:e.sessionId,cacheKey:e.cacheKey})]}),children:t=>(0,g.jsx)(g.Fragment,{children:t.dataOpen&&e.cacheKey?(0,g.jsx)(u,{cacheKey:e.cacheKey}):t.selectedWhatsapp&&e.cacheKey?t.selectedWhatsapp.source===`store`&&t.selectedWhatsapp.remoteJid&&t.selectedWhatsapp.accountId?(0,g.jsx)(d,{accountId:t.selectedWhatsapp.accountId,remoteJid:t.selectedWhatsapp.remoteJid,contactName:f(t.selectedWhatsapp),sessionKey:e.cacheKey},p(t.selectedWhatsapp)):(0,g.jsx)(s,{sessionId:t.selectedWhatsapp.sessionId,projectDir:t.selectedWhatsapp.projectDir,sessionKey:e.cacheKey,forceDeliveredOnly:!0},p(t.selectedWhatsapp)):(0,g.jsx)(`main`,{})})})}):(0,g.jsx)(o,{auth:e})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(v,{}));
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,r as n,w as r,x as i}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as a,t as o}from"./AdminLoginScreens-CukwQufW.js";import{s}from"./useVoiceRecorder-b7HzTFs0.js";import{a as c,t as l}from"./AdminShell-BwEBH6tT.js";import"./Checkbox-B629mOPp.js";import{n as u,r as d}from"./page-DEkI-Gl1.js";import{a as f,s as p}from"./file-download-4mKJxUi-.js";import"./graph-labels-B8YAdo3Z.js";var m=r(),h=e(t(),1),g=i();function _({onOpen:e}){return(0,g.jsx)(`footer`,{className:`admin-footer`,children:(0,g.jsxs)(`div`,{className:`powered-by`,role:`button`,tabIndex:0,onClick:e,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},"aria-label":`Powered by Claude Code — show details`,children:[(0,g.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`powered-by-icon`}),(0,g.jsx)(`span`,{children:`Powered by Claude Code`})]})})}function v(){let e=a(),[t,r]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&r(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let i=(0,h.useCallback)(async()=>{let t=e.claudeInfo!=null;if(r(!0),t){console.info(`[admin-ui] claude-info-open cached=true ms=0`);return}let n=Date.now();try{let t=await fetch(`/api/admin/claude-info`);if(t.ok){let n=await t.json();e.setClaudeInfo(n)}console.info(`[admin-ui] claude-info-open cached=false ms=${Date.now()-n}`)}catch(e){console.error(`[admin-ui] claude-info-fetch-failed ms=${Date.now()-n} error="${e instanceof Error?e.message:String(e)}"`)}},[e]),m=(0,h.useCallback)(({code:t,path:n})=>{console.warn(`[admin-auth] outcome=chat-tab-logout-on-401 code=${t} path=${n}`),e.handleLogout()},[e]);return e.appState===`chat`?(0,g.jsx)(n,{cacheKey:e.cacheKey,onSessionExpired:m,surface:`chat`,children:(0,g.jsx)(l,{cacheKey:e.cacheKey,businessName:e.businessName,sessionId:e.sessionId,onLogout:e.handleLogout,onDisconnect:e.handleDisconnect,disconnecting:e.disconnecting,claudeConnected:e.claudeConnected,onConnectClaude:()=>e.setAppState(`connect-claude`),userName:e.userName,userAvatar:e.userAvatar,role:e.role,footer:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(_,{onOpen:i}),(0,g.jsx)(c,{show:t,onClose:()=>r(!1),claudeInfo:e.claudeInfo,messages:[],sessionElapsed:0,sessionId:e.sessionId,cacheKey:e.cacheKey})]}),children:t=>(0,g.jsx)(g.Fragment,{children:t.dataOpen&&e.cacheKey?(0,g.jsx)(u,{cacheKey:e.cacheKey}):t.selectedWhatsapp&&e.cacheKey?t.selectedWhatsapp.source===`store`&&t.selectedWhatsapp.remoteJid&&t.selectedWhatsapp.accountId?(0,g.jsx)(d,{accountId:t.selectedWhatsapp.accountId,remoteJid:t.selectedWhatsapp.remoteJid,contactName:f(t.selectedWhatsapp),sessionKey:e.cacheKey},p(t.selectedWhatsapp)):(0,g.jsx)(s,{sessionId:t.selectedWhatsapp.sessionId,projectDir:t.selectedWhatsapp.projectDir,sessionKey:e.cacheKey,forceDeliveredOnly:!0},p(t.selectedWhatsapp)):(0,g.jsx)(`main`,{})})})}):(0,g.jsx)(o,{auth:e})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(v,{}));
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,_ as n,d as r,f as i,g as a,i as o,p as s,r as c,w as l,x as u}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as d,t as f}from"./AdminShell-DlAVQUda.js";import"./file-download-4mKJxUi-.js";var p=a(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),m=l(),h=e(t(),1),g=u(),_=`maxy-vnc-popout`;function v(){let[e,t]=(0,h.useState)(null),[a,c]=(0,h.useState)(!1),[l,u]=(0,h.useState)(null),d=o(null);(0,h.useEffect)(()=>{let e=!1;return fetch(`/vnc-viewer.html`,{method:`HEAD`}).then(n=>{e||(console.info(`[browser-page] op=viewer-probe available=${n.ok}`),t(n.ok))}).catch(()=>{e||(console.info(`[browser-page] op=viewer-probe available=false`),t(!1))}),()=>{e=!0}},[]);let f=(0,h.useCallback)(()=>{window.open(`/vnc-popout.html?title=${encodeURIComponent(n.productName)}`,_,`width=1024,height=768`)},[]),m=(0,h.useCallback)(async()=>{c(!0),u(null);try{let e=await d(`/api/admin/browser/launch`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Launch failed (${e.status})`)}}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}},[d]);return e===null?(0,g.jsx)(`div`,{className:`vnc-surface`,children:(0,g.jsxs)(`div`,{className:`data-loading`,children:[(0,g.jsx)(r,{size:18,className:`spin`}),` Checking viewer…`]})}):e?(0,g.jsxs)(`div`,{className:`vnc-surface`,children:[(0,g.jsxs)(`div`,{className:`vnc-surface__toolbar`,children:[(0,g.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:m,disabled:a,children:[a?(0,g.jsx)(r,{size:14,className:`spin`}):(0,g.jsx)(i,{size:14}),` Launch browser`]}),(0,g.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:f,children:[(0,g.jsx)(s,{size:14}),` Pop out`]}),l&&(0,g.jsx)(`span`,{className:`vnc-surface__error`,children:l})]}),(0,g.jsx)(`iframe`,{className:`vnc-surface__iframe`,src:`/vnc-viewer.html`,title:`VNC viewer`})]}):(0,g.jsx)(`div`,{className:`vnc-surface`,children:(0,g.jsxs)(`div`,{className:`vnc-surface__unavailable`,children:[(0,g.jsx)(p,{size:20}),(0,g.jsx)(`p`,{children:`VNC surface not available on this platform.`})]})})}function y(){let[e,t]=(0,h.useState)(null),[n,a]=(0,h.useState)(!1),[o,s]=(0,h.useState)(void 0),[l,u]=(0,h.useState)(null),[p,m]=(0,h.useState)(void 0),[_,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),a(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&u(e.sessionId??null),x(e.role??null),m(e.userName===void 0?null:e.userName),y(e.avatar??null)}catch{}t(n),a(!0)}}).catch(()=>{e||(t(n),a(!0))}),()=>{e=!0}},[]);let S=(0,h.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[C,w]=(0,h.useState)(!1),T=(0,h.useCallback)(async()=>{w(!0);try{let e=await d();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{w(!1)}},[]);return n?e?(0,g.jsx)(c,{cacheKey:e,surface:`browser`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=browser`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,g.jsx)(f,{cacheKey:e,businessName:o,sessionId:l,onLogout:S,onDisconnect:T,disconnecting:C,userName:p,userAvatar:_,role:b,children:(0,g.jsxs)(`div`,{className:`data-page`,children:[(0,g.jsx)(`header`,{className:`data-header`,children:(0,g.jsxs)(`h1`,{className:`data-title`,children:[(0,g.jsx)(i,{size:18}),` Browser`]})}),(0,g.jsx)(v,{})]})})}):(0,g.jsxs)(`div`,{className:`data-page`,children:[(0,g.jsx)(`header`,{className:`data-header`,children:(0,g.jsxs)(`h1`,{className:`data-title`,children:[(0,g.jsx)(i,{size:18}),` Browser`]})}),(0,g.jsxs)(`div`,{className:`data-empty`,children:[(0,g.jsx)(`p`,{children:`You are not signed in.`}),(0,g.jsxs)(`p`,{children:[`Open the `,(0,g.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,g.jsx)(`div`,{className:`data-page`,children:(0,g.jsxs)(`div`,{className:`data-loading`,children:[(0,g.jsx)(r,{size:18,className:`spin`}),` Loading…`]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(y,{}));
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,_ as n,d as r,f as i,g as a,i as o,p as s,r as c,w as l,x as u}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as d,t as f}from"./AdminShell-BwEBH6tT.js";import"./file-download-4mKJxUi-.js";var p=a(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]),m=l(),h=e(t(),1),g=u(),_=`maxy-vnc-popout`;function v(){let[e,t]=(0,h.useState)(null),[a,c]=(0,h.useState)(!1),[l,u]=(0,h.useState)(null),d=o(null);(0,h.useEffect)(()=>{let e=!1;return fetch(`/vnc-viewer.html`,{method:`HEAD`}).then(n=>{e||(console.info(`[browser-page] op=viewer-probe available=${n.ok}`),t(n.ok))}).catch(()=>{e||(console.info(`[browser-page] op=viewer-probe available=false`),t(!1))}),()=>{e=!0}},[]);let f=(0,h.useCallback)(()=>{window.open(`/vnc-popout.html?title=${encodeURIComponent(n.productName)}`,_,`width=1024,height=768`)},[]),m=(0,h.useCallback)(async()=>{c(!0),u(null);try{let e=await d(`/api/admin/browser/launch`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||`Launch failed (${e.status})`)}}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}},[d]);return e===null?(0,g.jsx)(`div`,{className:`vnc-surface`,children:(0,g.jsxs)(`div`,{className:`data-loading`,children:[(0,g.jsx)(r,{size:18,className:`spin`}),` Checking viewer…`]})}):e?(0,g.jsxs)(`div`,{className:`vnc-surface`,children:[(0,g.jsxs)(`div`,{className:`vnc-surface__toolbar`,children:[(0,g.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:m,disabled:a,children:[a?(0,g.jsx)(r,{size:14,className:`spin`}):(0,g.jsx)(i,{size:14}),` Launch browser`]}),(0,g.jsxs)(`button`,{type:`button`,className:`vnc-surface__btn`,onClick:f,children:[(0,g.jsx)(s,{size:14}),` Pop out`]}),l&&(0,g.jsx)(`span`,{className:`vnc-surface__error`,children:l})]}),(0,g.jsx)(`iframe`,{className:`vnc-surface__iframe`,src:`/vnc-viewer.html`,title:`VNC viewer`})]}):(0,g.jsx)(`div`,{className:`vnc-surface`,children:(0,g.jsxs)(`div`,{className:`vnc-surface__unavailable`,children:[(0,g.jsx)(p,{size:20}),(0,g.jsx)(`p`,{children:`VNC surface not available on this platform.`})]})})}function y(){let[e,t]=(0,h.useState)(null),[n,a]=(0,h.useState)(!1),[o,s]=(0,h.useState)(void 0),[l,u]=(0,h.useState)(null),[p,m]=(0,h.useState)(void 0),[_,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),a(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&u(e.sessionId??null),x(e.role??null),m(e.userName===void 0?null:e.userName),y(e.avatar??null)}catch{}t(n),a(!0)}}).catch(()=>{e||(t(n),a(!0))}),()=>{e=!0}},[]);let S=(0,h.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[C,w]=(0,h.useState)(!1),T=(0,h.useCallback)(async()=>{w(!0);try{let e=await d();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{w(!1)}},[]);return n?e?(0,g.jsx)(c,{cacheKey:e,surface:`browser`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=browser`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,g.jsx)(f,{cacheKey:e,businessName:o,sessionId:l,onLogout:S,onDisconnect:T,disconnecting:C,userName:p,userAvatar:_,role:b,children:(0,g.jsxs)(`div`,{className:`data-page`,children:[(0,g.jsx)(`header`,{className:`data-header`,children:(0,g.jsxs)(`h1`,{className:`data-title`,children:[(0,g.jsx)(i,{size:18}),` Browser`]})}),(0,g.jsx)(v,{})]})})}):(0,g.jsxs)(`div`,{className:`data-page`,children:[(0,g.jsx)(`header`,{className:`data-header`,children:(0,g.jsxs)(`h1`,{className:`data-title`,children:[(0,g.jsx)(i,{size:18}),` Browser`]})}),(0,g.jsxs)(`div`,{className:`data-empty`,children:[(0,g.jsx)(`p`,{children:`You are not signed in.`}),(0,g.jsxs)(`p`,{children:[`Open the `,(0,g.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,g.jsx)(`div`,{className:`data-page`,children:(0,g.jsxs)(`div`,{className:`data-loading`,children:[(0,g.jsx)(r,{size:18,className:`spin`}),` Loading…`]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,g.jsx)(y,{}));
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Ck5AOu5v.js";import{C as t,E as n,a as r,d as i,g as a,l as o,o as s,p as c,r as l,w as u,x as d}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as f,f as p,t as m}from"./AdminShell-DlAVQUda.js";import{t as h}from"./chevron-left-u4tjq7fI.js";import{m as g}from"./file-download-4mKJxUi-.js";var _=a(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),v=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),y=a(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),b=a(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),x=a(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),ee=a(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),S=u(),C=e(n(),1);function w(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function T(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function E(e){let t=w(e),n=t.getDay();return T(t,n===0?-6:1-n)}function D(e){let t=E(e);return Array.from({length:7},(e,n)=>T(t,n))}function O(e){let t=E(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>T(t,n))}function k(){return Array.from({length:24},(e,t)=>t)}function A(e){let t=e.getFullYear();return Array.from({length:12},(e,n)=>new Date(t,n,1))}function j(e,t){switch(e){case`day`:{let e=w(t);return{from:e,to:T(e,1)}}case`week`:{let e=E(t);return{from:e,to:T(e,7)}}case`month`:{let e=E(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:T(e,42)}}case`year`:return{from:new Date(t.getFullYear(),0,1),to:new Date(t.getFullYear()+1,0,1)}}}function M(e,t,n){switch(e){case`day`:return T(t,n);case`week`:return T(t,n*7);case`month`:return new Date(t.getFullYear(),t.getMonth()+n,1);case`year`:return new Date(t.getFullYear()+n,t.getMonth(),1)}}function N(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function P(e,t){return{role:`button`,tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))}}}var F=d(),I=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],L=3;function R(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function z({anchor:e,meetings:t,onSelect:n}){let r=O(e),i=e.getMonth(),a=new Date;return(0,F.jsxs)(`div`,{className:`cal-month`,children:[(0,F.jsx)(`div`,{className:`cal-weekday-row`,children:I.map(e=>(0,F.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,F.jsx)(`div`,{className:`cal-month-grid`,children:r.map(e=>{let r=t.filter(t=>N(new Date(t.startsAt),e)).sort((e,t)=>e.startsAt.localeCompare(t.startsAt)),o=e.getMonth()!==i,s=N(e,a);return(0,F.jsxs)(`div`,{className:`cal-cell${o?` cal-cell-out`:``}${s?` cal-cell-today`:``}`,children:[(0,F.jsx)(`div`,{className:`cal-cell-num`,children:e.getDate()}),r.slice(0,L).map(e=>(0,F.jsxs)(`div`,{className:`cal-chip`,title:e.title??`Untitled`,...P(e,n),children:[!e.isAllDay&&(0,F.jsx)(`span`,{className:`cal-chip-time`,children:R(new Date(e.startsAt))}),e.title??`Untitled`]},e.meetingId)),r.length>L&&(0,F.jsxs)(`div`,{className:`cal-more`,children:[`+`,r.length-L,` more`]})]},e.toISOString())})})]})}var B=1440,V=1.8;function H(e){return e.getHours()*60+e.getMinutes()}function U(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function W({day:e,meetings:t,hourHeight:n,onSelect:r}){let i=n*24,a=t.filter(t=>!t.isAllDay&&N(new Date(t.startsAt),e));return(0,F.jsx)(`div`,{className:`cal-day-col`,children:(0,F.jsxs)(`div`,{className:`cal-hours`,style:{height:`${i}px`},children:[Array.from({length:24},(e,t)=>(0,F.jsx)(`div`,{className:`cal-hour-line`,style:{top:`${t*n}px`}},t)),a.map(t=>{let n=new Date(t.startsAt),i=t.endsAt?new Date(t.endsAt):new Date(n.getTime()+30*6e4),a=H(n),o=N(i,e)?H(i):B,s=a/B*100,c=Math.max((o-a)/B*100,V);return(0,F.jsxs)(`div`,{className:`cal-event`,style:{top:`${s}%`,height:`${c}%`},title:t.title??`Untitled`,...P(t,r),children:[(0,F.jsx)(`span`,{className:`cal-event-time`,children:U(n)}),(0,F.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var G=44;function K(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function q({anchor:e,meetings:t,onSelect:n}){let r=D(e),i=new Date;return(0,F.jsxs)(`div`,{className:`cal-timed`,children:[(0,F.jsxs)(`div`,{className:`cal-day-headrow`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`}),r.map(e=>(0,F.jsxs)(`div`,{className:`cal-day-head${N(e,i)?` cal-day-head-today`:``}`,children:[(0,F.jsx)(`span`,{className:`cal-day-head-name`,children:e.toLocaleDateString([],{weekday:`short`})}),(0,F.jsx)(`span`,{className:`cal-day-head-num`,children:e.getDate()})]},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:t.filter(t=>t.isAllDay&&N(new Date(t.startsAt),e)).map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${G}px`},children:e===0?``:K(e)},e))}),r.map(e=>(0,F.jsx)(W,{day:e,meetings:t,hourHeight:G,onSelect:n},e.toISOString()))]})]})}var J=52;function Y(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function X({anchor:e,meetings:t,onSelect:n}){let r=t.filter(t=>t.isAllDay&&N(new Date(t.startsAt),e));return(0,F.jsxs)(`div`,{className:`cal-timed cal-timed-single`,children:[(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))})]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${J}px`},children:e===0?``:Y(e)},e))}),(0,F.jsx)(W,{day:e,meetings:t,hourHeight:J,onSelect:n})]})]})}var Z=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function te(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function ne({anchor:e,meetings:t,onPickMonth:n}){let r=new Date,i=new Set(t.map(e=>te(new Date(e.startsAt))));return(0,F.jsx)(`div`,{className:`cal-year`,children:(0,F.jsx)(`div`,{className:`cal-year-grid`,children:A(e).map(e=>{let t=O(e),a=e.getMonth();return(0,F.jsxs)(`button`,{type:`button`,className:`cal-mini`,onClick:()=>n(e),title:e.toLocaleDateString([],{month:`long`,year:`numeric`}),children:[(0,F.jsx)(`div`,{className:`cal-mini-title`,children:e.toLocaleDateString([],{month:`long`})}),(0,F.jsx)(`div`,{className:`cal-mini-weekrow`,children:Z.map((e,t)=>(0,F.jsx)(`span`,{className:`cal-mini-weekday`,children:e},t))}),(0,F.jsx)(`div`,{className:`cal-mini-grid`,children:t.map(e=>{let t=e.getMonth()!==a,n=N(e,r),o=!t&&i.has(te(e));return(0,F.jsxs)(`span`,{className:`cal-mini-day${t?` cal-mini-day-out`:``}${n?` cal-mini-day-today`:``}`,children:[e.getDate(),o&&(0,F.jsx)(`span`,{className:`cal-mini-dot`})]},e.toISOString())})})]},a)})})})}var re={meeting:`Meeting`,event:`Event`,task:`Task`};function ie(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function ae(e){return new Date(e).toISOString()}function Q(e){return Math.floor(new Date(e).getTime()/6e4)}function oe(e){let t=new Date(e.startsAt);if(e.isAllDay)return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});let n=t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});return e.endsAt?`${n} · ${r} – ${new Date(e.endsAt).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`:`${n} · ${r}`}function se(e){if(!e)return null;let t=e.match(/filename="([^"]+)"/);return t?t[1]:null}function ce(e,t){return e.email??`${e.name??`unknown`}-${t}`}function le({a:e}){let t=e.name||e.email||`Unknown`,n=e.name&&e.email?e.email:null;return(0,F.jsxs)(`span`,{className:`cal-attendee-lines`,children:[(0,F.jsx)(`span`,{className:`cal-attendee-name`,children:t}),n&&(0,F.jsx)(`span`,{className:`cal-attendee-email`,children:n})]})}function ue({meeting:e,adminFetch:t,onClose:n,onSaved:a,onDeleted:c}){let l=e.kind===`meeting`,[u,d]=(0,C.useState)(!1),[f,m]=(0,C.useState)(!1),[h,v]=(0,C.useState)(!1),[S,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(null),[D,O]=(0,C.useState)(e),[k,A]=(0,C.useState)(e.title??``),[j,M]=(0,C.useState)(ie(e.startsAt)),[N,P]=(0,C.useState)(e.endsAt?ie(e.endsAt):``),[I,L]=(0,C.useState)(e.location??``),[R,z]=(0,C.useState)(e.privateNote??``),[B,V]=(0,C.useState)(``),[H,U]=(0,C.useState)(``);(0,C.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!S&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[S,n]);let W=(0,C.useCallback)(()=>{let e={},t=k.trim();t!==(D.title??``)&&(e.title=t);let n=ae(j);Q(n)!==Q(D.startsAt)&&(e.startsAt=n);let r=N?ae(N):null;(r===null?D.endsAt!==null:D.endsAt===null||Q(r)!==Q(D.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(D.location??null)&&(e.location=i);let a=R.trim()||null;return a!==(D.privateNote??null)&&(e.privateNote=a),e},[k,j,N,I,R,D]),G=(0,C.useCallback)(async()=>{let n=W();if(Object.keys(n).length===0){d(!1);return}w(!0),E(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();O(i.meeting),a(i.meeting),d(!1)}catch(e){E(e instanceof Error?e.message:`Save failed`)}finally{w(!1)}},[t,W,e.meetingId,a]),K=(0,C.useCallback)(async()=>{let n=B.trim(),r=H.trim();if(!(!n&&!r)){w(!0),E(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n||void 0,email:r||void 0})});if(!i.ok)throw Error(`HTTP ${i.status}`);let o=await i.json();O(o.meeting),a(o.meeting),V(``),U(``)}catch(e){E(e instanceof Error?e.message:`Add failed`)}finally{w(!1)}}},[t,B,H,e.meetingId,a]),q=(0,C.useCallback)(async n=>{let r=n.email?{email:n.email}:{name:n.name};w(!0),E(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.json();O(i.meeting),a(i.meeting)}catch(e){E(e instanceof Error?e.message:`Remove failed`)}finally{w(!1)}},[t,e.meetingId,a]),J=(0,C.useCallback)(async()=>{w(!0),E(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);c(e.meetingId)}catch(e){E(e instanceof Error?e.message:`Delete failed`),w(!1)}},[t,e.meetingId,c]),Y=(0,C.useCallback)(async n=>{v(!1),w(!0),E(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/ics?attendees=${n?`1`:`0`}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.blob(),a=se(r.headers.get(`content-disposition`))??`meeting.ics`,o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=a,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch(e){E(e instanceof Error?e.message:`Download failed`)}finally{w(!1)}},[t,e.meetingId]),X=re[e.kind??`meeting`],Z=B.trim().length>0||H.trim().length>0;return(0,F.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{S||n()},children:(0,F.jsxs)(`div`,{className:`cal-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":u?`Edit meeting`:`Meeting detail`,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,F.jsx)(`span`,{className:`cal-modal-kind`,children:X}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:S,children:(0,F.jsx)(r,{size:16})})]}),!u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsx)(`div`,{className:`cal-modal-title`,children:D.title??`Untitled`}),(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(y,{size:14}),(0,F.jsx)(`span`,{children:oe(D)})]}),D.location&&(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(b,{size:14}),(0,F.jsx)(`span`,{children:D.location})]}),D.attendees.length>0&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(p,{size:14}),(0,F.jsx)(`div`,{className:`cal-modal-attendees`,children:D.attendees.map((e,t)=>(0,F.jsx)(`div`,{className:`cal-attendee-row`,children:(0,F.jsx)(le,{a:e})},ce(e,t)))})]}),D.privateNote&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(x,{size:14}),(0,F.jsx)(`span`,{className:`cal-modal-note`,children:D.privateNote})]}),(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,F.jsx)(_,{size:14}),(0,F.jsx)(`span`,{children:X})]})]}),u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Title`}),(0,F.jsx)(`input`,{type:`text`,value:k,onChange:e=>A(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Start`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:j,onChange:e=>M(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`End`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:N,onChange:e=>P(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Location`}),(0,F.jsx)(`input`,{type:`text`,value:I,onChange:e=>L(e.target.value),disabled:S})]}),(0,F.jsxs)(`div`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Attendees`}),(0,F.jsxs)(`div`,{className:`cal-modal-attendees cal-modal-attendees-edit`,children:[D.attendees.length===0&&(0,F.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),D.attendees.map((e,t)=>(0,F.jsxs)(`div`,{className:`cal-attendee-row cal-attendee-row-edit`,children:[(0,F.jsx)(le,{a:e}),(0,F.jsx)(`button`,{type:`button`,className:`cal-attendee-remove`,onClick:()=>q(e),disabled:S,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,F.jsx)(r,{size:13})})]},ce(e,t)))]}),(0,F.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,F.jsx)(`input`,{type:`text`,placeholder:`Name`,value:B,onChange:e=>V(e.target.value),disabled:S,"aria-label":`Attendee name`}),(0,F.jsx)(`input`,{type:`email`,placeholder:`Email`,value:H,onChange:e=>U(e.target.value),disabled:S,"aria-label":`Attendee email`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:K,disabled:S||!Z,"aria-label":`Add attendee`,children:S?(0,F.jsx)(i,{size:13,className:`spin`}):(0,F.jsx)(ee,{size:13})})]})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Private note`}),(0,F.jsx)(`textarea`,{className:`cal-modal-textarea`,value:R,onChange:e=>z(e.target.value),disabled:S,rows:3,placeholder:`Only you and your team can see this.`})]})]}),T&&(0,F.jsx)(`div`,{className:`cal-modal-error`,children:T}),l&&(0,F.jsxs)(`div`,{className:`cal-modal-actions`,children:[!u&&!f&&!h&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>d(!0),disabled:S,children:[(0,F.jsx)(o,{size:14}),` Edit`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>m(!0),disabled:S,children:[(0,F.jsx)(s,{size:14}),` Delete`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{D.attendees.length>0?v(!0):Y(!1)},disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):(0,F.jsx)(g,{size:14}),` Download`]})]}),h&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Include attendees in the file?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:()=>Y(!0),disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Yes`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>Y(!1),disabled:S,children:`No`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>v(!1),disabled:S,children:`Cancel`})]}),u&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:G,disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Save`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{d(!1),E(null)},disabled:S,children:`Cancel`})]}),f&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this meeting?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:J,disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Delete`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>m(!1),disabled:S,children:`Cancel`})]})]})]})})}var $=`maxy-admin-session-key`,de=[`day`,`week`,`month`,`year`];function fe(e,t){switch(e){case`day`:return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});case`week`:{let{from:e,to:n}=j(`week`,t),r=new Date(n.getTime()-1);return`${e.toLocaleDateString([],{day:`numeric`,month:`short`})} – ${r.toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})}`}case`month`:return t.toLocaleDateString([],{month:`long`,year:`numeric`});case`year`:return String(t.getFullYear())}}function pe(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!1),[a,o]=(0,C.useState)(void 0),[s,c]=(0,C.useState)(null),[u,d]=(0,C.useState)(void 0),[p,h]=(0,C.useState)(null),[g,_]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem($)}catch{}if(!n){r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),d(e.userName===void 0?null:e.userName),h(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let v=(0,C.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,C.useState)(!1),x=(0,C.useCallback)(async()=>{b(!0);try{let e=await f();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return n?e?(0,F.jsx)(l,{cacheKey:e,surface:`calendar`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=calendar`);try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},children:(0,F.jsx)(m,{cacheKey:e,businessName:a,sessionId:s,onLogout:v,onDisconnect:x,disconnecting:y,userName:u,userAvatar:p,role:g,children:(0,F.jsx)(me,{cacheKey:e})})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-empty`,children:[(0,F.jsx)(`p`,{children:`You are not signed in.`}),(0,F.jsxs)(`p`,{children:[`Open the `,(0,F.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-loading`,children:[(0,F.jsx)(i,{size:18,className:`spin`}),` Loading…`]})})}function me({cacheKey:e}){let{adminFetch:n,sessionRefetchNonce:r}=t({initialCacheKey:e,surface:`calendar`}),[a,o]=(0,C.useState)(`month`),[s,l]=(0,C.useState)(()=>new Date),[u,d]=(0,C.useState)([]),[f,p]=(0,C.useState)(!1),[m,g]=(0,C.useState)(null),[y,b]=(0,C.useState)(null),[x,ee]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1;return n(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&ee(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[n]),(0,C.useEffect)(()=>{let e=!1,{from:t,to:r}=j(a,s);return p(!0),g(null),n(`/api/admin/calendar/meetings?from=${encodeURIComponent(t.toISOString())}&to=${encodeURIComponent(r.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();d(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(g(t instanceof Error?t.message:`Failed to load`),d([]))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[a,s,r,n]);let S=(0,C.useCallback)(()=>l(new Date),[]),w=(0,C.useCallback)(()=>l(e=>M(a,e,-1)),[a]),T=(0,C.useCallback)(()=>l(e=>M(a,e,1)),[a]),E=(0,C.useCallback)(e=>{l(e),o(`month`)},[]);(0,C.useEffect)(()=>{b(null)},[a,s]);let D=(0,C.useCallback)(e=>{d(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),b(e)},[]),O=(0,C.useCallback)(e=>{d(t=>t.filter(t=>t.meetingId!==e)),b(null)},[]);return(0,F.jsxs)(`div`,{className:`cal-page`,children:[(0,F.jsxs)(`header`,{className:`cal-header`,children:[(0,F.jsxs)(`div`,{className:`cal-title`,children:[(0,F.jsx)(_,{size:20}),` Calendar`]}),(0,F.jsxs)(`div`,{className:`cal-nav`,children:[(0,F.jsx)(`button`,{type:`button`,className:`cal-today-btn`,onClick:S,children:`Today`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:w,"aria-label":`Previous`,children:(0,F.jsx)(h,{size:18})}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:T,"aria-label":`Next`,children:(0,F.jsx)(v,{size:18})}),(0,F.jsx)(`span`,{className:`cal-range-label`,children:fe(a,s)}),f&&(0,F.jsx)(i,{size:16,className:`spin`})]}),(0,F.jsx)(`div`,{className:`cal-views`,children:de.map(e=>(0,F.jsx)(`button`,{type:`button`,className:`cal-view-btn${e===a?` cal-view-btn-active`:``}`,onClick:()=>o(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),x&&(0,F.jsxs)(`a`,{className:`cal-booking-link`,href:`https://${x}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(c,{size:14}),` Booking page`]})]}),(0,F.jsxs)(`div`,{className:`cal-body`,children:[m&&(0,F.jsxs)(`div`,{className:`cal-error`,children:[`Could not load the calendar: `,m]}),a===`day`&&(0,F.jsx)(X,{anchor:s,meetings:u,onSelect:b}),a===`week`&&(0,F.jsx)(q,{anchor:s,meetings:u,onSelect:b}),a===`month`&&(0,F.jsx)(z,{anchor:s,meetings:u,onSelect:b}),a===`year`&&(0,F.jsx)(ne,{anchor:s,meetings:u,onPickMonth:E})]}),y&&(0,F.jsx)(ue,{meeting:y,adminFetch:n,onClose:()=>b(null),onSaved:D,onDeleted:O})]})}(0,S.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(pe,{}));
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{C as t,E as n,a as r,d as i,g as a,l as o,o as s,p as c,r as l,w as u,x as d}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as f,f as p,t as m}from"./AdminShell-BwEBH6tT.js";import{t as h}from"./chevron-left-u4tjq7fI.js";import{m as g}from"./file-download-4mKJxUi-.js";var _=a(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),v=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),y=a(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),b=a(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),x=a(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),ee=a(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),S=u(),C=e(n(),1);function w(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function T(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function E(e){let t=w(e),n=t.getDay();return T(t,n===0?-6:1-n)}function D(e){let t=E(e);return Array.from({length:7},(e,n)=>T(t,n))}function O(e){let t=E(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>T(t,n))}function k(){return Array.from({length:24},(e,t)=>t)}function A(e){let t=e.getFullYear();return Array.from({length:12},(e,n)=>new Date(t,n,1))}function j(e,t){switch(e){case`day`:{let e=w(t);return{from:e,to:T(e,1)}}case`week`:{let e=E(t);return{from:e,to:T(e,7)}}case`month`:{let e=E(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:T(e,42)}}case`year`:return{from:new Date(t.getFullYear(),0,1),to:new Date(t.getFullYear()+1,0,1)}}}function M(e,t,n){switch(e){case`day`:return T(t,n);case`week`:return T(t,n*7);case`month`:return new Date(t.getFullYear(),t.getMonth()+n,1);case`year`:return new Date(t.getFullYear()+n,t.getMonth(),1)}}function N(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function P(e,t){return{role:`button`,tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e))}}}var F=d(),I=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],L=3;function R(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function z({anchor:e,meetings:t,onSelect:n}){let r=O(e),i=e.getMonth(),a=new Date;return(0,F.jsxs)(`div`,{className:`cal-month`,children:[(0,F.jsx)(`div`,{className:`cal-weekday-row`,children:I.map(e=>(0,F.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,F.jsx)(`div`,{className:`cal-month-grid`,children:r.map(e=>{let r=t.filter(t=>N(new Date(t.startsAt),e)).sort((e,t)=>e.startsAt.localeCompare(t.startsAt)),o=e.getMonth()!==i,s=N(e,a);return(0,F.jsxs)(`div`,{className:`cal-cell${o?` cal-cell-out`:``}${s?` cal-cell-today`:``}`,children:[(0,F.jsx)(`div`,{className:`cal-cell-num`,children:e.getDate()}),r.slice(0,L).map(e=>(0,F.jsxs)(`div`,{className:`cal-chip`,title:e.title??`Untitled`,...P(e,n),children:[!e.isAllDay&&(0,F.jsx)(`span`,{className:`cal-chip-time`,children:R(new Date(e.startsAt))}),e.title??`Untitled`]},e.meetingId)),r.length>L&&(0,F.jsxs)(`div`,{className:`cal-more`,children:[`+`,r.length-L,` more`]})]},e.toISOString())})})]})}var B=1440,V=1.8;function H(e){return e.getHours()*60+e.getMinutes()}function U(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function W({day:e,meetings:t,hourHeight:n,onSelect:r}){let i=n*24,a=t.filter(t=>!t.isAllDay&&N(new Date(t.startsAt),e));return(0,F.jsx)(`div`,{className:`cal-day-col`,children:(0,F.jsxs)(`div`,{className:`cal-hours`,style:{height:`${i}px`},children:[Array.from({length:24},(e,t)=>(0,F.jsx)(`div`,{className:`cal-hour-line`,style:{top:`${t*n}px`}},t)),a.map(t=>{let n=new Date(t.startsAt),i=t.endsAt?new Date(t.endsAt):new Date(n.getTime()+30*6e4),a=H(n),o=N(i,e)?H(i):B,s=a/B*100,c=Math.max((o-a)/B*100,V);return(0,F.jsxs)(`div`,{className:`cal-event`,style:{top:`${s}%`,height:`${c}%`},title:t.title??`Untitled`,...P(t,r),children:[(0,F.jsx)(`span`,{className:`cal-event-time`,children:U(n)}),(0,F.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var G=44;function K(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function q({anchor:e,meetings:t,onSelect:n}){let r=D(e),i=new Date;return(0,F.jsxs)(`div`,{className:`cal-timed`,children:[(0,F.jsxs)(`div`,{className:`cal-day-headrow`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`}),r.map(e=>(0,F.jsxs)(`div`,{className:`cal-day-head${N(e,i)?` cal-day-head-today`:``}`,children:[(0,F.jsx)(`span`,{className:`cal-day-head-name`,children:e.toLocaleDateString([],{weekday:`short`})}),(0,F.jsx)(`span`,{className:`cal-day-head-num`,children:e.getDate()})]},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:t.filter(t=>t.isAllDay&&N(new Date(t.startsAt),e)).map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))},e.toISOString()))]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${G}px`},children:e===0?``:K(e)},e))}),r.map(e=>(0,F.jsx)(W,{day:e,meetings:t,hourHeight:G,onSelect:n},e.toISOString()))]})]})}var J=52;function Y(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function X({anchor:e,meetings:t,onSelect:n}){let r=t.filter(t=>t.isAllDay&&N(new Date(t.startsAt),e));return(0,F.jsxs)(`div`,{className:`cal-timed cal-timed-single`,children:[(0,F.jsxs)(`div`,{className:`cal-allday-band`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:`All-day`}),(0,F.jsx)(`div`,{className:`cal-allday-cell`,children:r.map(e=>(0,F.jsx)(`div`,{className:`cal-allday-chip`,title:e.title??`Untitled`,...P(e,n),children:e.title??`Untitled`},e.meetingId))})]}),(0,F.jsxs)(`div`,{className:`cal-timed-cols`,children:[(0,F.jsx)(`div`,{className:`cal-timed-gutter`,children:k().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${J}px`},children:e===0?``:Y(e)},e))}),(0,F.jsx)(W,{day:e,meetings:t,hourHeight:J,onSelect:n})]})]})}var Z=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function te(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function ne({anchor:e,meetings:t,onPickMonth:n}){let r=new Date,i=new Set(t.map(e=>te(new Date(e.startsAt))));return(0,F.jsx)(`div`,{className:`cal-year`,children:(0,F.jsx)(`div`,{className:`cal-year-grid`,children:A(e).map(e=>{let t=O(e),a=e.getMonth();return(0,F.jsxs)(`button`,{type:`button`,className:`cal-mini`,onClick:()=>n(e),title:e.toLocaleDateString([],{month:`long`,year:`numeric`}),children:[(0,F.jsx)(`div`,{className:`cal-mini-title`,children:e.toLocaleDateString([],{month:`long`})}),(0,F.jsx)(`div`,{className:`cal-mini-weekrow`,children:Z.map((e,t)=>(0,F.jsx)(`span`,{className:`cal-mini-weekday`,children:e},t))}),(0,F.jsx)(`div`,{className:`cal-mini-grid`,children:t.map(e=>{let t=e.getMonth()!==a,n=N(e,r),o=!t&&i.has(te(e));return(0,F.jsxs)(`span`,{className:`cal-mini-day${t?` cal-mini-day-out`:``}${n?` cal-mini-day-today`:``}`,children:[e.getDate(),o&&(0,F.jsx)(`span`,{className:`cal-mini-dot`})]},e.toISOString())})})]},a)})})})}var re={meeting:`Meeting`,event:`Event`,task:`Task`};function ie(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function ae(e){return new Date(e).toISOString()}function Q(e){return Math.floor(new Date(e).getTime()/6e4)}function oe(e){let t=new Date(e.startsAt);if(e.isAllDay)return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});let n=t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`});return e.endsAt?`${n} · ${r} – ${new Date(e.endsAt).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`:`${n} · ${r}`}function se(e){if(!e)return null;let t=e.match(/filename="([^"]+)"/);return t?t[1]:null}function ce(e,t){return e.email??`${e.name??`unknown`}-${t}`}function le({a:e}){let t=e.name||e.email||`Unknown`,n=e.name&&e.email?e.email:null;return(0,F.jsxs)(`span`,{className:`cal-attendee-lines`,children:[(0,F.jsx)(`span`,{className:`cal-attendee-name`,children:t}),n&&(0,F.jsx)(`span`,{className:`cal-attendee-email`,children:n})]})}function ue({meeting:e,adminFetch:t,onClose:n,onSaved:a,onDeleted:c}){let l=e.kind===`meeting`,[u,d]=(0,C.useState)(!1),[f,m]=(0,C.useState)(!1),[h,v]=(0,C.useState)(!1),[S,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(null),[D,O]=(0,C.useState)(e),[k,A]=(0,C.useState)(e.title??``),[j,M]=(0,C.useState)(ie(e.startsAt)),[N,P]=(0,C.useState)(e.endsAt?ie(e.endsAt):``),[I,L]=(0,C.useState)(e.location??``),[R,z]=(0,C.useState)(e.privateNote??``),[B,V]=(0,C.useState)(``),[H,U]=(0,C.useState)(``);(0,C.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!S&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[S,n]);let W=(0,C.useCallback)(()=>{let e={},t=k.trim();t!==(D.title??``)&&(e.title=t);let n=ae(j);Q(n)!==Q(D.startsAt)&&(e.startsAt=n);let r=N?ae(N):null;(r===null?D.endsAt!==null:D.endsAt===null||Q(r)!==Q(D.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(D.location??null)&&(e.location=i);let a=R.trim()||null;return a!==(D.privateNote??null)&&(e.privateNote=a),e},[k,j,N,I,R,D]),G=(0,C.useCallback)(async()=>{let n=W();if(Object.keys(n).length===0){d(!1);return}w(!0),E(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();O(i.meeting),a(i.meeting),d(!1)}catch(e){E(e instanceof Error?e.message:`Save failed`)}finally{w(!1)}},[t,W,e.meetingId,a]),K=(0,C.useCallback)(async()=>{let n=B.trim(),r=H.trim();if(!(!n&&!r)){w(!0),E(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n||void 0,email:r||void 0})});if(!i.ok)throw Error(`HTTP ${i.status}`);let o=await i.json();O(o.meeting),a(o.meeting),V(``),U(``)}catch(e){E(e instanceof Error?e.message:`Add failed`)}finally{w(!1)}}},[t,B,H,e.meetingId,a]),q=(0,C.useCallback)(async n=>{let r=n.email?{email:n.email}:{name:n.name};w(!0),E(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.json();O(i.meeting),a(i.meeting)}catch(e){E(e instanceof Error?e.message:`Remove failed`)}finally{w(!1)}},[t,e.meetingId,a]),J=(0,C.useCallback)(async()=>{w(!0),E(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);c(e.meetingId)}catch(e){E(e instanceof Error?e.message:`Delete failed`),w(!1)}},[t,e.meetingId,c]),Y=(0,C.useCallback)(async n=>{v(!1),w(!0),E(null);try{let r=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/ics?attendees=${n?`1`:`0`}`);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.blob(),a=se(r.headers.get(`content-disposition`))??`meeting.ics`,o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=a,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o)}catch(e){E(e instanceof Error?e.message:`Download failed`)}finally{w(!1)}},[t,e.meetingId]),X=re[e.kind??`meeting`],Z=B.trim().length>0||H.trim().length>0;return(0,F.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{S||n()},children:(0,F.jsxs)(`div`,{className:`cal-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":u?`Edit meeting`:`Meeting detail`,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`div`,{className:`cal-modal-header`,children:[(0,F.jsx)(`span`,{className:`cal-modal-kind`,children:X}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:S,children:(0,F.jsx)(r,{size:16})})]}),!u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsx)(`div`,{className:`cal-modal-title`,children:D.title??`Untitled`}),(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(y,{size:14}),(0,F.jsx)(`span`,{children:oe(D)})]}),D.location&&(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(b,{size:14}),(0,F.jsx)(`span`,{children:D.location})]}),D.attendees.length>0&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(p,{size:14}),(0,F.jsx)(`div`,{className:`cal-modal-attendees`,children:D.attendees.map((e,t)=>(0,F.jsx)(`div`,{className:`cal-attendee-row`,children:(0,F.jsx)(le,{a:e})},ce(e,t)))})]}),D.privateNote&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(x,{size:14}),(0,F.jsx)(`span`,{className:`cal-modal-note`,children:D.privateNote})]}),(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,F.jsx)(_,{size:14}),(0,F.jsx)(`span`,{children:X})]})]}),u&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Title`}),(0,F.jsx)(`input`,{type:`text`,value:k,onChange:e=>A(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Start`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:j,onChange:e=>M(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`End`}),(0,F.jsx)(`input`,{type:`datetime-local`,value:N,onChange:e=>P(e.target.value),disabled:S})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Location`}),(0,F.jsx)(`input`,{type:`text`,value:I,onChange:e=>L(e.target.value),disabled:S})]}),(0,F.jsxs)(`div`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Attendees`}),(0,F.jsxs)(`div`,{className:`cal-modal-attendees cal-modal-attendees-edit`,children:[D.attendees.length===0&&(0,F.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),D.attendees.map((e,t)=>(0,F.jsxs)(`div`,{className:`cal-attendee-row cal-attendee-row-edit`,children:[(0,F.jsx)(le,{a:e}),(0,F.jsx)(`button`,{type:`button`,className:`cal-attendee-remove`,onClick:()=>q(e),disabled:S,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,F.jsx)(r,{size:13})})]},ce(e,t)))]}),(0,F.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,F.jsx)(`input`,{type:`text`,placeholder:`Name`,value:B,onChange:e=>V(e.target.value),disabled:S,"aria-label":`Attendee name`}),(0,F.jsx)(`input`,{type:`email`,placeholder:`Email`,value:H,onChange:e=>U(e.target.value),disabled:S,"aria-label":`Attendee email`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:K,disabled:S||!Z,"aria-label":`Add attendee`,children:S?(0,F.jsx)(i,{size:13,className:`spin`}):(0,F.jsx)(ee,{size:13})})]})]}),(0,F.jsxs)(`label`,{className:`cal-modal-field`,children:[(0,F.jsx)(`span`,{children:`Private note`}),(0,F.jsx)(`textarea`,{className:`cal-modal-textarea`,value:R,onChange:e=>z(e.target.value),disabled:S,rows:3,placeholder:`Only you and your team can see this.`})]})]}),T&&(0,F.jsx)(`div`,{className:`cal-modal-error`,children:T}),l&&(0,F.jsxs)(`div`,{className:`cal-modal-actions`,children:[!u&&!f&&!h&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>d(!0),disabled:S,children:[(0,F.jsx)(o,{size:14}),` Edit`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>m(!0),disabled:S,children:[(0,F.jsx)(s,{size:14}),` Delete`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{D.attendees.length>0?v(!0):Y(!1)},disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):(0,F.jsx)(g,{size:14}),` Download`]})]}),h&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Include attendees in the file?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:()=>Y(!0),disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Yes`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>Y(!1),disabled:S,children:`No`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>v(!1),disabled:S,children:`Cancel`})]}),u&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:G,disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Save`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{d(!1),E(null)},disabled:S,children:`Cancel`})]}),f&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`cal-modal-confirm-text`,children:`Delete this meeting?`}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:J,disabled:S,children:[S?(0,F.jsx)(i,{size:14,className:`spin`}):null,` Delete`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>m(!1),disabled:S,children:`Cancel`})]})]})]})})}var $=`maxy-admin-session-key`,de=[`day`,`week`,`month`,`year`];function fe(e,t){switch(e){case`day`:return t.toLocaleDateString([],{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});case`week`:{let{from:e,to:n}=j(`week`,t),r=new Date(n.getTime()-1);return`${e.toLocaleDateString([],{day:`numeric`,month:`short`})} – ${r.toLocaleDateString([],{day:`numeric`,month:`short`,year:`numeric`})}`}case`month`:return t.toLocaleDateString([],{month:`long`,year:`numeric`});case`year`:return String(t.getFullYear())}}function pe(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!1),[a,o]=(0,C.useState)(void 0),[s,c]=(0,C.useState)(null),[u,d]=(0,C.useState)(void 0),[p,h]=(0,C.useState)(null),[g,_]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem($)}catch{}if(!n){r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),d(e.userName===void 0?null:e.userName),h(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let v=(0,C.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,C.useState)(!1),x=(0,C.useCallback)(async()=>{b(!0);try{let e=await f();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return n?e?(0,F.jsx)(l,{cacheKey:e,surface:`calendar`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=calendar`);try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},children:(0,F.jsx)(m,{cacheKey:e,businessName:a,sessionId:s,onLogout:v,onDisconnect:x,disconnecting:y,userName:u,userAvatar:p,role:g,children:(0,F.jsx)(me,{cacheKey:e})})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-empty`,children:[(0,F.jsx)(`p`,{children:`You are not signed in.`}),(0,F.jsxs)(`p`,{children:[`Open the `,(0,F.jsx)(`a`,{href:`/`,className:`cal-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,F.jsx)(`div`,{className:`cal-page`,children:(0,F.jsxs)(`div`,{className:`cal-loading`,children:[(0,F.jsx)(i,{size:18,className:`spin`}),` Loading…`]})})}function me({cacheKey:e}){let{adminFetch:n,sessionRefetchNonce:r}=t({initialCacheKey:e,surface:`calendar`}),[a,o]=(0,C.useState)(`month`),[s,l]=(0,C.useState)(()=>new Date),[u,d]=(0,C.useState)([]),[f,p]=(0,C.useState)(!1),[m,g]=(0,C.useState)(null),[y,b]=(0,C.useState)(null),[x,ee]=(0,C.useState)(null);(0,C.useEffect)(()=>{let e=!1;return n(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&ee(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[n]),(0,C.useEffect)(()=>{let e=!1,{from:t,to:r}=j(a,s);return p(!0),g(null),n(`/api/admin/calendar/meetings?from=${encodeURIComponent(t.toISOString())}&to=${encodeURIComponent(r.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();d(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(g(t instanceof Error?t.message:`Failed to load`),d([]))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[a,s,r,n]);let S=(0,C.useCallback)(()=>l(new Date),[]),w=(0,C.useCallback)(()=>l(e=>M(a,e,-1)),[a]),T=(0,C.useCallback)(()=>l(e=>M(a,e,1)),[a]),E=(0,C.useCallback)(e=>{l(e),o(`month`)},[]);(0,C.useEffect)(()=>{b(null)},[a,s]);let D=(0,C.useCallback)(e=>{d(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),b(e)},[]),O=(0,C.useCallback)(e=>{d(t=>t.filter(t=>t.meetingId!==e)),b(null)},[]);return(0,F.jsxs)(`div`,{className:`cal-page`,children:[(0,F.jsxs)(`header`,{className:`cal-header`,children:[(0,F.jsxs)(`div`,{className:`cal-title`,children:[(0,F.jsx)(_,{size:20}),` Calendar`]}),(0,F.jsxs)(`div`,{className:`cal-nav`,children:[(0,F.jsx)(`button`,{type:`button`,className:`cal-today-btn`,onClick:S,children:`Today`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:w,"aria-label":`Previous`,children:(0,F.jsx)(h,{size:18})}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:T,"aria-label":`Next`,children:(0,F.jsx)(v,{size:18})}),(0,F.jsx)(`span`,{className:`cal-range-label`,children:fe(a,s)}),f&&(0,F.jsx)(i,{size:16,className:`spin`})]}),(0,F.jsx)(`div`,{className:`cal-views`,children:de.map(e=>(0,F.jsx)(`button`,{type:`button`,className:`cal-view-btn${e===a?` cal-view-btn-active`:``}`,onClick:()=>o(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),x&&(0,F.jsxs)(`a`,{className:`cal-booking-link`,href:`https://${x}`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,F.jsx)(c,{size:14}),` Booking page`]})]}),(0,F.jsxs)(`div`,{className:`cal-body`,children:[m&&(0,F.jsxs)(`div`,{className:`cal-error`,children:[`Could not load the calendar: `,m]}),a===`day`&&(0,F.jsx)(X,{anchor:s,meetings:u,onSelect:b}),a===`week`&&(0,F.jsx)(q,{anchor:s,meetings:u,onSelect:b}),a===`month`&&(0,F.jsx)(z,{anchor:s,meetings:u,onSelect:b}),a===`year`&&(0,F.jsx)(ne,{anchor:s,meetings:u,onPickMonth:E})]}),y&&(0,F.jsx)(ue,{meeting:y,adminFetch:n,onClose:()=>b(null),onSaved:D,onDeleted:O})]})}(0,S.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(pe,{}));
@@ -0,0 +1 @@
1
+ import{w as e,x as t}from"./useSubAccountSwitcher-DLJFISqf.js";import"./useVoiceRecorder-b7HzTFs0.js";import"./AdminShell-BwEBH6tT.js";import{n}from"./page-DMeJHVfA.js";import"./useCopyFeedback-DHoYHiK9.js";import"./file-download-4mKJxUi-.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -0,0 +1 @@
1
+ import{w as e,x as t}from"./useSubAccountSwitcher-DLJFISqf.js";import"./useVoiceRecorder-b7HzTFs0.js";import{t as n}from"./page-DEkI-Gl1.js";import"./file-download-4mKJxUi-.js";import"./graph-labels-B8YAdo3Z.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-Ck5AOu5v.js";import{C as n,E as r,a as i,c as a,d as o,g as s,h as c,o as l,r as u,w as d,x as f}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as p,n as m,p as h,t as g}from"./AdminShell-DlAVQUda.js";import{t as _}from"./Checkbox-B629mOPp.js";import{t as v}from"./chevron-left-u4tjq7fI.js";import{n as y,t as b}from"./useCopyFeedback-CSk9KjhY.js";import{d as x,f as S}from"./file-download-4mKJxUi-.js";import{t as ee}from"./maximize-2-CxstTgoK.js";import{t as C}from"./rotate-ccw-COGQTi7n.js";import{i as te,n as w,r as ne}from"./graph-labels-B8YAdo3Z.js";var T=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),E=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),D=s(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),O=s(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),k=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},j={}.propertyIsEnumerable,oe=Object.getOwnPropertyDescriptor;ae.f=oe&&!j.call({1:2},1)?function(e){var t=oe(this,e);return!!t&&t.enumerable}:j;var se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},ce=v,le=s,ue=S,de=Object,fe=ce(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},P={},Ce=P,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,L=Object,Ke=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,L(e))},qe=String,Je=function(e){try{return qe(e)}catch{return`Object`}},Ye=D,Xe=Je,Ze=TypeError,Qe=function(e){if(Ye(e))return e;throw new Ze(Xe(e)+` is not a function`)},$e=Qe,et=me,tt=function(e,t){var n=e[t];return et(n)?void 0:$e(n)},nt=A,rt=D,it=N,at=TypeError,ot=function(e,t){var n,r;if(t===`string`&&rt(n=e.toString)&&!it(r=nt(n,e))||rt(n=e.valueOf)&&!it(r=nt(n,e))||t!==`string`&&rt(n=e.toString)&&!it(r=nt(n,e)))return r;throw new at(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=N,Ht=Ke,Ut=tt,Wt=ot,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=Ke,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=N,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=se,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=Qe,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=N,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=se,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=P,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=P.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=se,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=N,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=N,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=P,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=N,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=se,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=Ke,wc=Je,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=Ke,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=P.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=N,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=se,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=Qe,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=Ke,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=Qe,Xd=N,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=P,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=Qe,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=Qe,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=tt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=tt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=Qe,Ip=Fn,Lp=Je,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=P.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=P.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(km(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var jm=B,Mm=hr,Nm=oi,Pm=N,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as e,t}from"./chunk-Ck5AOu5v.js";import{C as n,E as r,a as i,c as a,d as o,g as s,h as c,o as l,r as u,w as d,x as f}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as p,n as m,p as h,t as g}from"./AdminShell-BwEBH6tT.js";import{t as _}from"./Checkbox-B629mOPp.js";import{t as v}from"./chevron-left-u4tjq7fI.js";import{n as y,t as b}from"./useCopyFeedback-DHoYHiK9.js";import{d as x,f as S}from"./file-download-4mKJxUi-.js";import{t as ee}from"./maximize-2-CxstTgoK.js";import{t as C}from"./rotate-ccw-COGQTi7n.js";import{i as te,n as w,r as ne}from"./graph-labels-B8YAdo3Z.js";var T=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),E=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),D=s(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),O=s(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),k=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},j={}.propertyIsEnumerable,oe=Object.getOwnPropertyDescriptor;ae.f=oe&&!j.call({1:2},1)?function(e){var t=oe(this,e);return!!t&&t.enumerable}:j;var se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},ce=v,le=s,ue=S,de=Object,fe=ce(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},P={},Ce=P,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,L=Object,Ke=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,L(e))},qe=String,Je=function(e){try{return qe(e)}catch{return`Object`}},Ye=D,Xe=Je,Ze=TypeError,Qe=function(e){if(Ye(e))return e;throw new Ze(Xe(e)+` is not a function`)},$e=Qe,et=me,tt=function(e,t){var n=e[t];return et(n)?void 0:$e(n)},nt=A,rt=D,it=N,at=TypeError,ot=function(e,t){var n,r;if(t===`string`&&rt(n=e.toString)&&!it(r=nt(n,e))||rt(n=e.valueOf)&&!it(r=nt(n,e))||t!==`string`&&rt(n=e.toString)&&!it(r=nt(n,e)))return r;throw new at(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=N,Ht=Ke,Ut=tt,Wt=ot,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=Ke,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=N,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=se,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=Qe,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=N,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=se,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=P,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=P.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=se,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=N,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=N,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=P,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=N,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=se,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=Ke,wc=Je,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=Ke,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=P.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=N,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=se,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=Qe,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=Ke,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=Qe,Xd=N,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=P,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=Qe,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=Qe,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=tt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=tt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=Qe,Ip=Fn,Lp=Je,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=P.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=P.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(km(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var jm=B,Mm=hr,Nm=oi,Pm=N,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rh(e,t){return pm(e)||Am(e,t)||th(e,t)||nh()}function ih(e){if(fm(e))return eh(e)}function ah(e){if(xd!==void 0&&lm(e)!=null||e[`@@iterator`]!=null)return $m(e)}function oh(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sh(e){return ih(e)||ah(e)||th(e)||oh()}var ch=r(qu),lh=df(`Array`,`concat`),uh=Ee,dh=lh,fh=Array.prototype,ph=r(function(e){var t=e.concat;return e===fh||uh(fh,e)&&t===fh.concat?dh:t}),mh=r(Xm),hh=I,gh=v,_h=Fa,vh=Za,yh=Fn,bh=gh([].concat),xh=hh(`Reflect`,`ownKeys`)||function(e){var t=_h.f(yh(e)),n=vh.f;return n?bh(t,n(e)):t};B({target:`Reflect`,stat:!0},{ownKeys:xh});var Sh=P.Reflect.ownKeys,Ch=r(Sh),wh=r(dm),Th=B,Eh=bt,Dh=ia;Th({target:`Object`,stat:!0,forced:s(function(){Dh(1)})},{keys:function(e){return Dh(Eh(e))}});var Oh=P.Object.keys,kh=r(Oh),Ah=es.forEach,jh=Tf(`forEach`)?[].forEach:function(e){return Ah(this,e,arguments.length>1?arguments[1]:void 0)},Mh=B,Nh=jh;Mh({target:`Array`,proto:!0,forced:[].forEach!==Nh},{forEach:Nh});var Ph=df(`Array`,`forEach`),Fh=Vr,Ih=wt,Lh=Ee,Rh=Ph,zh=Array.prototype,Bh={DOMTokenList:!0,NodeList:!0},Vh=function(e){var t=e.forEach;return e===zh||Lh(zh,e)&&t===zh.forEach||Ih(Bh,Fh(e))?Rh:t},Hh=r(Vh),Uh=B,Wh=v,Gh=hr,Kh=Wh([].reverse),qh=[1,2];Uh({target:`Array`,proto:!0,forced:String(qh)===String(qh.reverse())},{reverse:function(){return Gh(this)&&(this.length=this.length),Kh(this)}});var Jh=df(`Array`,`reverse`),Yh=Ee,Xh=Jh,Zh=Array.prototype,Qh=function(e){var t=e.reverse;return e===Zh||Yh(Zh,e)&&t===Zh.reverse?Xh:t},$h=r(Qh),eg=Je,tg=TypeError,ng=function(e,t){if(!delete e[t])throw new tg(`Cannot delete property `+eg(t)+` of `+eg(e))},rg=B,ig=bt,ag=Vi,og=yr,sg=Cr,cg=vm,lg=Er,ug=pi,dg=Ar,fg=ng,pg=vi(`splice`),mg=Math.max,hg=Math.min;rg({target:`Array`,proto:!0,forced:!pg},{splice:function(e,t){var n=ig(this),r=sg(n),i=ag(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=hg(mg(og(t),0),r-i)),lg(r+o-s),c=ug(n,s),l=0;l<s;l++)u=i+l,u in n&&dg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:fg(n,d);for(l=r;l>r-s+o;l--)fg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:fg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return cg(n,r-s+o),c}});var gg=df(`Array`,`splice`),_g=Ee,vg=gg,yg=Array.prototype,bg=r(function(e){var t=e.splice;return e===yg||_g(yg,e)&&t===yg.splice?vg:t}),xg=k,Sg=v,Cg=A,wg=s,Tg=ia,Eg=Za,Dg=ae,Og=bt,kg=pe,Ag=Object.assign,jg=Object.defineProperty,Mg=Sg([].concat),Ng=!Ag||wg(function(){if(xg&&Ag({b:1},Ag(jg({},`a`,{enumerable:!0,get:function(){jg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),Ag({},e)[n]!==7||Tg(Ag({},t)).join(``)!==r})?function(e,t){for(var n=Og(e),r=arguments.length,i=1,a=Eg.f,o=Dg.f;r>i;)for(var s=kg(arguments[i++]),c=a?Mg(Tg(s),a(s)):Tg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!xg||Cg(o,s,d))&&(n[d]=s[d]);return n}:Ag,Pg=B,Fg=Ng;Pg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Fg},{assign:Fg});var Ig=P.Object.assign,Lg=r(Ig),Rg=B,zg=s,Bg=bt,Vg=Pl,Hg=Tl;Rg({target:`Object`,stat:!0,forced:zg(function(){Vg(1)}),sham:!Hg},{getPrototypeOf:function(e){return Vg(Bg(e))}});var Ug=P.Object.getPrototypeOf;B({target:`Object`,stat:!0,sham:!k},{create:Pa});var Wg=P.Object,Gg=function(e,t){return Wg.create(e,t)},Kg=r(Gg),qg=P,Jg=p;qg.JSON||={stringify:JSON.stringify};var Yg=r(function(e,t,n){return Jg(qg.JSON.stringify,null,arguments)}),Xg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Zg=TypeError,Qg=function(e,t){if(e<t)throw new Zg(`Not enough arguments`);return e},$g=o,e_=p,t_=D,n_=Xg,r_=De,i_=Oc,a_=Qg,o_=$g.Function,s_=/MSIE .\./.test(r_)||n_&&(function(){var e=$g.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),c_=function(e,t){var n=t?2:1;return s_?function(r,i){var a=a_(arguments.length,1)>n,o=t_(r)?r:o_(r),s=a?i_(arguments,n):[],c=a?function(){e_(o,this,s)}:o;return t?e(c,i):e(c)}:e},l_=B,u_=o,d_=c_(u_.setInterval,!0);l_({global:!0,bind:!0,forced:u_.setInterval!==d_},{setInterval:d_});var f_=B,p_=o,m_=c_(p_.setTimeout,!0);f_({global:!0,bind:!0,forced:p_.setTimeout!==m_},{setTimeout:m_});var h_=P.setTimeout,g_=r(h_),__={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(__);var v_=__.exports,y_=r(v_);function b_(){return b_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b_.apply(this,arguments)}function x_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function S_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var C_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},w_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],T_=typeof document>`u`?{style:{}}:document.createElement(`div`),E_=`function`,D_=Math.round,O_=Math.abs,k_=Date.now;function A_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<w_.length;){if(n=w_[a],r=n?n+i:t,r in e)return r;a++}}var j_=typeof window>`u`?{}:window,M_=A_(T_.style,`touchAction`),N_=M_!==void 0;function P_(){if(!N_)return!1;var e={},t=j_.CSS&&j_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?j_.CSS.supports(`touch-action`,n):!0}),e}var F_=`compute`,I_=`auto`,L_=`manipulation`,R_=`none`,z_=`pan-x`,B_=`pan-y`,V_=P_(),H_=/mobile|tablet|ip(ad|hone|od)|android/i,U_=`ontouchstart`in j_,W_=A_(j_,`PointerEvent`)!==void 0,G_=U_&&H_.test(navigator.userAgent),K_=`touch`,q_=`pen`,J_=`mouse`,Y_=`kinect`,X_=25,Z_=1,Q_=2,$_=4,ev=8,tv=1,nv=2,rv=4,iv=8,av=16,ov=nv|rv,sv=iv|av,cv=ov|sv,lv=[`x`,`y`],uv=[`clientX`,`clientY`];function dv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function fv(e,t){return typeof e===E_?e.apply(t&&t[0]||void 0,t):e}function pv(e,t){return e.indexOf(t)>-1}function mv(e){if(pv(e,R_))return R_;var t=pv(e,z_),n=pv(e,B_);return t&&n?R_:t||n?t?z_:B_:pv(e,L_)?L_:I_}var hv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===F_&&(e=this.compute()),N_&&this.manager.element.style&&V_[e]&&(this.manager.element.style[M_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return dv(this.manager.recognizers,function(t){fv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),mv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=pv(r,R_)&&!V_[R_],a=pv(r,B_)&&!V_[B_],o=pv(r,z_)&&!V_[z_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&ov||o&&n&sv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function gv(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _v(e){var t=e.length;if(t===1)return{x:D_(e[0].clientX),y:D_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:D_(n/t),y:D_(r/t)}}function vv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:D_(e.pointers[n].clientX),clientY:D_(e.pointers[n].clientY)},n++;return{timeStamp:k_(),pointers:t,center:_v(t),deltaX:e.deltaX,deltaY:e.deltaY}}function yv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function bv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function xv(e,t){return e===t?tv:O_(e)>=O_(t)?e<0?nv:rv:t<0?iv:av}function Sv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Z_||a.eventType===$_)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Cv(e,t,n){return{x:t/e||0,y:n/e||0}}function wv(e,t){return yv(t[0],t[1],uv)/yv(e[0],e[1],uv)}function Tv(e,t){return bv(t[1],t[0],uv)+bv(e[1],e[0],uv)}function Ev(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==ev&&(r>X_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=Cv(r,c,l);a=u.x,o=u.y,i=O_(u.x)>O_(u.y)?u.x:u.y,s=xv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Dv(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=vv(t),i>1&&!n.firstMultiple?n.firstMultiple=vv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=_v(r);t.timeStamp=k_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=bv(s,c),t.distance=yv(s,c),Sv(n,t),t.offsetDirection=xv(t.deltaX,t.deltaY);var l=Cv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=O_(l.x)>O_(l.y)?l.x:l.y,t.scale=o?wv(o.pointers,r):1,t.rotation=o?Tv(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Ev(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;gv(f,u)&&(u=f),t.target=u}function Ov(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Z_&&r-i===0,o=t&($_|ev)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Dv(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function kv(e){return e.trim().split(/\s+/g)}function Av(e,t,n){dv(kv(t),function(t){e.addEventListener(t,n,!1)})}function W(e,t,n){dv(kv(t),function(t){e.removeEventListener(t,n,!1)})}function jv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Mv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){fv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Av(this.element,this.evEl,this.domHandler),this.evTarget&&Av(this.target,this.evTarget,this.domHandler),this.evWin&&Av(jv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(jv(this.element),this.evWin,this.domHandler)},e}();function Nv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Pv={pointerdown:Z_,pointermove:Q_,pointerup:$_,pointercancel:ev,pointerout:ev},Fv={2:K_,3:q_,4:J_,5:Y_},Iv=`pointerdown`,Lv=`pointermove pointerup pointercancel`;j_.MSPointerEvent&&!j_.PointerEvent&&(Iv=`MSPointerDown`,Lv=`MSPointerMove MSPointerUp MSPointerCancel`);var Rv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Iv,r.evWin=Lv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Pv[e.type.toLowerCase().replace(`ms`,``)],i=Fv[e.pointerType]||e.pointerType,a=i===K_,o=Nv(t,e.pointerId,`pointerId`);r&Z_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&($_|ev)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Mv);function zv(e){return Array.prototype.slice.call(e,0)}function Bv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Nv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Vv={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},Hv=`touchstart touchmove touchend touchcancel`,Uv=function(e){x_(t,e);function t(){var n;return t.prototype.evTarget=Hv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Vv[e.type],n=Wv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})},t}(Mv);function Wv(e,t){var n=zv(e.touches),r=this.targetIds;if(t&(Z_|Q_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=zv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return gv(e.target,c)}),t===Z_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&($_|ev)&&delete r[o[i].identifier],i++;if(s.length)return[Bv(a.concat(s),`identifier`,!0),s]}var Gv={mousedown:Z_,mousemove:Q_,mouseup:$_},Kv=`mousedown`,qv=`mousemove mouseup`,Jv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Kv,r.evWin=qv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Gv[e.type];t&Z_&&e.button===0&&(this.pressed=!0),t&Q_&&e.which!==1&&(t=$_),this.pressed&&(t&$_&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:J_,srcEvent:e}))},t}(Mv),Yv=2500,Xv=25;function Zv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Yv)}}function Qv(e,t){e&Z_?(this.primaryTouch=t.changedPointers[0].identifier,Zv.call(this,t)):e&($_|ev)&&Zv.call(this,t)}function $v(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Xv&&o<=Xv)return!0}return!1}var ey=function(){return function(e){x_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===K_,a=n.pointerType===J_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Qv.call(S_(S_(r)),t,n);else if(a&&$v.call(S_(S_(r)),n))return;r.callback(e,t,n)}},r.touch=new Uv(r.manager,r.handler),r.mouse=new Jv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Mv)}();function ty(e){var t;return t=e.options.inputClass||(W_?Rv:G_?Uv:U_?ey:Jv),new t(e,Ov)}function ny(e,t,n){return Array.isArray(e)?(dv(e,n[t],n),!0):!1}var ry=1,iy=2,ay=4,oy=8,sy=oy,cy=16,ly=32,uy=1;function dy(){return uy++}function G(e,t){var n=t.manager;return n?n.get(e):e}function K(e){return e&cy?`cancel`:e&oy?`end`:e&ay?`move`:e&iy?`start`:``}var fy=function(){function e(e){e===void 0&&(e={}),this.options=b_({enable:!0},e),this.id=dy(),this.manager=null,this.state=ry,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return C_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ny(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=G(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ny(e,`dropRecognizeWith`,this)?this:(e=G(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ny(e,`requireFailure`,this))return this;var t=this.requireFail;return e=G(e,this),Nv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ny(e,`dropRequireFailure`,this))return this;e=G(e,this);var t=Nv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<oy&&r(t.options.event+K(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=oy&&r(t.options.event+K(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=ly},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(ly|ry)))return!1;e++}return!0},t.recognize=function(e){var t=C_({},e);if(!fv(this.options.enable,[this,t])){this.reset(),this.state=ly;return}this.state&(sy|cy|ly)&&(this.state=ry),this.state=this.process(t),this.state&(iy|ay|oy|cy)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),py=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Z_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==$_)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||yv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.interval),iy):sy}return ly},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=ly},this.options.interval),ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===sy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(fy),my=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(iy|ay),i=this.attrTest(e);return r&&(n&ev||!i)?t|cy:r||i?n&$_?t|oy:t&iy?t|ay:iy:ly},t}(fy);function hy(e){return e===av?`down`:e===iv?`up`:e===nv?`left`:e===rv?`right`:``}var gy=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`pan`,threshold:10,pointers:1,direction:cv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&ov&&t.push(B_),e&sv&&t.push(z_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&ov?(i=a===0?tv:a<0?nv:rv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?tv:o<0?iv:av,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return my.prototype.attrTest.call(this,e)&&(this.state&iy||!(this.state&iy)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=hy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(my),_y=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`swipe`,threshold:10,velocity:.3,direction:ov|sv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return gy.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(ov|sv)?r=t.overallVelocity:n&ov?r=t.overallVelocityX:n&sv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&O_(r)>this.options.velocity&&t.eventType&$_},n.emit=function(e){var t=hy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(my),vy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&iy)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(my),yy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&iy)},t}(my),by=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[I_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&($_|ev)&&!a)this.reset();else if(e.eventType&Z_)this.reset(),this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.time);else if(e.eventType&$_)return sy;return ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===sy&&(e&&e.eventType&$_?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=k_(),this.manager.emit(this.options.event,this._input)))},t}(fy),xy={domEvents:!1,touchAction:F_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Sy=[[yy,{enable:!1}],[vy,{enable:!1},[`rotate`]],[_y,{direction:ov}],[gy,{direction:ov},[`swipe`]],[py],[py,{event:`doubletap`,taps:2},[`tap`]],[by]],Cy=1,wy=2;function Ty(e,t){var n=e.element;if(n.style){var r;dv(e.options.cssProps,function(i,a){r=A_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Ey(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Dy=function(){function e(e,t){var n=this;this.options=C_({},xy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ty(this),this.touchAction=new hv(this,this.options.touchAction),Ty(this,!0),dv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return C_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?wy:Cy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&sy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==wy&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(iy|ay|oy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof fy)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ny(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ny(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Nv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){t?n[e]&&n[e].splice(Nv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Ey(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ty(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Oy={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},ky=`touchstart`,Ay=`touchstart touchmove touchend touchcancel`,jy=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evTarget=ky,r.evWin=Ay,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=Oy[e.type];if(t===Z_&&(this.started=!0),this.started){var n=My.call(this,e,t);t&($_|ev)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})}},t}(Mv);function My(e,t){var n=zv(e.touches),r=zv(e.changedTouches);return t&($_|ev)&&(n=Bv(n.concat(r),`identifier`,!0)),[n,r]}function Ny(e,t,n){var r=`DEPRECATED METHOD: `+t+`
4
4
  `+n+` AT
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as i,t as a}from"./AdminLoginScreens-DeR71H29.js";import"./useVoiceRecorder-DCyJQkFK.js";import"./AdminShell-DlAVQUda.js";import"./Checkbox-B629mOPp.js";import{t as o}from"./page-3g0A19Rv.js";import"./useCopyFeedback-CSk9KjhY.js";import"./file-download-4mKJxUi-.js";var s=n(),c=e(t(),1),l=r();function u(){let e=i(`operator`),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.appState!==`chat`&&t.current!==e.appState&&(t.current=e.appState,console.info(`[operator-ui] op=auth-gate state=${e.appState}`))},[e.appState]),e.appState===`chat`?(0,l.jsx)(o,{variant:`operator`,forceCanonicalSession:window.location.pathname!==`/chat`}):(0,l.jsx)(a,{auth:e})}(0,s.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(u,{}));
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as i,t as a}from"./AdminLoginScreens-CukwQufW.js";import"./useVoiceRecorder-b7HzTFs0.js";import"./AdminShell-BwEBH6tT.js";import"./Checkbox-B629mOPp.js";import{t as o}from"./page-DMeJHVfA.js";import"./useCopyFeedback-DHoYHiK9.js";import"./file-download-4mKJxUi-.js";var s=n(),c=e(t(),1),l=r();function u(){let e=i(`operator`),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.appState!==`chat`&&t.current!==e.appState&&(t.current=e.appState,console.info(`[operator-ui] op=auth-gate state=${e.appState}`))},[e.appState]),e.appState===`chat`?(0,l.jsx)(o,{variant:`operator`,forceCanonicalSession:window.location.pathname!==`/chat`}):(0,l.jsx)(a,{auth:e})}(0,s.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(u,{}));