@rubytech/create-maxy-code 0.1.386 → 0.1.387
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/cron-heartbeat-registration.test.js +5 -0
- package/dist/cron-registration.js +1 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/payload/platform/neo4j/schema.cypher +36 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +61 -1
- package/payload/platform/plugins/docs/references/graph.md +11 -0
- package/payload/platform/plugins/docs/references/plugins-guide.md +1 -0
- package/payload/platform/plugins/docs/references/sweep-guide.md +43 -0
- package/payload/platform/plugins/memory/references/schema-estate-agent.md +34 -0
- package/payload/platform/plugins/scheduling/PLUGIN.md +17 -1
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +12 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.js +101 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.d.ts +54 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.js +117 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/schedule-classify.d.ts +7 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/schedule-classify.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/schedule-classify.js +6 -3
- package/payload/platform/plugins/scheduling/mcp/dist/lib/schedule-classify.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +88 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/standing-audit.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/standing-audit.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/standing-audit.test.js +77 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/standing-audit.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts +59 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +131 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +62 -15
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-event-agent.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-event-agent.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-event-agent.test.js +110 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-event-agent.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.js +35 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-get-agent.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-agent.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-agent.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-agent.test.js +81 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-agent.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts +7 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js +21 -4
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts +4 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js +6 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-get.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts +2 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js +32 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js.map +1 -1
- package/payload/platform/plugins/sweep/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/sweep/PLUGIN.md +15 -0
- package/payload/platform/plugins/sweep/skills/sweep-workflow/SKILL.md +113 -0
- package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -1
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +19 -4
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +7 -4
- package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +10 -0
- package/payload/platform/scripts/seed-neo4j.sh +38 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +5 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-oxqHKL3C.js → AdminLoginScreens-BejIjbmU.js} +1 -1
- package/payload/server/public/assets/{AdminShell-DBD6ruS1.js → AdminShell-D2-uBSB5.js} +1 -1
- package/payload/server/public/assets/{Checkbox-yr8-ftrE.js → Checkbox-1F1tzqca.js} +1 -1
- package/payload/server/public/assets/Transcript-DkGa4CQH.js +2 -0
- package/payload/server/public/assets/{admin-CQfZnuFy.js → admin-DqQARkjy.js} +1 -1
- package/payload/server/public/assets/{browser-DbdPeDK1.js → browser-nDtEK6RC.js} +1 -1
- package/payload/server/public/assets/{calendar-CFdOhe7Q.js → calendar-CO4Bwmho.js} +1 -1
- package/payload/server/public/assets/chat-DeIge_bC.js +1 -0
- package/payload/server/public/assets/chevron-left-DhVdq0aN.js +1 -0
- package/payload/server/public/assets/data-B1GIdzHk.js +1 -0
- package/payload/server/public/assets/{graph-Bluocsf_.js → graph-DFyicKd7.js} +1 -1
- package/payload/server/public/assets/{graph-labels-BcLJmY-v.js → graph-labels-D3BQdcpD.js} +1 -1
- package/payload/server/public/assets/{operator-DjK3MBSS.js → operator-BxrjWdT9.js} +1 -1
- package/payload/server/public/assets/{page-DQNYTb2d.js → page-ByDLq_o1.js} +1 -1
- package/payload/server/public/assets/{page-zJQTRXB2.js → page-D-Ep4bXd.js} +1 -1
- package/payload/server/public/assets/{public-CHCniosp.js → public-DbdqfdYq.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-JDfwjfIL.js → rotate-ccw-BkX8HODe.js} +1 -1
- package/payload/server/public/assets/{useSubAccountSwitcher-CfI3J2IX.css → useSubAccountSwitcher-DS0iqSkP.css} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +5 -5
- package/payload/server/public/chat.html +8 -8
- package/payload/server/public/data.html +7 -7
- package/payload/server/public/graph.html +8 -8
- package/payload/server/public/index.html +10 -10
- package/payload/server/public/operator.html +10 -10
- package/payload/server/public/public.html +8 -8
- package/payload/server/server.js +551 -271
- package/payload/server/public/assets/Transcript-FX_w6no6.js +0 -2
- package/payload/server/public/assets/chat-BunxcNDk.js +0 -1
- package/payload/server/public/assets/chevron-left-Cngmu0Py.js +0 -1
- package/payload/server/public/assets/data-IqZlMSwG.js +0 -1
- /package/payload/server/public/assets/{useSubAccountSwitcher-BpQ3oKiJ.js → useSubAccountSwitcher-DMbRhLPv.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{D as t,F as n,L as r,M as i,P as a,S as o,f as s,h as c,m as l,v as u,w as d,y as f}from"./useSubAccountSwitcher-BpQ3oKiJ.js";import{t as p,u as m,y as h}from"./AdminShell-DBD6ruS1.js";import{t as g}from"./chevron-left-Cngmu0Py.js";var _=t(`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=t(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),y=t(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),b=t(`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=t(`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`}]]),S=t(`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`}]]),C=n(),w=e(r(),1);function T(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function E(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function D(e){let t=T(e),n=t.getDay();return E(t,n===0?-6:1-n)}function O(e){let t=D(e);return Array.from({length:7},(e,n)=>E(t,n))}function k(e){let t=D(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>E(t,n))}function A(){return Array.from({length:24},(e,t)=>t)}function ee(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=T(t);return{from:e,to:E(e,1)}}case`week`:{let e=D(t);return{from:e,to:E(e,7)}}case`month`:{let e=D(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:E(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 E(t,n);case`week`:return E(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=i(),I=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],L=3;function R(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function te({anchor:e,meetings:t,onSelect:n}){let r=k(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 z=1440,B=1.8;function V(e){return e.getHours()*60+e.getMinutes()}function H(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function U({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=V(n),o=N(i,e)?V(i):z,s=a/z*100,c=Math.max((o-a)/z*100,B);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:H(n)}),(0,F.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var W=44;function G(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function K({anchor:e,meetings:t,onSelect:n}){let r=O(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:A().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${W}px`},children:e===0?``:G(e)},e))}),r.map(e=>(0,F.jsx)(U,{day:e,meetings:t,hourHeight:W,onSelect:n},e.toISOString()))]})]})}var q=52;function J(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function Y({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:A().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${q}px`},children:e===0?``:J(e)},e))}),(0,F.jsx)(U,{day:e,meetings:t,hourHeight:q,onSelect:n})]})]})}var X=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Z(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=>Z(new Date(e.startsAt))));return(0,F.jsx)(`div`,{className:`cal-year`,children:(0,F.jsx)(`div`,{className:`cal-year-grid`,children:ee(e).map(e=>{let t=k(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:X.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(Z(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:r,onDeleted:i}){let a=e.kind===`meeting`,[o,s]=(0,w.useState)(!1),[p,h]=(0,w.useState)(!1),[g,v]=(0,w.useState)(!1),[C,T]=(0,w.useState)(!1),[E,D]=(0,w.useState)(null),[O,k]=(0,w.useState)(e),[A,ee]=(0,w.useState)(e.title??``),[j,M]=(0,w.useState)(ie(e.startsAt)),[N,P]=(0,w.useState)(e.endsAt?ie(e.endsAt):``),[I,L]=(0,w.useState)(e.location??``),[R,te]=(0,w.useState)(e.privateNote??``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(``);(0,w.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!C&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[C,n]);let U=(0,w.useCallback)(()=>{let e={},t=A.trim();t!==(O.title??``)&&(e.title=t);let n=ae(j);Q(n)!==Q(O.startsAt)&&(e.startsAt=n);let r=N?ae(N):null;(r===null?O.endsAt!==null:O.endsAt===null||Q(r)!==Q(O.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(O.location??null)&&(e.location=i);let a=R.trim()||null;return a!==(O.privateNote??null)&&(e.privateNote=a),e},[A,j,N,I,R,O]),W=(0,w.useCallback)(async()=>{let n=U();if(Object.keys(n).length===0){s(!1);return}T(!0),D(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`HTTP ${i.status}`);let a=await i.json();k(a.meeting),r(a.meeting),s(!1)}catch(e){D(e instanceof Error?e.message:`Save failed`)}finally{T(!1)}},[t,U,e.meetingId,r]),G=(0,w.useCallback)(async()=>{let n=z.trim(),i=V.trim();if(!(!n&&!i)){T(!0),D(null);try{let a=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:i||void 0})});if(!a.ok)throw Error(`HTTP ${a.status}`);let o=await a.json();k(o.meeting),r(o.meeting),B(``),H(``)}catch(e){D(e instanceof Error?e.message:`Add failed`)}finally{T(!1)}}},[t,z,V,e.meetingId,r]),K=(0,w.useCallback)(async n=>{let i=n.email?{email:n.email}:{name:n.name};T(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(i)});if(!n.ok)throw Error(`HTTP ${n.status}`);let a=await n.json();k(a.meeting),r(a.meeting)}catch(e){D(e instanceof Error?e.message:`Remove failed`)}finally{T(!1)}},[t,e.meetingId,r]),q=(0,w.useCallback)(async()=>{T(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);i(e.meetingId)}catch(e){D(e instanceof Error?e.message:`Delete failed`),T(!1)}},[t,e.meetingId,i]),J=(0,w.useCallback)(async n=>{v(!1),T(!0),D(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){D(e instanceof Error?e.message:`Download failed`)}finally{T(!1)}},[t,e.meetingId]),Y=re[e.kind??`meeting`],X=z.trim().length>0||V.trim().length>0;return(0,F.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{C||n()},children:(0,F.jsxs)(`div`,{className:`cal-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":o?`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:Y}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:C,children:(0,F.jsx)(l,{size:16})})]}),!o&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsx)(`div`,{className:`cal-modal-title`,children:O.title??`Untitled`}),(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(y,{size:14}),(0,F.jsx)(`span`,{children:oe(O)})]}),O.location&&(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(b,{size:14}),(0,F.jsx)(`span`,{children:O.location})]}),O.attendees.length>0&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(m,{size:14}),(0,F.jsx)(`div`,{className:`cal-modal-attendees`,children:O.attendees.map((e,t)=>(0,F.jsx)(`div`,{className:`cal-attendee-row`,children:(0,F.jsx)(le,{a:e})},ce(e,t)))})]}),O.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:O.privateNote})]}),(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,F.jsx)(_,{size:14}),(0,F.jsx)(`span`,{children:Y})]})]}),o&&(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:A,onChange:e=>ee(e.target.value),disabled:C})]}),(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:C})]}),(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:C})]}),(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:C})]}),(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:[O.attendees.length===0&&(0,F.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),O.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:()=>K(e),disabled:C,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,F.jsx)(l,{size:13})})]},ce(e,t)))]}),(0,F.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,F.jsx)(`input`,{type:`text`,placeholder:`Name`,value:z,onChange:e=>B(e.target.value),disabled:C,"aria-label":`Attendee name`}),(0,F.jsx)(`input`,{type:`email`,placeholder:`Email`,value:V,onChange:e=>H(e.target.value),disabled:C,"aria-label":`Attendee email`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:G,disabled:C||!X,"aria-label":`Add attendee`,children:C?(0,F.jsx)(f,{size:13,className:`spin`}):(0,F.jsx)(S,{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=>te(e.target.value),disabled:C,rows:3,placeholder:`Only you and your team can see this.`})]})]}),E&&(0,F.jsx)(`div`,{className:`cal-modal-error`,children:E}),a&&(0,F.jsxs)(`div`,{className:`cal-modal-actions`,children:[!o&&!p&&!g&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>s(!0),disabled:C,children:[(0,F.jsx)(u,{size:14}),` Edit`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>h(!0),disabled:C,children:[(0,F.jsx)(c,{size:14}),` Delete`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{O.attendees.length>0?v(!0):J(!1)},disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):(0,F.jsx)(d,{size:14}),` Download`]})]}),g&&(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:()=>J(!0),disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Yes`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>J(!1),disabled:C,children:`No`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>v(!1),disabled:C,children:`Cancel`})]}),o&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:W,disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Save`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{s(!1),D(null)},disabled:C,children:`Cancel`})]}),p&&(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:q,disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Delete`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>h(!1),disabled:C,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,w.useState)(null),[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(void 0),[o,c]=(0,w.useState)(null),[l,u]=(0,w.useState)(void 0),[d,m]=(0,w.useState)(null),[g,_]=(0,w.useState)(null);(0,w.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`&&a(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let v=(0,w.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,w.useState)(!1),x=(0,w.useCallback)(async()=>{b(!0);try{let e=await h();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return n?e?(0,F.jsx)(s,{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)(p,{cacheKey:e,businessName:i,sessionId:o,onLogout:v,onDisconnect:x,disconnecting:y,userName:l,userAvatar:d,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)(f,{size:18,className:`spin`}),` Loading…`]})})}function me({cacheKey:e}){let{adminFetch:t,sessionRefetchNonce:n}=a({initialCacheKey:e,surface:`calendar`}),[r,i]=(0,w.useState)(`month`),[s,c]=(0,w.useState)(()=>new Date),[l,u]=(0,w.useState)([]),[d,p]=(0,w.useState)(!1),[m,h]=(0,w.useState)(null),[y,b]=(0,w.useState)(null),[x,S]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=!1;return t(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&S(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[t]),(0,w.useEffect)(()=>{let e=!1,{from:n,to:i}=j(r,s);return p(!0),h(null),t(`/api/admin/calendar/meetings?from=${encodeURIComponent(n.toISOString())}&to=${encodeURIComponent(i.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();u(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(h(t instanceof Error?t.message:`Failed to load`),u([]))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[r,s,n,t]);let C=(0,w.useCallback)(()=>c(new Date),[]),T=(0,w.useCallback)(()=>c(e=>M(r,e,-1)),[r]),E=(0,w.useCallback)(()=>c(e=>M(r,e,1)),[r]),D=(0,w.useCallback)(e=>{c(e),i(`month`)},[]);(0,w.useEffect)(()=>{b(null)},[r,s]);let O=(0,w.useCallback)(e=>{u(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),b(e)},[]),k=(0,w.useCallback)(e=>{u(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:C,children:`Today`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:T,"aria-label":`Previous`,children:(0,F.jsx)(g,{size:18})}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:E,"aria-label":`Next`,children:(0,F.jsx)(v,{size:18})}),(0,F.jsx)(`span`,{className:`cal-range-label`,children:fe(r,s)}),d&&(0,F.jsx)(f,{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===r?` cal-view-btn-active`:``}`,onClick:()=>i(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)(o,{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]}),r===`day`&&(0,F.jsx)(Y,{anchor:s,meetings:l,onSelect:b}),r===`week`&&(0,F.jsx)(K,{anchor:s,meetings:l,onSelect:b}),r===`month`&&(0,F.jsx)(te,{anchor:s,meetings:l,onSelect:b}),r===`year`&&(0,F.jsx)(ne,{anchor:s,meetings:l,onPickMonth:D})]}),y&&(0,F.jsx)(ue,{meeting:y,adminFetch:t,onClose:()=>b(null),onSaved:O,onDeleted:k})]})}(0,C.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(pe,{}));
|
|
1
|
+
import{o as e}from"./chunk-CAM3fms7.js";import{D as t,F as n,L as r,M as i,P as a,S as o,f as s,h as c,m as l,v as u,w as d,y as f}from"./useSubAccountSwitcher-DMbRhLPv.js";import{t as p,u as m,y as h}from"./AdminShell-D2-uBSB5.js";import{t as g}from"./chevron-left-DhVdq0aN.js";var _=t(`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=t(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),y=t(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),b=t(`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=t(`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`}]]),S=t(`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`}]]),C=n(),w=e(r(),1);function T(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function E(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function D(e){let t=T(e),n=t.getDay();return E(t,n===0?-6:1-n)}function O(e){let t=D(e);return Array.from({length:7},(e,n)=>E(t,n))}function k(e){let t=D(new Date(e.getFullYear(),e.getMonth(),1));return Array.from({length:42},(e,n)=>E(t,n))}function A(){return Array.from({length:24},(e,t)=>t)}function ee(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=T(t);return{from:e,to:E(e,1)}}case`week`:{let e=D(t);return{from:e,to:E(e,7)}}case`month`:{let e=D(new Date(t.getFullYear(),t.getMonth(),1));return{from:e,to:E(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 E(t,n);case`week`:return E(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=i(),I=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],L=3;function R(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function te({anchor:e,meetings:t,onSelect:n}){let r=k(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 z=1440,B=1.8;function V(e){return e.getHours()*60+e.getMinutes()}function H(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function U({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=V(n),o=N(i,e)?V(i):z,s=a/z*100,c=Math.max((o-a)/z*100,B);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:H(n)}),(0,F.jsx)(`span`,{className:`cal-event-title`,children:t.title??`Untitled`})]},t.meetingId)})]})})}var W=44;function G(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function K({anchor:e,meetings:t,onSelect:n}){let r=O(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:A().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${W}px`},children:e===0?``:G(e)},e))}),r.map(e=>(0,F.jsx)(U,{day:e,meetings:t,hourHeight:W,onSelect:n},e.toISOString()))]})]})}var q=52;function J(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString([],{hour:`numeric`})}function Y({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:A().map(e=>(0,F.jsx)(`div`,{className:`cal-hour-label`,style:{height:`${q}px`},children:e===0?``:J(e)},e))}),(0,F.jsx)(U,{day:e,meetings:t,hourHeight:q,onSelect:n})]})]})}var X=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function Z(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=>Z(new Date(e.startsAt))));return(0,F.jsx)(`div`,{className:`cal-year`,children:(0,F.jsx)(`div`,{className:`cal-year-grid`,children:ee(e).map(e=>{let t=k(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:X.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(Z(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:r,onDeleted:i}){let a=e.kind===`meeting`,[o,s]=(0,w.useState)(!1),[p,h]=(0,w.useState)(!1),[g,v]=(0,w.useState)(!1),[C,T]=(0,w.useState)(!1),[E,D]=(0,w.useState)(null),[O,k]=(0,w.useState)(e),[A,ee]=(0,w.useState)(e.title??``),[j,M]=(0,w.useState)(ie(e.startsAt)),[N,P]=(0,w.useState)(e.endsAt?ie(e.endsAt):``),[I,L]=(0,w.useState)(e.location??``),[R,te]=(0,w.useState)(e.privateNote??``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(``);(0,w.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!C&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[C,n]);let U=(0,w.useCallback)(()=>{let e={},t=A.trim();t!==(O.title??``)&&(e.title=t);let n=ae(j);Q(n)!==Q(O.startsAt)&&(e.startsAt=n);let r=N?ae(N):null;(r===null?O.endsAt!==null:O.endsAt===null||Q(r)!==Q(O.endsAt))&&(e.endsAt=r);let i=I.trim()||null;i!==(O.location??null)&&(e.location=i);let a=R.trim()||null;return a!==(O.privateNote??null)&&(e.privateNote=a),e},[A,j,N,I,R,O]),W=(0,w.useCallback)(async()=>{let n=U();if(Object.keys(n).length===0){s(!1);return}T(!0),D(null);try{let i=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error(`HTTP ${i.status}`);let a=await i.json();k(a.meeting),r(a.meeting),s(!1)}catch(e){D(e instanceof Error?e.message:`Save failed`)}finally{T(!1)}},[t,U,e.meetingId,r]),G=(0,w.useCallback)(async()=>{let n=z.trim(),i=V.trim();if(!(!n&&!i)){T(!0),D(null);try{let a=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:i||void 0})});if(!a.ok)throw Error(`HTTP ${a.status}`);let o=await a.json();k(o.meeting),r(o.meeting),B(``),H(``)}catch(e){D(e instanceof Error?e.message:`Add failed`)}finally{T(!1)}}},[t,z,V,e.meetingId,r]),K=(0,w.useCallback)(async n=>{let i=n.email?{email:n.email}:{name:n.name};T(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}/attendees`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify(i)});if(!n.ok)throw Error(`HTTP ${n.status}`);let a=await n.json();k(a.meeting),r(a.meeting)}catch(e){D(e instanceof Error?e.message:`Remove failed`)}finally{T(!1)}},[t,e.meetingId,r]),q=(0,w.useCallback)(async()=>{T(!0),D(null);try{let n=await t(`/api/admin/calendar/meetings/${encodeURIComponent(e.meetingId)}`,{method:`DELETE`});if(!n.ok)throw Error(`HTTP ${n.status}`);i(e.meetingId)}catch(e){D(e instanceof Error?e.message:`Delete failed`),T(!1)}},[t,e.meetingId,i]),J=(0,w.useCallback)(async n=>{v(!1),T(!0),D(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){D(e instanceof Error?e.message:`Download failed`)}finally{T(!1)}},[t,e.meetingId]),Y=re[e.kind??`meeting`],X=z.trim().length>0||V.trim().length>0;return(0,F.jsx)(`div`,{className:`cal-modal-overlay`,onClick:()=>{C||n()},children:(0,F.jsxs)(`div`,{className:`cal-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":o?`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:Y}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-close`,onClick:n,"aria-label":`Close`,autoFocus:!0,disabled:C,children:(0,F.jsx)(l,{size:16})})]}),!o&&(0,F.jsxs)(`div`,{className:`cal-modal-body`,children:[(0,F.jsx)(`div`,{className:`cal-modal-title`,children:O.title??`Untitled`}),(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(y,{size:14}),(0,F.jsx)(`span`,{children:oe(O)})]}),O.location&&(0,F.jsxs)(`div`,{className:`cal-modal-row`,children:[(0,F.jsx)(b,{size:14}),(0,F.jsx)(`span`,{children:O.location})]}),O.attendees.length>0&&(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-row-top`,children:[(0,F.jsx)(m,{size:14}),(0,F.jsx)(`div`,{className:`cal-modal-attendees`,children:O.attendees.map((e,t)=>(0,F.jsx)(`div`,{className:`cal-attendee-row`,children:(0,F.jsx)(le,{a:e})},ce(e,t)))})]}),O.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:O.privateNote})]}),(0,F.jsxs)(`div`,{className:`cal-modal-row cal-modal-meta`,children:[(0,F.jsx)(_,{size:14}),(0,F.jsx)(`span`,{children:Y})]})]}),o&&(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:A,onChange:e=>ee(e.target.value),disabled:C})]}),(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:C})]}),(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:C})]}),(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:C})]}),(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:[O.attendees.length===0&&(0,F.jsx)(`div`,{className:`cal-attendee-empty`,children:`No attendees yet.`}),O.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:()=>K(e),disabled:C,"aria-label":`Remove ${e.name||e.email||`attendee`}`,children:(0,F.jsx)(l,{size:13})})]},ce(e,t)))]}),(0,F.jsxs)(`div`,{className:`cal-attendee-add`,children:[(0,F.jsx)(`input`,{type:`text`,placeholder:`Name`,value:z,onChange:e=>B(e.target.value),disabled:C,"aria-label":`Attendee name`}),(0,F.jsx)(`input`,{type:`email`,placeholder:`Email`,value:V,onChange:e=>H(e.target.value),disabled:C,"aria-label":`Attendee email`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn cal-attendee-add-btn`,onClick:G,disabled:C||!X,"aria-label":`Add attendee`,children:C?(0,F.jsx)(f,{size:13,className:`spin`}):(0,F.jsx)(S,{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=>te(e.target.value),disabled:C,rows:3,placeholder:`Only you and your team can see this.`})]})]}),E&&(0,F.jsx)(`div`,{className:`cal-modal-error`,children:E}),a&&(0,F.jsxs)(`div`,{className:`cal-modal-actions`,children:[!o&&!p&&!g&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>s(!0),disabled:C,children:[(0,F.jsx)(u,{size:14}),` Edit`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-danger`,onClick:()=>h(!0),disabled:C,children:[(0,F.jsx)(c,{size:14}),` Delete`]}),(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-download`,onClick:()=>{O.attendees.length>0?v(!0):J(!1)},disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):(0,F.jsx)(d,{size:14}),` Download`]})]}),g&&(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:()=>J(!0),disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Yes`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>J(!1),disabled:C,children:`No`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>v(!1),disabled:C,children:`Cancel`})]}),o&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`cal-modal-btn cal-modal-btn-primary`,onClick:W,disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Save`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>{s(!1),D(null)},disabled:C,children:`Cancel`})]}),p&&(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:q,disabled:C,children:[C?(0,F.jsx)(f,{size:14,className:`spin`}):null,` Delete`]}),(0,F.jsx)(`button`,{type:`button`,className:`cal-modal-btn`,onClick:()=>h(!1),disabled:C,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,w.useState)(null),[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(void 0),[o,c]=(0,w.useState)(null),[l,u]=(0,w.useState)(void 0),[d,m]=(0,w.useState)(null),[g,_]=(0,w.useState)(null);(0,w.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`&&a(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let v=(0,w.useCallback)(()=>{try{sessionStorage.removeItem($)}catch{}window.location.href=`/`},[]),[y,b]=(0,w.useState)(!1),x=(0,w.useCallback)(async()=>{b(!0);try{let e=await h();if(e){try{sessionStorage.removeItem($)}catch{}window.location.href=`/`}return e}finally{b(!1)}},[]);return n?e?(0,F.jsx)(s,{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)(p,{cacheKey:e,businessName:i,sessionId:o,onLogout:v,onDisconnect:x,disconnecting:y,userName:l,userAvatar:d,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)(f,{size:18,className:`spin`}),` Loading…`]})})}function me({cacheKey:e}){let{adminFetch:t,sessionRefetchNonce:n}=a({initialCacheKey:e,surface:`calendar`}),[r,i]=(0,w.useState)(`month`),[s,c]=(0,w.useState)(()=>new Date),[l,u]=(0,w.useState)([]),[d,p]=(0,w.useState)(!1),[m,h]=(0,w.useState)(null),[y,b]=(0,w.useState)(null),[x,S]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=!1;return t(`/api/admin/calendar/booking-link`).then(async t=>{if(e||!t.ok)return;let n=await t.json();typeof n.bookingDomain==`string`&&n.bookingDomain&&S(n.bookingDomain)}).catch(()=>{}),()=>{e=!0}},[t]),(0,w.useEffect)(()=>{let e=!1,{from:n,to:i}=j(r,s);return p(!0),h(null),t(`/api/admin/calendar/meetings?from=${encodeURIComponent(n.toISOString())}&to=${encodeURIComponent(i.toISOString())}`).then(async t=>{if(e)return;if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();u(Array.isArray(n.meetings)?n.meetings:[])}).catch(t=>{e||(h(t instanceof Error?t.message:`Failed to load`),u([]))}).finally(()=>{e||p(!1)}),()=>{e=!0}},[r,s,n,t]);let C=(0,w.useCallback)(()=>c(new Date),[]),T=(0,w.useCallback)(()=>c(e=>M(r,e,-1)),[r]),E=(0,w.useCallback)(()=>c(e=>M(r,e,1)),[r]),D=(0,w.useCallback)(e=>{c(e),i(`month`)},[]);(0,w.useEffect)(()=>{b(null)},[r,s]);let O=(0,w.useCallback)(e=>{u(t=>t.map(t=>t.meetingId===e.meetingId?e:t)),b(e)},[]),k=(0,w.useCallback)(e=>{u(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:C,children:`Today`}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:T,"aria-label":`Previous`,children:(0,F.jsx)(g,{size:18})}),(0,F.jsx)(`button`,{type:`button`,className:`cal-nav-btn`,onClick:E,"aria-label":`Next`,children:(0,F.jsx)(v,{size:18})}),(0,F.jsx)(`span`,{className:`cal-range-label`,children:fe(r,s)}),d&&(0,F.jsx)(f,{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===r?` cal-view-btn-active`:``}`,onClick:()=>i(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)(o,{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]}),r===`day`&&(0,F.jsx)(Y,{anchor:s,meetings:l,onSelect:b}),r===`week`&&(0,F.jsx)(K,{anchor:s,meetings:l,onSelect:b}),r===`month`&&(0,F.jsx)(te,{anchor:s,meetings:l,onSelect:b}),r===`year`&&(0,F.jsx)(ne,{anchor:s,meetings:l,onPickMonth:D})]}),y&&(0,F.jsx)(ue,{meeting:y,adminFetch:t,onClose:()=>b(null),onSaved:O,onDeleted:k})]})}(0,C.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(pe,{}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,M as t}from"./useSubAccountSwitcher-DMbRhLPv.js";import"./admin-types-hioowVct.js";import"./AdminShell-D2-uBSB5.js";import{n}from"./page-D-Ep4bXd.js";import"./Transcript-DkGa4CQH.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./useSubAccountSwitcher-DMbRhLPv.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,M as t}from"./useSubAccountSwitcher-DMbRhLPv.js";import{t as n}from"./page-ByDLq_o1.js";import"./Transcript-DkGa4CQH.js";import"./graph-labels-D3BQdcpD.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-CAM3fms7.js";import{D as n,F as r,L as i,M as a,P as o,_ as s,f as c,g as l,h as u,m as d,y as f}from"./useSubAccountSwitcher-BpQ3oKiJ.js";import{f as p,p as m,t as h,y as g}from"./AdminShell-DBD6ruS1.js";import{t as _}from"./Checkbox-yr8-ftrE.js";import{t as v}from"./chevron-left-Cngmu0Py.js";import{t as y}from"./rotate-ccw-JDfwjfIL.js";import{i as b,n as x,r as S}from"./graph-labels-BcLJmY-v.js";var ee=n(`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`}]]),C=n(`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`}]]),te=n(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ne=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)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},ie=re,w=ie.all,T=ie.IS_HTMLDDA?function(e){return typeof e==`function`||e===w}:function(e){return typeof e==`function`},E={},D=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ae=c,oe=Function.prototype.call,O=ae?oe.bind(oe):function(){return oe.apply(oe,arguments)},se={},ce={}.propertyIsEnumerable,le=Object.getOwnPropertyDescriptor;se.f=le&&!ce.call({1:2},1)?function(e){var t=le(this,e);return!!t&&t.enumerable}:ce;var ue=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},de=v,fe=s,pe=S,me=Object,he=de(``.split),ge=fe(function(){return!me(`z`).propertyIsEnumerable(0)})?function(e){return pe(e)===`String`?he(e,``):me(e)}:me,_e=function(e){return e==null},ve=_e,ye=TypeError,be=function(e){if(ve(e))throw new ye(`Can't call method on `+e);return e},xe=ge,Se=be,k=function(e){return xe(Se(e))},Ce=T,we=re,A=we.all,j=we.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Ce(e)||e===A}:function(e){return typeof e==`object`?e!==null:Ce(e)},M={},Te=M,Ee=o,De=T,N=function(e){return De(e)?e:void 0},P=function(e,t){return arguments.length<2?N(Te[e])||N(Ee[e]):Te[e]&&Te[e][t]||Ee[e]&&Ee[e][t]},F=v({}.isPrototypeOf),Oe=typeof navigator<`u`&&String(navigator.userAgent)||``,ke=o,Ae=Oe,je=ke.process,Me=ke.Deno,Ne=je&&je.versions||Me&&Me.version,I=Ne&&Ne.v8,Pe,Fe;I&&(Pe=I.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&Ae&&(Pe=Ae.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=Ae.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=P,Ue=T,We=F,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=T,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=_e,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=O,it=T,at=j,ot=TypeError,st=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[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 vt=ct.exports,yt=be,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Be,It=Ve,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=O,Ht=j,Ut=qe,Wt=nt,Gt=st,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=qe,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=j,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=D,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=D,ln=O,un=se,dn=ue,fn=k,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;E.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=T,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=$e,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=D&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=j,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=D,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=D,qn=jn,Jn=ue,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=T,er=E.f,tr=Tn,nr=M,rr=An,ir=Yn,ar=Tt,or=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 Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=D,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=M.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ue,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=T,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=T,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=T,Zr=Hr,Qr=P,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=j,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Ie,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=j,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Ie,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(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],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=k,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(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}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=k,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=D,sa=Mn,ca=jn,la=In,ua=k,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=P(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=k,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=M,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=O,uo=P,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=T,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=j,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=ge,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=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=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,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:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=O,as=v,os=D,ss=Be,cs=s,ls=Tt,us=F,ds=In,fs=k,ps=Zt,ms=Li,hs=ue,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=E,Ss=jn,Cs=Ri,ws=se,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Be&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=P,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=qe,Tc=Ye,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=T,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=P,zc=p,Bc=O,Vc=v,Hc=s,Uc=T,Wc=qe,Gc=kc,Kc=Ic,qc=Be,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Be,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=P,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=M.Symbol,yl={},bl=D,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=T,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=T,Rl=j,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ue,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=$e,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=T,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=O,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=k,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={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},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=P,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=P,cd=v,ld=qe,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=be,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(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),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=$e,Zd=j,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=M,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=F,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=$e,bf=xt,xf=ge,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(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 Cf(`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}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Ie;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=F,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=F,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=F,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=$e,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=F,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(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 If(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}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=O,vp=In,yp=nt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=nt,jp=_e,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=O,Ip=$e,Lp=In,Rp=Ye,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=O,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=M.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=M.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=D,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!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(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({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=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=F,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(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)&&(Am(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 Mm=z,Nm=gr,Pm=si,Fm=j,Im=Hi,Lm=wr,Rm=k,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=F,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(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 nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{o as e,t}from"./chunk-CAM3fms7.js";import{D as n,F as r,L as i,M as a,P as o,_ as s,f as c,g as l,h as u,m as d,y as f}from"./useSubAccountSwitcher-DMbRhLPv.js";import{f as p,p as m,t as h,y as g}from"./AdminShell-D2-uBSB5.js";import{t as _}from"./Checkbox-1F1tzqca.js";import{t as v}from"./chevron-left-DhVdq0aN.js";import{t as y}from"./rotate-ccw-BkX8HODe.js";import{i as b,n as x,r as S}from"./graph-labels-D3BQdcpD.js";var ee=n(`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`}]]),C=n(`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`}]]),te=n(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ne=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)},ne=typeof document==`object`&&document.all,re={all:ne,IS_HTMLDDA:ne===void 0&&ne!==void 0},ie=re,w=ie.all,T=ie.IS_HTMLDDA?function(e){return typeof e==`function`||e===w}:function(e){return typeof e==`function`},E={},D=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ae=c,oe=Function.prototype.call,O=ae?oe.bind(oe):function(){return oe.apply(oe,arguments)},se={},ce={}.propertyIsEnumerable,le=Object.getOwnPropertyDescriptor;se.f=le&&!ce.call({1:2},1)?function(e){var t=le(this,e);return!!t&&t.enumerable}:ce;var ue=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},de=v,fe=s,pe=S,me=Object,he=de(``.split),ge=fe(function(){return!me(`z`).propertyIsEnumerable(0)})?function(e){return pe(e)===`String`?he(e,``):me(e)}:me,_e=function(e){return e==null},ve=_e,ye=TypeError,be=function(e){if(ve(e))throw new ye(`Can't call method on `+e);return e},xe=ge,Se=be,k=function(e){return xe(Se(e))},Ce=T,we=re,A=we.all,j=we.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:Ce(e)||e===A}:function(e){return typeof e==`object`?e!==null:Ce(e)},M={},Te=M,Ee=o,De=T,N=function(e){return De(e)?e:void 0},P=function(e,t){return arguments.length<2?N(Te[e])||N(Ee[e]):Te[e]&&Te[e][t]||Ee[e]&&Ee[e][t]},F=v({}.isPrototypeOf),Oe=typeof navigator<`u`&&String(navigator.userAgent)||``,ke=o,Ae=Oe,je=ke.process,Me=ke.Deno,Ne=je&&je.versions||Me&&Me.version,I=Ne&&Ne.v8,Pe,Fe;I&&(Pe=I.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&Ae&&(Pe=Ae.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=Ae.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=P,Ue=T,We=F,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=T,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=_e,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=O,it=T,at=j,ot=TypeError,st=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},ct={exports:{}},lt=!0,ut=o,dt=Object.defineProperty,ft=function(e,t){try{dt(ut,e,{value:t,configurable:!0,writable:!0})}catch{ut[e]=t}return t},pt=o,mt=ft,ht=`__core-js_shared__`,gt=pt[ht]||mt(ht,{}),_t=gt;(ct.exports=function(e,t){return _t[e]||(_t[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 vt=ct.exports,yt=be,bt=Object,xt=function(e){return bt(yt(e))},St=v,Ct=xt,wt=St({}.hasOwnProperty),Tt=Object.hasOwn||function(e,t){return wt(Ct(e),t)},Et=v,Dt=0,Ot=Math.random(),kt=Et(1 .toString),At=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+kt(++Dt+Ot,36)},jt=o,Mt=vt,Nt=Tt,Pt=At,Ft=Be,It=Ve,Lt=jt.Symbol,Rt=Mt(`wks`),zt=It?Lt.for||Lt:Lt&&Lt.withoutSetter||Pt,Bt=function(e){return Nt(Rt,e)||(Rt[e]=Ft&&Nt(Lt,e)?Lt[e]:zt(`Symbol.`+e)),Rt[e]},Vt=O,Ht=j,Ut=qe,Wt=nt,Gt=st,Kt=Bt,qt=TypeError,Jt=Kt(`toPrimitive`),Yt=function(e,t){if(!Ht(e)||Ut(e))return e;var n=Wt(e,Jt),r;if(n){if(t===void 0&&(t=`default`),r=Vt(n,e,t),!Ht(r)||Ut(r))return r;throw new qt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Gt(e,t)},Xt=qe,Zt=function(e){var t=Yt(e,`string`);return Xt(t)?t:t+``},Qt=o,$t=j,en=Qt.document,tn=$t(en)&&$t(en.createElement),nn=function(e){return tn?en.createElement(e):{}},rn=D,an=s,on=nn,sn=!rn&&!an(function(){return Object.defineProperty(on(`div`),`a`,{get:function(){return 7}}).a!==7}),cn=D,ln=O,un=se,dn=ue,fn=k,pn=Zt,mn=Tt,hn=sn,gn=Object.getOwnPropertyDescriptor;E.f=cn?gn:function(e,t){if(e=fn(e),t=pn(t),hn)try{return gn(e,t)}catch{}if(mn(e,t))return dn(!ln(un.f,e,t),e[t])};var _n=s,vn=T,yn=/#|\.prototype\./,bn=function(e,t){var n=Sn[xn(e)];return n===wn?!0:n===Cn?!1:vn(t)?_n(t):!!t},xn=bn.normalize=function(e){return String(e).replace(yn,`.`).toLowerCase()},Sn=bn.data={},Cn=bn.NATIVE=`N`,wn=bn.POLYFILL=`P`,Tn=bn,En=te,Dn=$e,On=c,kn=En(En.bind),An=function(e,t){return Dn(e),t===void 0?e:On?kn(e,t):function(){return e.apply(t,arguments)}},jn={},Mn=D&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Nn=j,Pn=String,Fn=TypeError,In=function(e){if(Nn(e))return e;throw new Fn(Pn(e)+` is not an object`)},Ln=D,Rn=sn,zn=Mn,Bn=In,Vn=Zt,Hn=TypeError,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=`enumerable`,L=`configurable`,R=`writable`;jn.f=Ln?zn?function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&R in n&&!n[R]){var r=Wn(e,t);r&&r[R]&&(e[t]=n.value,n={configurable:L in n?n[L]:r[L],enumerable:Gn in n?n[Gn]:r[Gn],writable:!1})}return Un(e,t,n)}:Un:function(e,t,n){if(Bn(e),t=Vn(t),Bn(n),Rn)try{return Un(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Hn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Kn=D,qn=jn,Jn=ue,Yn=Kn?function(e,t,n){return qn.f(e,t,Jn(1,n))}:function(e,t,n){return e[t]=n,e},Xn=o,Zn=p,Qn=te,$n=T,er=E.f,tr=Tn,nr=M,rr=An,ir=Yn,ar=Tt,or=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 Zn(e,this,arguments)};return t.prototype=e.prototype,t},z=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Xn:i?Xn[n]:(Xn[n]||{}).prototype,s=r?nr:nr[n]||ir(nr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=tr(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ar(o,f),m=s[f],u&&(e.dontCallGetSet?(_=er(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?rr(p,Xn):e.wrap&&u?or(p):a&&$n(p)?Qn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&ir(g,`sham`,!0),ir(s,f,g),a&&(d=n+`Prototype`,ar(nr,d)||ir(nr,d,{}),ir(nr[d],f,p),e.real&&c&&(l||!c[f])&&ir(c,f,p)))},sr=z,cr=D,lr=jn.f;sr({target:`Object`,stat:!0,forced:Object.defineProperty!==lr,sham:!cr},{defineProperty:lr});var ur=M.Object,dr=i.exports=function(e,t,n){return ur.defineProperty(e,t,n)};ur.defineProperty.sham&&(dr.sham=!0);var fr=i.exports,pr=fr,mr=r(pr),hr=S,gr=Array.isArray||function(e){return hr(e)===`Array`},_r=Math.ceil,vr=Math.floor,yr=Math.trunc||function(e){var t=+e;return(t>0?vr:_r)(t)},br=function(e){var t=+e;return t!==t||t===0?0:yr(t)},xr=br,Sr=Math.min,Cr=function(e){return e>0?Sr(xr(e),9007199254740991):0},wr=function(e){return Cr(e.length)},Tr=TypeError,Er=9007199254740991,Dr=function(e){if(e>Er)throw Tr(`Maximum allowed index exceeded`);return e},Or=Zt,kr=jn,Ar=ue,jr=function(e,t,n){var r=Or(t);r in e?kr.f(e,r,Ar(0,n)):e[r]=n},Mr=Bt(`toStringTag`),Nr={};Nr[Mr]=`z`;var Pr=String(Nr)===`[object z]`,Fr=Pr,Ir=T,Lr=S,Rr=Bt(`toStringTag`),zr=Object,Br=Lr(function(){return arguments}())===`Arguments`,Vr=function(e,t){try{return e[t]}catch{}},Hr=Fr?Lr:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Vr(t=zr(e),Rr))==`string`?n:Br?Lr(t):(r=Lr(t))===`Object`&&Ir(t.callee)?`Arguments`:r},Ur=v,Wr=T,Gr=gt,Kr=Ur(Function.toString);Wr(Gr.inspectSource)||(Gr.inspectSource=function(e){return Kr(e)});var qr=Gr.inspectSource,Jr=v,Yr=s,Xr=T,Zr=Hr,Qr=P,B=qr,$r=function(){},ei=[],ti=Qr(`Reflect`,`construct`),ni=/^\s*(?:class|function)\b/,ri=Jr(ni.exec),ii=!ni.test($r),ai=function(e){if(!Xr(e))return!1;try{return ti($r,ei,e),!0}catch{return!1}},oi=function(e){if(!Xr(e))return!1;switch(Zr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ii||!!ri(ni,B(e))}catch{return!0}};oi.sham=!0;var si=!ti||Yr(function(){var e;return ai(ai.call)||!ai(Object)||!ai(function(){e=!0})||e})?oi:ai,ci=gr,li=si,ui=j,di=Bt(`species`),fi=Array,pi=function(e){var t;return ci(e)&&(t=e.constructor,li(t)&&(t===fi||ci(t.prototype))?t=void 0:ui(t)&&(t=t[di],t===null&&(t=void 0))),t===void 0?fi:t},mi=function(e,t){return new(pi(e))(t===0?0:t)},hi=s,gi=Bt,_i=Ie,vi=gi(`species`),yi=function(e){return _i>=51||!hi(function(){var t=[],n=t.constructor={};return n[vi]=function(){return{foo:1}},t[e](Boolean).foo!==1})},bi=z,xi=s,Si=gr,Ci=j,wi=xt,Ti=wr,Ei=Dr,Di=jr,Oi=mi,ki=yi,Ai=Bt,ji=Ie,Mi=Ai(`isConcatSpreadable`),Ni=ji>=51||!xi(function(){var e=[];return e[Mi]=!1,e.concat()[0]!==e}),Pi=function(e){if(!Ci(e))return!1;var t=e[Mi];return t===void 0?Si(e):!!t};bi({target:`Array`,proto:!0,arity:1,forced:!Ni||!ki(`concat`)},{concat:function(e){var t=wi(this),n=Oi(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],Pi(c))for(s=Ti(c),Ei(r+s),a=0;a<s;a++,r++)a in c&&Di(n,r,c[a]);else Ei(r+1),Di(n,r++,c);return n.length=r,n}});var Fi=Hr,Ii=String,Li=function(e){if(Fi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Ii(e)},Ri={},zi=br,Bi=Math.max,Vi=Math.min,Hi=function(e,t){var n=zi(e);return n<0?Bi(n+t,0):Vi(n,t)},Ui=k,Wi=Hi,Gi=wr,Ki=function(e){return function(t,n,r){var i=Ui(t),a=Gi(i),o=Wi(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}},qi={includes:Ki(!0),indexOf:Ki(!1)},Ji={},Yi=v,Xi=Tt,Zi=k,Qi=qi.indexOf,$i=Ji,ea=Yi([].push),ta=function(e,t){var n=Zi(e),r=0,i=[],a;for(a in n)!Xi($i,a)&&Xi(n,a)&&ea(i,a);for(;t.length>r;)Xi(n,a=t[r++])&&(~Qi(i,a)||ea(i,a));return i},na=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],ra=ta,ia=na,aa=Object.keys||function(e){return ra(e,ia)},oa=D,sa=Mn,ca=jn,la=In,ua=k,da=aa;Ri.f=oa&&!sa?Object.defineProperties:function(e,t){la(e);for(var n=ua(t),r=da(t),i=r.length,a=0,o;i>a;)ca.f(e,o=r[a++],n[o]);return e};var fa=P(`document`,`documentElement`),pa=vt,ma=At,ha=pa(`keys`),ga=function(e){return ha[e]||(ha[e]=ma(e))},_a=In,va=Ri,ya=na,ba=Ji,xa=fa,Sa=nn,Ca=ga,wa=`>`,Ta=`<`,Ea=`prototype`,Da=`script`,Oa=Ca(`IE_PROTO`),ka=function(){},Aa=function(e){return Ta+Da+wa+e+Ta+`/`+Da+wa},ja=function(e){e.write(Aa(``)),e.close();var t=e.parentWindow.Object;return e=null,t},Ma=function(){var e=Sa(`iframe`),t=`java`+Da+`:`,n;return e.style.display=`none`,xa.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(Aa(`document.F=Object`)),n.close(),n.F},Na,Pa=function(){try{Na=new ActiveXObject(`htmlfile`)}catch{}Pa=typeof document<`u`?document.domain&&Na?ja(Na):Ma():ja(Na);for(var e=ya.length;e--;)delete Pa[Ea][ya[e]];return Pa()};ba[Oa]=!0;var Fa=Object.create||function(e,t){var n;return e===null?n=Pa():(ka[Ea]=_a(e),n=new ka,ka[Ea]=null,n[Oa]=e),t===void 0?n:va.f(n,t)},Ia={},La=ta,Ra=na.concat(`length`,`prototype`);Ia.f=Object.getOwnPropertyNames||function(e){return La(e,Ra)};var za={},Ba=Hi,Va=wr,Ha=jr,Ua=Array,Wa=Math.max,Ga=function(e,t,n){for(var r=Va(e),i=Ba(t,r),a=Ba(n===void 0?r:n,r),o=Ua(Wa(a-i,0)),s=0;i<a;i++,s++)Ha(o,s,e[i]);return o.length=s,o},Ka=S,qa=k,Ja=Ia.f,Ya=Ga,Xa=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Za=function(e){try{return Ja(e)}catch{return Ya(Xa)}};za.f=function(e){return Xa&&Ka(e)===`Window`?Za(e):Ja(qa(e))};var Qa={};Qa.f=Object.getOwnPropertySymbols;var $a=Yn,eo=function(e,t,n,r){return r&&r.enumerable?e[t]=n:$a(e,t,n),e},to=jn,no=function(e,t,n){return to.f(e,t,n)},ro={};ro.f=Bt;var io=M,ao=Tt,oo=ro,so=jn.f,co=function(e){var t=io.Symbol||={};ao(t,e)||so(t,e,{value:oo.f(e)})},lo=O,uo=P,fo=Bt,po=eo,mo=function(){var e=uo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=fo(`toPrimitive`);t&&!t[r]&&po(t,r,function(e){return lo(n,this)},{arity:1})},ho=Pr,go=Hr,_o=ho?{}.toString:function(){return`[object `+go(this)+`]`},vo=Pr,yo=jn.f,bo=Yn,xo=Tt,So=_o,Co=Bt(`toStringTag`),wo=function(e,t,n,r){if(e){var i=n?e:e.prototype;xo(i,Co)||yo(i,Co,{configurable:!0,value:t}),r&&!vo&&bo(i,`toString`,So)}},To=o,Eo=T,Do=To.WeakMap,Oo=Eo(Do)&&/native code/.test(String(Do)),ko=o,Ao=j,jo=Yn,Mo=Tt,No=gt,Po=ga,Fo=Ji,Io=`Object already initialized`,Lo=ko.TypeError,Ro=ko.WeakMap,zo,Bo,Vo,Ho=function(e){return Vo(e)?Bo(e):zo(e,{})},Uo=function(e){return function(t){var n;if(!Ao(t)||(n=Bo(t)).type!==e)throw new Lo(`Incompatible receiver, `+e+` required`);return n}};if(Oo||No.state){var Wo=No.state||=new Ro;Wo.get=Wo.get,Wo.has=Wo.has,Wo.set=Wo.set,zo=function(e,t){if(Wo.has(e))throw new Lo(Io);return t.facade=e,Wo.set(e,t),t},Bo=function(e){return Wo.get(e)||{}},Vo=function(e){return Wo.has(e)}}else{var Go=Po(`state`);Fo[Go]=!0,zo=function(e,t){if(Mo(e,Go))throw new Lo(Io);return t.facade=e,jo(e,Go,t),t},Bo=function(e){return Mo(e,Go)?e[Go]:{}},Vo=function(e){return Mo(e,Go)}}var Ko={set:zo,get:Bo,has:Vo,enforce:Ho,getterFor:Uo},qo=An,Jo=v,Yo=ge,Xo=xt,Zo=wr,Qo=mi,$o=Jo([].push),es=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=Xo(c),p=Yo(f),m=qo(l,u),h=Zo(p),g=0,_=d||Qo,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:$o(v,y)}else switch(e){case 4:return!1;case 7:$o(v,y)}return a?-1:r||i?i:v}},ts={forEach:es(0),map:es(1),filter:es(2),some:es(3),every:es(4),find:es(5),findIndex:es(6),filterReject:es(7)},ns=z,rs=o,is=O,as=v,os=D,ss=Be,cs=s,ls=Tt,us=F,ds=In,fs=k,ps=Zt,ms=Li,hs=ue,gs=Fa,_s=aa,vs=Ia,ys=za,bs=Qa,xs=E,Ss=jn,Cs=Ri,ws=se,Ts=eo,Es=no,Ds=vt,Os=ga,ks=Ji,As=At,js=Bt,Ms=ro,Ns=co,Ps=mo,Fs=wo,Is=Ko,Ls=ts.forEach,Rs=Os(`hidden`),zs=`Symbol`,Bs=`prototype`,Vs=Is.set,Hs=Is.getterFor(zs),Us=Object[Bs],Ws=rs.Symbol,Gs=Ws&&Ws[Bs],Ks=rs.RangeError,qs=rs.TypeError,Js=rs.QObject,Ys=xs.f,Xs=Ss.f,Zs=ys.f,Qs=ws.f,$s=as([].push),ec=Ds(`symbols`),tc=Ds(`op-symbols`),nc=Ds(`wks`),rc=!Js||!Js[Bs]||!Js[Bs].findChild,ic=function(e,t,n){var r=Ys(Us,t);r&&delete Us[t],Xs(e,t,n),r&&e!==Us&&Xs(Us,t,r)},ac=os&&cs(function(){return gs(Xs({},`a`,{get:function(){return Xs(this,`a`,{value:7}).a}})).a!==7})?ic:Xs,oc=function(e,t){var n=ec[e]=gs(Gs);return Vs(n,{type:zs,tag:e,description:t}),os||(n.description=t),n},sc=function(e,t,n){e===Us&&sc(tc,t,n),ds(e);var r=ps(t);return ds(n),ls(ec,r)?(n.enumerable?(ls(e,Rs)&&e[Rs][r]&&(e[Rs][r]=!1),n=gs(n,{enumerable:hs(0,!1)})):(ls(e,Rs)||Xs(e,Rs,hs(1,{})),e[Rs][r]=!0),ac(e,r,n)):Xs(e,r,n)},cc=function(e,t){ds(e);var n=fs(t);return Ls(_s(n).concat(pc(n)),function(t){(!os||is(uc,n,t))&&sc(e,t,n[t])}),e},lc=function(e,t){return t===void 0?gs(e):cc(gs(e),t)},uc=function(e){var t=ps(e),n=is(Qs,this,t);return this===Us&&ls(ec,t)&&!ls(tc,t)?!1:n||!ls(this,t)||!ls(ec,t)||ls(this,Rs)&&this[Rs][t]?n:!0},dc=function(e,t){var n=fs(e),r=ps(t);if(!(n===Us&&ls(ec,r)&&!ls(tc,r))){var i=Ys(n,r);return i&&ls(ec,r)&&!(ls(n,Rs)&&n[Rs][r])&&(i.enumerable=!0),i}},fc=function(e){var t=Zs(fs(e)),n=[];return Ls(t,function(e){!ls(ec,e)&&!ls(ks,e)&&$s(n,e)}),n},pc=function(e){var t=e===Us,n=Zs(t?tc:fs(e)),r=[];return Ls(n,function(e){ls(ec,e)&&(!t||ls(Us,e))&&$s(r,ec[e])}),r};ss||(Ws=function(){if(us(Gs,this))throw new qs(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ms(arguments[0]),t=As(e),n=function(e){var r=this===void 0?rs:this;r===Us&&is(n,tc,e),ls(r,Rs)&&ls(r[Rs],t)&&(r[Rs][t]=!1);var i=hs(1,e);try{ac(r,t,i)}catch(e){if(!(e instanceof Ks))throw e;ic(r,t,i)}};return os&&rc&&ac(Us,t,{configurable:!0,set:n}),oc(t,e)},Gs=Ws[Bs],Ts(Gs,`toString`,function(){return Hs(this).tag}),Ts(Ws,`withoutSetter`,function(e){return oc(As(e),e)}),ws.f=uc,Ss.f=sc,Cs.f=cc,xs.f=dc,vs.f=ys.f=fc,bs.f=pc,Ms.f=function(e){return oc(js(e),e)},os&&Es(Gs,`description`,{configurable:!0,get:function(){return Hs(this).description}})),ns({global:!0,constructor:!0,wrap:!0,forced:!ss,sham:!ss},{Symbol:Ws}),Ls(_s(nc),function(e){Ns(e)}),ns({target:zs,stat:!0,forced:!ss},{useSetter:function(){rc=!0},useSimple:function(){rc=!1}}),ns({target:`Object`,stat:!0,forced:!ss,sham:!os},{create:lc,defineProperty:sc,defineProperties:cc,getOwnPropertyDescriptor:dc}),ns({target:`Object`,stat:!0,forced:!ss},{getOwnPropertyNames:fc}),Ps(),Fs(Ws,zs),ks[Rs]=!0;var mc=Be&&!!Symbol.for&&!!Symbol.keyFor,hc=z,gc=P,_c=Tt,vc=Li,yc=vt,bc=mc,xc=yc(`string-to-symbol-registry`),V=yc(`symbol-to-string-registry`);hc({target:`Symbol`,stat:!0,forced:!bc},{for:function(e){var t=vc(e);if(_c(xc,t))return xc[t];var n=gc(`Symbol`)(t);return xc[t]=n,V[n]=t,n}});var Sc=z,Cc=Tt,wc=qe,Tc=Ye,Ec=vt,Dc=mc,Oc=Ec(`symbol-to-string-registry`);Sc({target:`Symbol`,stat:!0,forced:!Dc},{keyFor:function(e){if(!wc(e))throw TypeError(Tc(e)+` is not a symbol`);if(Cc(Oc,e))return Oc[e]}});var kc=v([].slice),Ac=v,jc=gr,Mc=T,Nc=S,Pc=Li,Fc=Ac([].push),Ic=function(e){if(Mc(e))return e;if(jc(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Fc(n,i):(typeof i==`number`||Nc(i)===`Number`||Nc(i)===`String`)&&Fc(n,Pc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(jc(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Lc=z,Rc=P,zc=p,Bc=O,Vc=v,Hc=s,Uc=T,Wc=qe,Gc=kc,Kc=Ic,qc=Be,Jc=String,Yc=Rc(`JSON`,`stringify`),Xc=Vc(/./.exec),Zc=Vc(``.charAt),Qc=Vc(``.charCodeAt),$c=Vc(``.replace),el=Vc(1 .toString),tl=/[\uD800-\uDFFF]/g,nl=/^[\uD800-\uDBFF]$/,rl=/^[\uDC00-\uDFFF]$/,il=!qc||Hc(function(){var e=Rc(`Symbol`)(`stringify detection`);return Yc([e])!==`[null]`||Yc({a:e})!==`{}`||Yc(Object(e))!==`{}`}),al=Hc(function(){return Yc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Yc(`\udead`)!==`"\\udead"`}),ol=function(e,t){var n=Gc(arguments),r=Kc(t);if(!(!Uc(r)&&(e===void 0||Wc(e))))return n[1]=function(e,t){if(Uc(r)&&(t=Bc(r,this,Jc(e),t)),!Wc(t))return t},zc(Yc,null,n)},sl=function(e,t,n){var r=Zc(n,t-1),i=Zc(n,t+1);return Xc(nl,e)&&!Xc(rl,i)||Xc(rl,e)&&!Xc(nl,r)?`\\u`+el(Qc(e,0),16):e};Yc&&Lc({target:`JSON`,stat:!0,arity:3,forced:il||al},{stringify:function(e,t,n){var r=Gc(arguments),i=zc(il?ol:Yc,null,r);return al&&typeof i==`string`?$c(i,tl,sl):i}});var cl=z,ll=Be,ul=s,dl=Qa,fl=xt;cl({target:`Object`,stat:!0,forced:!ll||ul(function(){dl.f(1)})},{getOwnPropertySymbols:function(e){var t=dl.f;return t?t(fl(e)):[]}}),co(`asyncIterator`),co(`hasInstance`),co(`isConcatSpreadable`),co(`iterator`),co(`match`),co(`matchAll`),co(`replace`),co(`search`),co(`species`),co(`split`);var pl=co,ml=mo;pl(`toPrimitive`),ml();var hl=P,gl=co,_l=wo;gl(`toStringTag`),_l(hl(`Symbol`),`Symbol`),co(`unscopables`),wo(o.JSON,`JSON`,!0);var vl=M.Symbol,yl={},bl=D,xl=Tt,Sl=Function.prototype,Cl=bl&&Object.getOwnPropertyDescriptor,wl=xl(Sl,`name`),Tl={EXISTS:wl,PROPER:wl&&(function(){}).name===`something`,CONFIGURABLE:wl&&(!bl||bl&&Cl(Sl,`name`).configurable)},El=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dl=Tt,Ol=T,kl=xt,Al=ga,jl=El,Ml=Al(`IE_PROTO`),Nl=Object,Pl=Nl.prototype,Fl=jl?Nl.getPrototypeOf:function(e){var t=kl(e);if(Dl(t,Ml))return t[Ml];var n=t.constructor;return Ol(n)&&t instanceof n?n.prototype:t instanceof Nl?Pl:null},Il=s,Ll=T,Rl=j,zl=Fa,Bl=Fl,Vl=eo,Hl=Bt(`iterator`),Ul=!1,Wl,Gl,Kl;[].keys&&(Kl=[].keys(),`next`in Kl?(Gl=Bl(Bl(Kl)),Gl!==Object.prototype&&(Wl=Gl)):Ul=!0),Wl=!Rl(Wl)||Il(function(){var e={};return Wl[Hl].call(e)!==e})?{}:zl(Wl),Ll(Wl[Hl])||Vl(Wl,Hl,function(){return this});var ql={IteratorPrototype:Wl,BUGGY_SAFARI_ITERATORS:Ul},Jl=ql.IteratorPrototype,Yl=Fa,Xl=ue,Zl=wo,Ql=yl,$l=function(){return this},eu=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Yl(Jl,{next:Xl(+!r,n)}),Zl(e,i,!1,!0),Ql[i]=$l,e},tu=v,nu=$e,ru=function(e,t,n){try{return tu(nu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},iu=T,au=String,ou=TypeError,su=function(e){if(typeof e==`object`||iu(e))return e;throw new ou(`Can't set `+au(e)+` as a prototype`)},cu=ru,lu=In,uu=su,du=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=cu(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return lu(t),uu(r),e?n(t,r):t.__proto__=r,t}}():void 0),fu=z,pu=O,mu=Tl,hu=eu,gu=Fl,_u=wo,vu=eo,yu=Bt,bu=yl,xu=ql,Su=mu.PROPER;mu.CONFIGURABLE,xu.IteratorPrototype;var Cu=xu.BUGGY_SAFARI_ITERATORS,wu=yu(`iterator`),Tu=`keys`,Eu=`values`,Du=`entries`,Ou=function(){return this},ku=function(e,t,n,r,i,a,o){hu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Cu&&e&&e in u)return u[e];switch(e){case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)};case Du:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[wu]||u[`@@iterator`]||i&&u[i],f=!Cu&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=gu(p.call(new e)),m!==Object.prototype&&m.next&&(_u(m,c,!0,!0),bu[c]=Ou)),Su&&i===Eu&&d&&d.name!==Eu&&(l=!0,f=function(){return pu(d,this)}),i)if(h={values:s(Eu),keys:a?f:s(Tu),entries:s(Du)},o)for(g in h)(Cu||l||!(g in u))&&vu(u,g,h[g]);else fu({target:t,proto:!0,forced:Cu||l},h);return o&&u[wu]!==f&&vu(u,wu,f,{name:i}),bu[t]=f,h},Au=function(e,t){return{value:e,done:t}},ju=k,Mu=yl,Nu=Ko;jn.f;var Pu=ku,Fu=Au,Iu=`Array Iterator`,Lu=Nu.set,Ru=Nu.getterFor(Iu);Pu(Array,`Array`,function(e,t){Lu(this,{type:Iu,target:ju(e),index:0,kind:t})},function(){var e=Ru(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Fu(void 0,!0);switch(e.kind){case`keys`:return Fu(n,!1);case`values`:return Fu(t[n],!1)}return Fu([n,t[n]],!1)},`values`),Mu.Arguments=Mu.Array;var zu={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},Bu=o,Vu=Hr,Hu=Yn,Uu=yl,Wu=Bt(`toStringTag`);for(var Gu in zu){var Ku=Bu[Gu],qu=Ku&&Ku.prototype;qu&&Vu(qu)!==Wu&&Hu(qu,Wu,Gu),Uu[Gu]=Uu.Array}var Ju=vl,Yu=Bt,Xu=jn.f,Zu=Yu(`metadata`),Qu=Function.prototype;Qu[Zu]===void 0&&Xu(Qu,Zu,{value:null}),co(`asyncDispose`),co(`dispose`),co(`metadata`);var $u=Ju,ed=P,td=v,nd=ed(`Symbol`),rd=nd.keyFor,id=td(nd.prototype.valueOf),ad=nd.isRegisteredSymbol||function(e){try{return rd(id(e))!==void 0}catch{return!1}};z({target:`Symbol`,stat:!0},{isRegisteredSymbol:ad});for(var od=vt,sd=P,cd=v,ld=qe,ud=Bt,dd=sd(`Symbol`),fd=dd.isWellKnownSymbol,pd=sd(`Object`,`getOwnPropertyNames`),md=cd(dd.prototype.valueOf),hd=od(`wks`),gd=0,_d=pd(dd),vd=_d.length;gd<vd;gd++)try{var yd=_d[gd];ld(dd[yd])&&ud(yd)}catch{}var bd=function(e){if(fd&&fd(e))return!0;try{for(var t=md(e),n=0,r=pd(hd),i=r.length;n<i;n++)if(hd[r[n]]==t)return!0}catch{}return!1};z({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:bd}),co(`matcher`),co(`observable`),z({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:ad}),z({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:bd}),co(`metadataKey`),co(`patternMatch`),co(`replaceAll`);var xd=$u,Sd=r(xd),Cd=v,wd=br,Td=Li,Ed=be,Dd=Cd(``.charAt),Od=Cd(``.charCodeAt),kd=Cd(``.slice),Ad=function(e){return function(t,n){var r=Td(Ed(t)),i=wd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Od(r,i),o<55296||o>56319||i+1===a||(s=Od(r,i+1))<56320||s>57343?e?Dd(r,i):o:e?kd(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jd={codeAt:Ad(!1),charAt:Ad(!0)}.charAt,Md=Li,Nd=Ko,Pd=ku,Fd=Au,Id=`String Iterator`,Ld=Nd.set,Rd=Nd.getterFor(Id);Pd(String,`String`,function(e){Ld(this,{type:Id,string:Md(e),index:0})},function(){var e=Rd(this),t=e.string,n=e.index,r;return n>=t.length?Fd(void 0,!0):(r=jd(t,n),e.index+=r.length,Fd(r,!1))});var zd=ro.f(`iterator`),Bd=zd,Vd=r(Bd);function Hd(e){"@babel/helpers - typeof";return Hd=typeof Sd==`function`&&typeof Vd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Sd==`function`&&e.constructor===Sd&&e!==Sd.prototype?`symbol`:typeof e},Hd(e)}var Ud=r(ro.f(`toPrimitive`));function Wd(e,t){if(Hd(e)!==`object`||e===null)return e;var n=e[Ud];if(n!==void 0){var r=n.call(e,t||`default`);if(Hd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gd(e){var t=Wd(e,`string`);return Hd(t)===`symbol`?t:String(t)}function Kd(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),mr(e,Gd(r.key),r)}}function qd(e,t,n){return t&&Kd(e.prototype,t),n&&Kd(e,n),mr(e,`prototype`,{writable:!1}),e}function Jd(e,t,n){return t=Gd(t),t in e?mr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yd=v,Xd=$e,Zd=j,Qd=Tt,$d=kc,ef=c,tf=Function,nf=Yd([].concat),rf=Yd([].join),af={},of=function(e,t,n){if(!Qd(af,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;af[t]=tf(`C,a`,`return new C(`+rf(r,`,`)+`)`)}return af[t](e,n)},sf=ef?tf.bind:function(e){var t=Xd(this),n=t.prototype,r=$d(arguments,1),i=function(){var n=nf(r,$d(arguments));return this instanceof i?of(t,n.length,n):t.apply(e,n)};return Zd(n)&&(i.prototype=n),i},cf=z,lf=sf;cf({target:`Function`,proto:!0,forced:Function.bind!==lf},{bind:lf});var uf=o,df=M,ff=function(e,t){var n=df[e+`Prototype`],r=n&&n[t];if(r)return r;var i=uf[e],a=i&&i.prototype;return a&&a[t]},pf=ff(`Function`,`bind`),mf=F,hf=pf,gf=Function.prototype,_f=function(e){var t=e.bind;return e===gf||mf(gf,e)&&t===gf.bind?hf:t},vf=r(_f),yf=$e,bf=xt,xf=ge,Sf=wr,Cf=TypeError,wf=function(e){return function(t,n,r,i){yf(n);var a=bf(t),o=xf(a),s=Sf(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 Cf(`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}},Tf={left:wf(!1),right:wf(!0)},H=s,Ef=function(e,t){var n=[][e];return!!n&&H(function(){n.call(null,t||function(){return 1},1)})},Df=S(o.process)===`process`,Of=z,kf=Tf.left,Af=Ef,jf=Ie;Of({target:`Array`,proto:!0,forced:!Df&&jf>79&&jf<83||!Af(`reduce`)},{reduce:function(e){var t=arguments.length;return kf(this,e,t,t>1?arguments[1]:void 0)}});var Mf=ff(`Array`,`reduce`),Nf=F,Pf=Mf,Ff=Array.prototype,If=r(function(e){var t=e.reduce;return e===Ff||Nf(Ff,e)&&t===Ff.reduce?Pf:t}),Lf=z,Rf=ts.filter;Lf({target:`Array`,proto:!0,forced:!yi(`filter`)},{filter:function(e){return Rf(this,e,arguments.length>1?arguments[1]:void 0)}});var zf=ff(`Array`,`filter`),Bf=F,Vf=zf,Hf=Array.prototype,Uf=r(function(e){var t=e.filter;return e===Hf||Bf(Hf,e)&&t===Hf.filter?Vf:t}),Wf=z,Gf=ts.map;Wf({target:`Array`,proto:!0,forced:!yi(`map`)},{map:function(e){return Gf(this,e,arguments.length>1?arguments[1]:void 0)}});var Kf=ff(`Array`,`map`),qf=F,Jf=Kf,Yf=Array.prototype,Xf=r(function(e){var t=e.map;return e===Yf||qf(Yf,e)&&t===Yf.map?Jf:t}),Zf=gr,Qf=wr,$f=Dr,ep=An,tp=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?ep(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Zf(d)?(f=Qf(d),c=tp(e,t,d,f,c,a-1)-1):($f(c+1),e[c]=d),c++),l++;return c},np=tp,rp=z,ip=np,ap=$e,op=xt,sp=wr,cp=mi;rp({target:`Array`,proto:!0},{flatMap:function(e){var t=op(this),n=sp(t),r;return ap(e),r=cp(t,0),r.length=ip(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var lp=ff(`Array`,`flatMap`),up=F,dp=lp,fp=Array.prototype,pp=r(function(e){var t=e.flatMap;return e===fp||up(fp,e)&&t===fp.flatMap?dp:t});function mp(e){return new gp(e)}var hp=function(){function e(n,r,i){var a,o,s;t(this,e),Jd(this,`_listeners`,{add:vf(a=this._add).call(a,this),remove:vf(o=this._remove).call(o,this),update:vf(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return qd(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 If(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}(),gp=function(){function e(n){t(this,e),Jd(this,`_transformers`,[]),this._source=n}return qd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Uf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Xf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return pp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new hp(this._source,this._transformers,e)}}]),e}(),_p=O,vp=In,yp=nt,bp=function(e,t,n){var r,i;vp(e);try{if(r=yp(e,`return`),!r){if(t===`throw`)throw n;return n}r=_p(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return vp(r),n},xp=In,Sp=bp,Cp=function(e,t,n,r){try{return r?t(xp(n)[0],n[1]):t(n)}catch(t){Sp(e,`throw`,t)}},wp=Bt,Tp=yl,Ep=wp(`iterator`),Dp=Array.prototype,Op=function(e){return e!==void 0&&(Tp.Array===e||Dp[Ep]===e)},kp=Hr,Ap=nt,jp=_e,Mp=yl,Np=Bt(`iterator`),Pp=function(e){if(!jp(e))return Ap(e,Np)||Ap(e,`@@iterator`)||Mp[kp(e)]},Fp=O,Ip=$e,Lp=In,Rp=Ye,zp=Pp,Bp=TypeError,Vp=function(e,t){var n=arguments.length<2?zp(e):t;if(Ip(n))return Lp(Fp(n,e));throw new Bp(Rp(e)+` is not iterable`)},Hp=An,Up=O,Wp=xt,Gp=Cp,Kp=Op,qp=si,Jp=wr,Yp=jr,Xp=Vp,Zp=Pp,Qp=Array,$p=function(e){var t=Wp(e),n=qp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Hp(i,r>2?arguments[2]:void 0));var o=Zp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Qp&&Kp(o)))for(d=Xp(t,o),f=d.next,l=n?new this:[];!(u=Up(f,d)).done;s++)p=a?Gp(d,i,[u.value,s],!0):u.value,Yp(l,s,p);else for(c=Jp(t),l=n?new this(c):Qp(c);c>s;s++)p=a?i(t[s],s):t[s],Yp(l,s,p);return l.length=s,l},em=Bt(`iterator`),tm=!1;try{var nm=0,rm={next:function(){return{done:!!nm++}},return:function(){tm=!0}};rm[em]=function(){return this},Array.from(rm,function(){throw 2})}catch{}var im=function(e,t){try{if(!t&&!tm)return!1}catch{return!1}var n=!1;try{var r={};r[em]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},am=z,om=$p;am({target:`Array`,stat:!0,forced:!im(function(e){Array.from(e)})},{from:om});var sm=M.Array.from,cm=r(sm),lm=Pp,um=r(lm),dm=r(lm);z({target:`Array`,stat:!0},{isArray:gr});var fm=M.Array.isArray,pm=r(fm);function mm(e){if(pm(e))return e}var hm=D,gm=gr,_m=TypeError,vm=Object.getOwnPropertyDescriptor,ym=hm&&!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(gm(e)&&!vm(e,`length`).writable)throw new _m(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},bm=z,xm=xt,Sm=wr,Cm=ym,wm=Dr;bm({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=xm(this),n=Sm(t),r=arguments.length;wm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Cm(t,n),n}});var Tm=ff(`Array`,`push`),Em=F,Dm=Tm,Om=Array.prototype,km=function(e){var t=e.push;return e===Om||Em(Om,e)&&t===Om.push?Dm:t},Am=r(km);function jm(e,t){var n=e==null?null:Sd!==void 0&&um(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)&&(Am(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 Mm=z,Nm=gr,Pm=si,Fm=j,Im=Hi,Lm=wr,Rm=k,zm=jr,Bm=Bt,Vm=yi,Hm=kc,Um=Vm(`slice`),Wm=Bm(`species`),Gm=Array,Km=Math.max;Mm({target:`Array`,proto:!0,forced:!Um},{slice:function(e,t){var n=Rm(this),r=Lm(n),i=Im(e,r),a=Im(t===void 0?r:t,r),o,s,c;if(Nm(n)&&(o=n.constructor,Pm(o)&&(o===Gm||Nm(o.prototype))?o=void 0:Fm(o)&&(o=o[Wm],o===null&&(o=void 0)),o===Gm||o===void 0))return Hm(n,i,a);for(s=new(o===void 0?Gm:o)(Km(a-i,0)),c=0;i<a;i++,c++)i in n&&zm(s,c,n[i]);return s.length=c,s}});var qm=ff(`Array`,`slice`),Jm=F,Ym=qm,Xm=Array.prototype,Zm=function(e){var t=e.slice;return e===Xm||Jm(Xm,e)&&t===Xm.slice?Ym:t},Qm=Zm,$m=r(Qm),eh=r(sm);function th(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 nh(e,t){var n;if(e){if(typeof e==`string`)return th(e,t);var r=$m(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return eh(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return th(e,t)}}function rh(){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 ih(e,t){return mm(e)||jm(e,t)||nh(e,t)||rh()}function ah(e){if(pm(e))return th(e)}function oh(e){if(Sd!==void 0&&um(e)!=null||e[`@@iterator`]!=null)return eh(e)}function sh(){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 ch(e){return ah(e)||oh(e)||nh(e)||sh()}var lh=r(Ju),uh=ff(`Array`,`concat`),dh=F,fh=uh,ph=Array.prototype,mh=r(function(e){var t=e.concat;return e===ph||dh(ph,e)&&t===ph.concat?fh:t}),hh=r(Zm),gh=P,_h=v,vh=Ia,yh=Qa,bh=In,xh=_h([].concat),Sh=gh(`Reflect`,`ownKeys`)||function(e){var t=vh.f(bh(e)),n=yh.f;return n?xh(t,n(e)):t};z({target:`Reflect`,stat:!0},{ownKeys:Sh});var Ch=M.Reflect.ownKeys,wh=r(Ch),Th=r(fm),Eh=z,Dh=xt,Oh=aa;Eh({target:`Object`,stat:!0,forced:s(function(){Oh(1)})},{keys:function(e){return Oh(Dh(e))}});var kh=M.Object.keys,Ah=r(kh),jh=ts.forEach,Mh=Ef(`forEach`)?[].forEach:function(e){return jh(this,e,arguments.length>1?arguments[1]:void 0)},Nh=z,Ph=Mh;Nh({target:`Array`,proto:!0,forced:[].forEach!==Ph},{forEach:Ph});var Fh=ff(`Array`,`forEach`),Ih=Hr,Lh=Tt,Rh=F,zh=Fh,Bh=Array.prototype,Vh={DOMTokenList:!0,NodeList:!0},Hh=function(e){var t=e.forEach;return e===Bh||Rh(Bh,e)&&t===Bh.forEach||Lh(Vh,Ih(e))?zh:t},Uh=r(Hh),Wh=z,Gh=v,Kh=gr,qh=Gh([].reverse),Jh=[1,2];Wh({target:`Array`,proto:!0,forced:String(Jh)===String(Jh.reverse())},{reverse:function(){return Kh(this)&&(this.length=this.length),qh(this)}});var Yh=ff(`Array`,`reverse`),Xh=F,Zh=Yh,Qh=Array.prototype,$h=function(e){var t=e.reverse;return e===Qh||Xh(Qh,e)&&t===Qh.reverse?Zh:t},eg=r($h),tg=Ye,ng=TypeError,rg=function(e,t){if(!delete e[t])throw new ng(`Cannot delete property `+tg(t)+` of `+tg(e))},ig=z,ag=xt,og=Hi,sg=br,cg=wr,lg=ym,ug=Dr,dg=mi,fg=jr,pg=rg,mg=yi(`splice`),hg=Math.max,gg=Math.min;ig({target:`Array`,proto:!0,forced:!mg},{splice:function(e,t){var n=ag(this),r=cg(n),i=og(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=gg(hg(sg(t),0),r-i)),ug(r+o-s),c=dg(n,s),l=0;l<s;l++)u=i+l,u in n&&fg(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]:pg(n,d);for(l=r;l>r-s+o;l--)pg(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]:pg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return lg(n,r-s+o),c}});var _g=ff(`Array`,`splice`),vg=F,yg=_g,bg=Array.prototype,xg=r(function(e){var t=e.splice;return e===bg||vg(bg,e)&&t===bg.splice?yg:t}),Sg=D,Cg=v,wg=O,Tg=s,Eg=aa,Dg=Qa,Og=se,kg=xt,Ag=ge,jg=Object.assign,Mg=Object.defineProperty,Ng=Cg([].concat),Pg=!jg||Tg(function(){if(Sg&&jg({b:1},jg(Mg({},`a`,{enumerable:!0,get:function(){Mg(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}),jg({},e)[n]!==7||Eg(jg({},t)).join(``)!==r})?function(e,t){for(var n=kg(e),r=arguments.length,i=1,a=Dg.f,o=Og.f;r>i;)for(var s=Ag(arguments[i++]),c=a?Ng(Eg(s),a(s)):Eg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!Sg||wg(o,s,d))&&(n[d]=s[d]);return n}:jg,Fg=z,Ig=Pg;Fg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Ig},{assign:Ig});var Lg=M.Object.assign,Rg=r(Lg),zg=z,Bg=s,Vg=xt,Hg=Fl,Ug=El;zg({target:`Object`,stat:!0,forced:Bg(function(){Hg(1)}),sham:!Ug},{getPrototypeOf:function(e){return Hg(Vg(e))}});var Wg=M.Object.getPrototypeOf;z({target:`Object`,stat:!0,sham:!D},{create:Fa});var Gg=M.Object,Kg=function(e,t){return Gg.create(e,t)},qg=r(Kg),Jg=M,Yg=p;Jg.JSON||={stringify:JSON.stringify};var Xg=r(function(e,t,n){return Yg(Jg.JSON.stringify,null,arguments)}),Zg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Qg=TypeError,$g=function(e,t){if(e<t)throw new Qg(`Not enough arguments`);return e},e_=o,t_=p,n_=T,r_=Zg,i_=Oe,a_=kc,o_=$g,s_=e_.Function,c_=/MSIE .\./.test(i_)||r_&&(function(){var e=e_.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),l_=function(e,t){var n=t?2:1;return c_?function(r,i){var a=o_(arguments.length,1)>n,o=n_(r)?r:s_(r),s=a?a_(arguments,n):[],c=a?function(){t_(o,this,s)}:o;return t?e(c,i):e(c)}:e},u_=z,d_=o,f_=l_(d_.setInterval,!0);u_({global:!0,bind:!0,forced:d_.setInterval!==f_},{setInterval:f_});var p_=z,m_=o,h_=l_(m_.setTimeout,!0);p_({global:!0,bind:!0,forced:m_.setTimeout!==h_},{setTimeout:h_});var g_=M.setTimeout,__=r(g_),v_={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})(v_);var y_=v_.exports,b_=r(y_);function x_(){return x_=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},x_.apply(this,arguments)}function S_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function C_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var w_=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},T_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],E_=typeof document>`u`?{style:{}}:document.createElement(`div`),D_=`function`,O_=Math.round,k_=Math.abs,A_=Date.now;function j_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<T_.length;){if(n=T_[a],r=n?n+i:t,r in e)return r;a++}}var M_=typeof window>`u`?{}:window,N_=j_(E_.style,`touchAction`),P_=N_!==void 0;function F_(){if(!P_)return!1;var e={},t=M_.CSS&&M_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?M_.CSS.supports(`touch-action`,n):!0}),e}var I_=`compute`,L_=`auto`,R_=`manipulation`,z_=`none`,B_=`pan-x`,V_=`pan-y`,H_=F_(),U_=/mobile|tablet|ip(ad|hone|od)|android/i,W_=`ontouchstart`in M_,G_=j_(M_,`PointerEvent`)!==void 0,K_=W_&&U_.test(navigator.userAgent),q_=`touch`,J_=`pen`,Y_=`mouse`,X_=`kinect`,Z_=25,Q_=1,$_=2,ev=4,tv=8,nv=1,rv=2,iv=4,av=8,ov=16,sv=rv|iv,cv=av|ov,lv=sv|cv,uv=[`x`,`y`],dv=[`clientX`,`clientY`];function fv(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 pv(e,t){return typeof e===D_?e.apply(t&&t[0]||void 0,t):e}function mv(e,t){return e.indexOf(t)>-1}function hv(e){if(mv(e,z_))return z_;var t=mv(e,B_),n=mv(e,V_);return t&&n?z_:t||n?t?B_:V_:mv(e,R_)?R_:L_}var gv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===I_&&(e=this.compute()),P_&&this.manager.element.style&&H_[e]&&(this.manager.element.style[N_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return fv(this.manager.recognizers,function(t){pv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),hv(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=mv(r,z_)&&!H_[z_],a=mv(r,V_)&&!H_[V_],o=mv(r,B_)&&!H_[B_];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&sv||o&&n&cv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function _v(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function vv(e){var t=e.length;if(t===1)return{x:O_(e[0].clientX),y:O_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:O_(n/t),y:O_(r/t)}}function yv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:O_(e.pointers[n].clientX),clientY:O_(e.pointers[n].clientY)},n++;return{timeStamp:A_(),pointers:t,center:vv(t),deltaX:e.deltaX,deltaY:e.deltaY}}function bv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function xv(e,t,n){n||=uv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function Sv(e,t){return e===t?nv:k_(e)>=k_(t)?e<0?rv:iv:t<0?av:ov}function Cv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Q_||a.eventType===ev)&&(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 wv(e,t,n){return{x:t/e||0,y:n/e||0}}function Tv(e,t){return bv(t[0],t[1],dv)/bv(e[0],e[1],dv)}function Ev(e,t){return xv(t[1],t[0],dv)+xv(e[1],e[0],dv)}function Dv(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==tv&&(r>Z_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=wv(r,c,l);a=u.x,o=u.y,i=k_(u.x)>k_(u.y)?u.x:u.y,s=Sv(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 Ov(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=yv(t),i>1&&!n.firstMultiple?n.firstMultiple=yv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=vv(r);t.timeStamp=A_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=xv(s,c),t.distance=bv(s,c),Cv(n,t),t.offsetDirection=Sv(t.deltaX,t.deltaY);var l=wv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=k_(l.x)>k_(l.y)?l.x:l.y,t.scale=o?Tv(o.pointers,r):1,t.rotation=o?Ev(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Dv(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;_v(f,u)&&(u=f),t.target=u}function kv(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Q_&&r-i===0,o=t&(ev|tv)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Ov(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function Av(e){return e.trim().split(/\s+/g)}function jv(e,t,n){fv(Av(t),function(t){e.addEventListener(t,n,!1)})}function U(e,t,n){fv(Av(t),function(t){e.removeEventListener(t,n,!1)})}function Mv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Nv=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){pv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&jv(this.element,this.evEl,this.domHandler),this.evTarget&&jv(this.target,this.evTarget,this.domHandler),this.evWin&&jv(Mv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&U(this.element,this.evEl,this.domHandler),this.evTarget&&U(this.target,this.evTarget,this.domHandler),this.evWin&&U(Mv(this.element),this.evWin,this.domHandler)},e}();function Pv(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 Fv={pointerdown:Q_,pointermove:$_,pointerup:ev,pointercancel:tv,pointerout:tv},Iv={2:q_,3:J_,4:Y_,5:X_},Lv=`pointerdown`,Rv=`pointermove pointerup pointercancel`;M_.MSPointerEvent&&!M_.PointerEvent&&(Lv=`MSPointerDown`,Rv=`MSPointerMove MSPointerUp MSPointerCancel`);var zv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=Lv,r.evWin=Rv,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=Fv[e.type.toLowerCase().replace(`ms`,``)],i=Iv[e.pointerType]||e.pointerType,a=i===q_,o=Pv(t,e.pointerId,`pointerId`);r&Q_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(ev|tv)&&(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}(Nv);function Bv(e){return Array.prototype.slice.call(e,0)}function Vv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Pv(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 Hv={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Uv=`touchstart touchmove touchend touchcancel`,Wv=function(e){S_(t,e);function t(){var n;return t.prototype.evTarget=Uv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Hv[e.type],n=Gv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})},t}(Nv);function Gv(e,t){var n=Bv(e.touches),r=this.targetIds;if(t&(Q_|$_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=Bv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return _v(e.target,c)}),t===Q_)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|tv)&&delete r[o[i].identifier],i++;if(s.length)return[Vv(a.concat(s),`identifier`,!0),s]}var Kv={mousedown:Q_,mousemove:$_,mouseup:ev},qv=`mousedown`,Jv=`mousemove mouseup`,Yv=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evEl=qv,r.evWin=Jv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Kv[e.type];t&Q_&&e.button===0&&(this.pressed=!0),t&$_&&e.which!==1&&(t=ev),this.pressed&&(t&ev&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Y_,srcEvent:e}))},t}(Nv),Xv=2500,Zv=25;function Qv(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)},Xv)}}function $v(e,t){e&Q_?(this.primaryTouch=t.changedPointers[0].identifier,Qv.call(this,t)):e&(ev|tv)&&Qv.call(this,t)}function ey(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<=Zv&&o<=Zv)return!0}return!1}var ty=function(){return function(e){S_(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===q_,a=n.pointerType===Y_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)$v.call(C_(C_(r)),t,n);else if(a&&ey.call(C_(C_(r)),n))return;r.callback(e,t,n)}},r.touch=new Wv(r.manager,r.handler),r.mouse=new Yv(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}(Nv)}();function ny(e){var t;return t=e.options.inputClass||(G_?zv:K_?Wv:W_?ty:Yv),new t(e,kv)}function ry(e,t,n){return Array.isArray(e)?(fv(e,n[t],n),!0):!1}var iy=1,ay=2,oy=4,sy=8,cy=sy,ly=16,uy=32,dy=1;function fy(){return dy++}function W(e,t){var n=t.manager;return n?n.get(e):e}function G(e){return e&ly?`cancel`:e&sy?`end`:e&oy?`move`:e&ay?`start`:``}var py=function(){function e(e){e===void 0&&(e={}),this.options=x_({enable:!0},e),this.id=fy(),this.manager=null,this.state=iy,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return w_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ry(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=W(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ry(e,`dropRecognizeWith`,this)?this:(e=W(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ry(e,`requireFailure`,this))return this;var t=this.requireFail;return e=W(e,this),Pv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ry(e,`dropRequireFailure`,this))return this;e=W(e,this);var t=Pv(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<sy&&r(t.options.event+G(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=sy&&r(t.options.event+G(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=uy},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(uy|iy)))return!1;e++}return!0},t.recognize=function(e){var t=w_({},e);if(!pv(this.options.enable,[this,t])){this.reset(),this.state=uy;return}this.state&(cy|ly|uy)&&(this.state=iy),this.state=this.process(t),this.state&(ay|oy|sy|ly)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),my=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({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[R_]},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&Q_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==ev)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||bv(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=cy,t.tryEmit()},n.interval),ay):cy}return uy},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=uy},this.options.interval),uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===cy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(py),hy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({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&(ay|oy),i=this.attrTest(e);return r&&(n&tv||!i)?t|ly:r||i?n&ev?t|sy:t&ay?t|oy:ay:uy},t}(py);function gy(e){return e===ov?`down`:e===av?`up`:e===rv?`left`:e===iv?`right`:``}var _y=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({event:`pan`,threshold:10,pointers:1,direction:lv},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&sv&&t.push(V_),e&cv&&t.push(B_),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&sv?(i=a===0?nv:a<0?rv:iv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?nv:o<0?av:ov,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return hy.prototype.attrTest.call(this,e)&&(this.state&ay||!(this.state&ay)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=gy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(hy),vy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`swipe`,threshold:10,velocity:.3,direction:sv|cv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return _y.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(sv|cv)?r=t.overallVelocity:n&sv?r=t.overallVelocityX:n&cv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&k_(r)>this.options.velocity&&t.eventType&ev},n.emit=function(e){var t=gy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(hy),yy=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ay)},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}(hy),by=function(e){S_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,x_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[z_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ay)},t}(hy),xy=function(e){S_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,x_({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[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._input=e,!i||!r||e.eventType&(ev|tv)&&!a)this.reset();else if(e.eventType&Q_)this.reset(),this._timer=setTimeout(function(){t.state=cy,t.tryEmit()},n.time);else if(e.eventType&ev)return cy;return uy},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===cy&&(e&&e.eventType&ev?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=A_(),this.manager.emit(this.options.event,this._input)))},t}(py),Sy={domEvents:!1,touchAction:I_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Cy=[[by,{enable:!1}],[yy,{enable:!1},[`rotate`]],[vy,{direction:sv}],[_y,{direction:sv},[`swipe`]],[my],[my,{event:`doubletap`,taps:2},[`tap`]],[xy]],wy=1,Ty=2;function Ey(e,t){var n=e.element;if(n.style){var r;fv(e.options.cssProps,function(i,a){r=j_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Dy(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Oy=function(){function e(e,t){var n=this;this.options=w_({},Sy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ny(this),this.touchAction=new gv(this,this.options.touchAction),Ey(this,!0),fv(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 w_(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?Ty:wy},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&cy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==Ty&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(ay|oy|sy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof py)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(ry(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(ry(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Pv(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 fv(Av(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 fv(Av(e),function(e){t?n[e]&&n[e].splice(Pv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Dy(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&&Ey(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),ky={touchstart:Q_,touchmove:$_,touchend:ev,touchcancel:tv},Ay=`touchstart`,jy=`touchstart touchmove touchend touchcancel`,My=function(e){S_(t,e);function t(){var n,r=t.prototype;return r.evTarget=Ay,r.evWin=jy,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=ky[e.type];if(t===Q_&&(this.started=!0),this.started){var n=Ny.call(this,e,t);t&(ev|tv)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:q_,srcEvent:e})}},t}(Nv);function Ny(e,t){var n=Bv(e.touches),r=Bv(e.changedTouches);return t&(ev|tv)&&(n=Vv(n.concat(r),`identifier`,!0)),[n,r]}function Py(e,t,n){var r=`DEPRECATED METHOD: `+t+`
|
|
4
4
|
`+n+` AT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./chunk-CAM3fms7.js";import{D as t}from"./useSubAccountSwitcher-
|
|
1
|
+
import{t as e}from"./chunk-CAM3fms7.js";import{D as t}from"./useSubAccountSwitcher-DMbRhLPv.js";var n=t(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),r=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ALL_GRAPH_LABELS=e.FALLBACK_LABEL_COLOUR=e.GRAPH_LABEL_COLOURS=void 0,e.pickDisplayLabel=t,e.colourForLabel=n,e.resolveNodeColour=r,e.formatRunTimestamp=o,e.formatMessageTimestamp=s,e.pickShortLabel=c,e.pickDisplayName=l,e.GRAPH_LABEL_COLOURS={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Listing:`#3F5670`,Property:`#5C7A99`,Viewing:`#D4A574`,Offer:`#B08850`,Job:`#8C3B2E`,Quote:`#A65A4A`,Invoice:`#6E4A1F`,InboundInvoice:`#6B2A20`,WhatsAppGroup:`#D4A096`,Customer:`#B5503C`,Site:`#C56B4A`,Asset:`#9E4A35`,Visit:`#C77A4E`,Part:`#7A3326`,PurchaseOrder:`#B07050`,PpmContract:`#8A4A3A`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#4F6B3E`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`,Objective:`#3D5A98`,KeyResult:`#5E7BC4`,Decision:`#7E60B0`,Risk:`#C15B57`,Source:`#2F8FA6`,Finding:`#4FA389`,Hypothesis:`#9A8C3E`},e.FALLBACK_LABEL_COLOUR=`#94A3B8`,e.ALL_GRAPH_LABELS=Object.freeze(Object.keys(e.GRAPH_LABEL_COLOURS));function t(t){for(let n=1;n<t.length;n++)if(Object.prototype.hasOwnProperty.call(e.GRAPH_LABEL_COLOURS,t[n]))return t[n];return t[0]??null}function n(t){return e.GRAPH_LABEL_COLOURS[t]??e.FALLBACK_LABEL_COLOUR}function r(r){let i=t(r),a=i?n(i):e.FALLBACK_LABEL_COLOUR,o=0;for(let t=1;t<r.length;t++)Object.prototype.hasOwnProperty.call(e.GRAPH_LABEL_COLOURS,r[t])&&o++;return{displayLabel:i,colour:a,driftCandidates:o}}var i=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/,a=/^\d{4}-\d{2}-\d{2}T(\d{2}:\d{2}:\d{2})/;function o(e){let t=e.match(i);return t?`${t[1]} ${t[2]}`:null}function s(e){let t=e.match(a);return t?t[1]:null}function c(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=o(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`Job`){let e=typeof t.client==`string`?t.client:``,n=typeof t.jobId==`string`?t.jobId:``,r=[e,n.length>0?`#${n}`:``].filter(e=>e.length>0).join(` `);if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`Quote`){let e=typeof t.ref==`string`?t.ref:``;if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`InboundInvoice`){let e=typeof t.supplier==`string`?t.supplier:``,n=typeof t.confirmationNumber==`string`?t.confirmationNumber:``,r=[e,n.length>0?`#${n}`:``].filter(e=>e.length>0).join(` `);if(r.length>0)return r.length>24?r.slice(0,24)+`…`:r}else if(n===`WhatsAppGroup`){let e=typeof t.clientName==`string`?t.clientName:``;if(e.length>0)return e.length>24?e.slice(0,24)+`…`:e}else if(n===`Message`){let e=typeof t.role==`string`?t.role:``,n=e===`user`?`user`:e===`assistant`?`asst`:e===`system`?`sys`:e===`tool`?`tool`:null,r=typeof t.createdAt==`string`?t.createdAt:``;if(n&&r){let e=s(r);if(e)return`${n} ${e}`}}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.length>24?n.slice(0,24)+`…`:n}if(n===`Conversation`){let e=typeof t.sessionId==`string`?t.sessionId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}function l(e){let t=e.properties,n=e.labels[0];if(n===`ToolCall`){let e=t.toolName;if(typeof e==`string`&&e.length>0)return e}else if(n===`WorkflowRun`){let e=t.startedAt;if(typeof e==`string`&&e.length>0){let t=o(e);if(t)return t}}else if(n===`WorkflowStep`){let e=t.label;if(typeof e==`string`&&e.length>0)return e}else if(n===`Person`){let e=[typeof t.givenName==`string`?t.givenName:``,typeof t.familyName==`string`?t.familyName:``].filter(e=>e.length>0).join(` `);if(e.length>0)return e}else if(n===`Agent`){let e=typeof t.displayName==`string`?t.displayName:``,n=typeof t.slug==`string`?t.slug:``,r=e.length>0?e:n;if(r.length>0)return r}else if(n===`Job`){let e=typeof t.client==`string`?t.client:``,n=typeof t.jobId==`string`?t.jobId:``,r=[e,n.length>0?`#${n}`:``].filter(e=>e.length>0).join(` `);if(r.length>0)return r}else if(n===`Quote`){let e=typeof t.ref==`string`?t.ref:``;if(e.length>0)return e}else if(n===`InboundInvoice`){let e=typeof t.supplier==`string`?t.supplier:``,n=typeof t.confirmationNumber==`string`?t.confirmationNumber:``,r=[e,n.length>0?`#${n}`:``].filter(e=>e.length>0).join(` `);if(r.length>0)return r}else if(n===`WhatsAppGroup`){let e=typeof t.clientName==`string`?t.clientName:``;if(e.length>0)return e}for(let e of[`name`,`title`,`summary`,`givenName`,`subject`,`text`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n}if(n===`Conversation`){let e=typeof t.sessionId==`string`?t.sessionId:null;if(e)return`Conv ${e.slice(0,8)}`}return n??`…`}})),i=r();Object.freeze(new Set([`Chunk`,`GraphPreference`]));var a=Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.Listing.Property.Viewing.Offer.Job.Quote.Invoice.InboundInvoice.WhatsAppGroup.Customer.Site.Asset.Visit.Part.PurchaseOrder.PpmContract.Task.Project.Event.Workflow.Email.EmailAccount.Agent.Objective.KeyResult.Decision.Risk.Source.Finding.Hypothesis`.split(`.`)));Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));export{n as i,i as n,r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{F as t,L as n,M as r}from"./useSubAccountSwitcher-
|
|
1
|
+
import{o as e}from"./chunk-CAM3fms7.js";import{F as t,L as n,M as r}from"./useSubAccountSwitcher-DMbRhLPv.js";import{n as i,t as a}from"./AdminLoginScreens-BejIjbmU.js";import"./admin-types-hioowVct.js";import"./AdminShell-D2-uBSB5.js";import"./Checkbox-1F1tzqca.js";import{t as o}from"./page-D-Ep4bXd.js";import"./Transcript-DkGa4CQH.js";var s=t(),c=e(n(),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 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CAM3fms7.js";import{C as t,D as n,L as r,M as i,P as a,_ as o,a as s,c,d as ee,f as l,g as te,h as ne,i as u,m as d,n as f,o as p,r as re,t as ie,u as ae,v as oe,w as se,x as ce,y as m}from"./useSubAccountSwitcher-BpQ3oKiJ.js";import{t as h}from"./chevron-left-Cngmu0Py.js";import{i as le}from"./Transcript-FX_w6no6.js";import{i as ue,t as de}from"./graph-labels-BcLJmY-v.js";var fe=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),pe=n(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),me=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),he=n(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ge=n(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),_e=n(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),g=n(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ve=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);function ye(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||de.has(e)&&(t.add(e),n.push(e)));return n}var _=e(r(),1),v=i();function y(e){if(!e)return``;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function be({conversations:e,sessionKey:t,onBack:n}){let[r,i]=(0,_.useState)(null),a=s(e);return r?(0,v.jsxs)(`div`,{className:`op-conv op-conv-reader`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:()=>i(null),"aria-label":`Back to conversations`,children:[(0,v.jsx)(h,{size:16}),` Back`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:p(r)})]}),(0,v.jsx)(le,{sessionId:r.sessionId,projectDir:r.projectDir,sessionKey:t,forceDeliveredOnly:!0,suppressDirectives:r.source===`store`,store:r.source===`store`?{accountId:r.accountId,remoteJid:r.remoteJid}:void 0},c(r))]}):(0,v.jsxs)(`div`,{className:`op-conv op-conv-list`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:n,"aria-label":`Back to chat`,children:[(0,v.jsx)(h,{size:16}),` Chat`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:`Conversations`})]}),a.map(e=>(0,v.jsxs)(`div`,{className:`op-conv-group`,children:[(0,v.jsxs)(`div`,{className:`op-conv-group-head`,children:[(0,v.jsx)(ae,{channel:e.channel,size:14}),e.label]}),e.rows.map(e=>(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-row`,onClick:()=>{console.info(`[operator-ui] op=reader-open channel=${e.channel} key=${c(e)} readonly=true source=${e.source}`),i(e)},children:[(0,v.jsx)(`span`,{className:`op-conv-name`,children:p(e)}),e.modelGated&&(0,v.jsx)(`span`,{className:`op-conv-gated`,role:`img`,"aria-label":`Model unavailable`,children:(0,v.jsx)(g,{size:13})}),(0,v.jsx)(`span`,{className:`op-conv-when`,children:y(e.lastMessageAt)})]},c(e)))]},e.channel))]})}var b=/\.(png|jpe?g|gif|webp|svg)$/i;function xe(e){return b.test(e)}var Se=`maxy-data-view`,Ce=95*1024*1024,we=48*1024*1024;function Te(){return typeof window>`u`?`list`:window.localStorage.getItem(Se)===`grid`?`grid`:`list`}function Ee(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,v.jsx)(l,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,v.jsx)(`div`,{className:`data-page data-page-full`,children:(0,v.jsx)(x,{cacheKey:e})})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-empty`,children:[(0,v.jsx)(`p`,{children:`You are not signed in.`}),(0,v.jsxs)(`p`,{children:[`Open the `,(0,v.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:18,className:`spin`}),` Loading…`]})})}function x({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(w,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})}function De(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function Oe(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function ke(e){return new Promise((t,n)=>{let r=[],i=()=>e.readEntries(e=>{e.length===0?t(r):(r.push(...e),i())},n);i()})}function S(e){return new Promise((t,n)=>e.file(t,n))}async function Ae(e,t=``){let n=[];for(let r of e){if(!r)continue;let e=t?`${t}/${r.name}`:r.name;if(r.isFile)n.push({file:await S(r),relpath:e});else if(r.isDirectory){let t=await ke(r.createReader());n.push(...await Ae(t,e))}}return n}function je(e,t){if(e===422&&typeof t==`string`){if(/exceeds the .* limit/i.test(t))return`size`;if(/unsupported file type/i.test(t))return`mime`}return`http=${e}`}function C({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[i,a]=(0,_.useState)(``),s=(0,_.useRef)(null),[c,ee]=(0,_.useState)(``),[l,p]=(0,_.useState)(null),[ie,ae]=(0,_.useState)(`hybrid`),[h,le]=(0,_.useState)(!1),[de,g]=(0,_.useState)(null),[y,be]=(0,_.useState)(null),[b,Ee]=(0,_.useState)(0),[x,ke]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>De()),[w,Me]=(0,_.useState)(null),[T,Fe]=(0,_.useState)(()=>Te()),[E,Re]=(0,_.useState)(null),[D,ze]=(0,_.useState)([]),[O,Be]=(0,_.useState)(!1),[Ve,He]=(0,_.useState)(null),[Ue,We]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[Ge,j]=(0,_.useState)(null),[Ke,qe]=(0,_.useState)(null),[Je,Ye]=(0,_.useState)(!1),[Xe,Ze]=(0,_.useState)(null),M=(0,_.useRef)(null),[Qe,N]=(0,_.useState)(0),[$e,P]=(0,_.useState)(!1),[et,tt]=(0,_.useState)(``),[F,I]=(0,_.useState)(null),[nt,rt]=(0,_.useState)(``),[it,L]=(0,_.useState)(null),R=(()=>{let e=S===`.`?[]:S.split(`/`).filter(Boolean);return e.length>=2&&e[0]===`accounts`})(),[z,B]=(0,_.useState)(!1),at=(0,_.useRef)(null),[V,H]=(0,_.useState)(!1),ot=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=i.trim();if(!e){ee(``),p(null),g(null);return}ke(!1);let t=setTimeout(()=>ee(e),300);return()=>clearTimeout(t)},[i]),(0,_.useEffect)(()=>{if(!c){le(!1);return}let t=!1;return le(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(c)}&labels=FileArtifact&limit=20${x?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(p(e.results),ae(e.mode??`hybrid`),Ee(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||le(!1)}),()=>{t=!0}},[c,e,r,x]);let st=(0,_.useMemo)(()=>l?ye(l):[],[l]),U=y&&st.includes(y)?y:null,W=(0,_.useMemo)(()=>l?U?l.filter(e=>e.labels.includes(U)):l:null,[l,U]),ct=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[n]);(0,_.useEffect)(()=>{if(!l)return;let e=l.filter(e=>{let t=e.properties.relativePath;return typeof t!=`string`||t.length===0});e.length>0&&console.warn(`[data-search] op=locate-link-missing nodeId=${e.map(e=>e.nodeId).join(`,`)}`)},[l]),(0,_.useEffect)(()=>{let t=!1;return Be(!0),He(null),e(`/api/admin/files?path=${encodeURIComponent(S===`.`?``:S)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(Me(e.entries),ze(e.displayPath??[]))}).catch(e=>{t||(Me([]),ze([]),He(e instanceof Error?e.message:String(e)))}).finally(()=>{t||Be(!1)}),()=>{t=!0}},[e,S,Qe,r]),(0,_.useEffect)(()=>{Oe(S)},[S]);let lt=(0,_.useCallback)(()=>{N(e=>e+1)},[]),G=(0,_.useCallback)(e=>{B(!1),C(e)},[]),ut=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let n=t.lastIndexOf(`/`),r=n===-1?`.`:t.slice(0,n);console.log(`[data-search] op=locate nodeId=${e.nodeId} folder=${r}`),a(``),g(null),be(null),G(r)},[G]),dt=(0,_.useCallback)(()=>{if(S===`.`||S===``)return;let e=S.split(`/`).filter(Boolean);e.pop(),C(e.length===0?`.`:e.join(`/`))},[S]),ft=(0,_.useCallback)(e=>{re(n,S===`.`?e.name:`${S}/${e.name}`)},[S,n]),[K,pt]=(0,_.useState)(!1),[q,mt]=(0,_.useState)(new Set),ht=(0,_.useRef)(null),J=(0,_.useRef)(!1),Y=typeof navigator<`u`&&typeof navigator.share==`function`&&typeof navigator.canShare==`function`,gt=(0,_.useCallback)(e=>{pt(!0),mt(new Set([e])),console.info(`[data-ui] op=select-enter count=1`)},[]),X=(0,_.useCallback)(e=>{pt(!1),mt(new Set),console.info(`[data-ui] op=select-exit reason=${e}`)},[]),Z=(0,_.useCallback)(e=>{mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_t=(0,_.useCallback)(e=>{J.current=!1,ht.current=setTimeout(()=>{J.current=!0,gt(e)},500)},[gt]),Q=(0,_.useCallback)(()=>{ht.current&&=(clearTimeout(ht.current),null)},[]),vt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}ft(e)},[K,Z,ft]),yt=(0,_.useCallback)(e=>{Fe(e),typeof window<`u`&&window.localStorage.setItem(Se,e),console.info(`[data] op=view-mode mode=${e}`)},[]),bt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}Re({src:f(n,S===`.`?e.name:`${S}/${e.name}`),alt:e.displayName??e.name})},[K,Z,S,n]),xt=(0,_.useCallback)(()=>(w??[]).filter(e=>e.kind===`file`&&q.has(e.name)),[w,q]),St=(0,_.useCallback)(()=>(w??[]).filter(e=>(e.kind===`file`||e.kind===`directory`)&&q.has(e.name)),[w,q]),Ct=(0,_.useCallback)(()=>{let e=St(),t=e.some(e=>e.kind===`directory`);e.length===1&&!t?ft(e[0]):e.length>=1&&u(n,e.map(e=>S===`.`?e.name:`${S}/${e.name}`)),X(`action`)},[St,ft,S,n,X]),wt=(0,_.useCallback)(async()=>{let t=xt(),n=t.filter(e=>!e.protected),r=t.length-n.length;Ze(r>0?`${r} protected file(s) kept`:null);for(let t of n){let n=S===`.`?t.name:`${S}/${t.name}`;try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`)}catch(e){Ze(e instanceof Error?e.message:String(e))}}N(e=>e+1),X(`action`)},[xt,S,e,X]),Tt=(0,_.useCallback)(async()=>{let e=xt();if(console.info(`[data-ui] op=share supported=${Y} count=${e.length}`),Y)try{let t=await Promise.all(e.map(async e=>{let t=S===`.`?e.name:`${S}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=await(await fetch(r)).blob();return new File([i],e.name,{type:i.type||`application/octet-stream`})}));navigator.canShare({files:t})&&await navigator.share({files:t})}catch(e){console.warn(`[data-ui] op=share-failed err=${e instanceof Error?e.message:String(e)}`)}},[xt,Y,S,n]),Et=(0,_.useCallback)(()=>{M.current?.click()},[]),Dt=(0,_.useCallback)((e,t={})=>{let r=(r,i,a)=>{let o=new URLSearchParams({session_key:n,path:S===`.`?``:S,filename:e.name});t.relpath&&o.set(`relpath`,t.relpath),t.token&&o.set(`token`,t.token);for(let[e,t]of Object.entries(i))o.set(e,t);return new Promise(t=>{let n=new XMLHttpRequest;n.open(`POST`,`/api/admin/files/upload?${o.toString()}`),n.setRequestHeader(`Content-Type`,e.type||`application/octet-stream`),a&&(n.upload.onprogress=e=>{e.lengthComputable&&a(e.loaded)}),n.onload=()=>{let e={};try{e=JSON.parse(n.responseText)}catch{}t({status:n.status,data:e})},n.onerror=()=>t({status:0,data:{}}),n.onabort=()=>t({status:0,data:{error:`aborted`}}),n.send(r)})};if(e.size<=Ce)return r(e,{},n=>t.onProgress?.(n,e.size));let i=`${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`,a=Math.ceil(e.size/we);return(async()=>{let n={status:0,data:{}};for(let o=0;o<a;o++){let s=o*we;if(n=await r(e.slice(s,Math.min(s+we,e.size)),{uploadId:i,seq:String(o),total:String(a)},n=>t.onProgress?.(s+n,e.size)),!(n.status>=200&&n.status<300))return n}return n})()},[n,S]),Ot=(0,_.useCallback)(async e=>{j(null),We(!0),A({loaded:0,total:e.size});try{let{status:t,data:n}=await Dt(e,{onProgress:(e,t)=>A({loaded:e,total:t})});t>=200&&t<300&&n.path?(C(n.path.split(`/`).slice(0,-1).join(`/`)||`.`),N(e=>e+1)):j(t===0?`Network error during upload — the connection failed before the server responded.`:n.error??`Upload failed (HTTP ${t}).`)}finally{We(!1),A(null),M.current&&(M.current.value=``)}},[Dt]),kt=(0,_.useCallback)(e=>{R&&Array.from(e.dataTransfer.types).includes(`Files`)&&(e.preventDefault(),Ye(!0))},[R]),At=(0,_.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||Ye(!1)},[]),jt=(0,_.useCallback)(async e=>{e.preventDefault(),Ye(!1);let t=Math.random().toString(16).slice(2,10),n=Array.from(e.dataTransfer.items);if(console.info(`[data-ui] op=drop-received token=${t} items=${n.length}`),n.length===0)return;if(!R){console.info(`[data-ui] op=drop-rejected token=${t} reason=no-write`),j(`Open a folder inside your account to upload`);return}let r=n.map(e=>e.webkitGetAsEntry?.()).filter(e=>!!e);We(!0),j(null),qe(null);let i=performance.now();try{let e=await Ae(r),n=e.reduce((e,t)=>e+t.file.size,0),a=new Set(e.map(e=>e.relpath.split(`/`).slice(0,-1).join(`/`)).filter(Boolean)).size;console.info(`[data-ui] op=drop-walk token=${t} files=${e.length} dirs=${a} bytes=${n}`);let o=0,s=[];for(let n=0;n<e.length;n++){let{file:r,relpath:i}=e[n];console.info(`[data-ui] op=drop-file token=${t} rel="${i}" i=${n+1}/${e.length}`),A({loaded:0,total:r.size});let{status:a,data:c}=await Dt(r,{relpath:i,token:t,onProgress:(e,t)=>A({loaded:e,total:t})});if(a>=200&&a<300)o++,console.info(`[data-ui] op=drop-file-ok token=${t} rel="${i}"`);else{let e=a===0?`http=0`:je(a,c.error);s.push(`${i} (${e})`),console.info(`[data-ui] op=drop-file-skip token=${t} rel="${i}" reason=${e}`)}}let c=Math.round(performance.now()-i);console.info(`[data-ui] op=drop-done token=${t} uploaded=${o} skipped=${s.length} ms=${c}`),qe(`Uploaded ${o}, skipped ${s.length}${s.length?`: ${s.join(`, `)}`:``}`),N(e=>e+1)}catch(e){j(e instanceof Error?e.message:String(e))}finally{We(!1),A(null)}},[R,Dt]),Mt=(0,_.useCallback)(async()=>{let t=et.trim();if(t){L(null);try{let n=await e(`/api/admin/files/folder`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:S===`.`?``:S,name:t})}),r=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);P(!1),tt(``),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}}},[e,et,S]),Nt=(0,_.useCallback)(async()=>{if(!F)return;let t=nt.trim();if(!t)return;L(null);let n=S===`.`?F:`${S}/${F}`;try{let r=await e(`/api/admin/files/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:n,newName:t})}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);I(null),rt(``),X(`action`),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}},[e,nt,F,S,X]);(0,_.useEffect)(()=>{if(!z)return;let e=e=>{at.current&&!at.current.contains(e.target)&&B(!1)},t=e=>{e.key===`Escape`&&B(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[z]),(0,_.useEffect)(()=>{if(!V)return;let e=e=>{ot.current&&!ot.current.contains(e.target)&&H(!1)},t=e=>{e.key===`Escape`&&H(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[V]);let $=(0,_.useCallback)(e=>D.slice(0,e+1).map(e=>e.name).join(`/`),[D]),Pt=D.length>=2,Ft=Pt?[{name:`.`,label:`data`},...D.slice(0,D.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-toolbar`,children:[K?(0,v.jsxs)(`button`,{type:`button`,className:`data-select-cancel`,onClick:()=>X(`cancel`),"aria-label":`Cancel selection`,children:[(0,v.jsx)(d,{size:14}),` Cancel`]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-search-input`,children:[i===``&&(0,v.jsx)(ue,{size:14}),(0,v.jsx)(`input`,{ref:s,type:`text`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),h&&(0,v.jsx)(m,{size:14,className:`spin`}),i!==``&&(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:()=>{a(``),s.current?.focus()},title:`Clear search`,"aria-label":`Clear search`,children:(0,v.jsx)(d,{size:14})})]}),(0,v.jsxs)(`div`,{className:`data-toolbar-actions`,ref:ot,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-action-overflow`,onClick:()=>H(e=>!e),"aria-haspopup":`menu`,"aria-expanded":V,"aria-label":`File actions`,title:`File actions`,children:(0,v.jsx)(t,{size:16})}),(0,v.jsxs)(`div`,{className:`data-action-group`,role:`group`,"aria-label":`File actions`,"data-open":V?`true`:void 0,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{lt(),H(!1)},disabled:O,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[O?(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(o,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Refresh`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{Et(),H(!1)},disabled:Ue||!R,title:R?`Upload a file`:`Open a folder inside your account to upload`,"aria-label":`Upload a file`,children:[Ue?k&&k.total>0?(0,v.jsxs)(`span`,{className:`data-upload-pct`,children:[Math.round(k.loaded/k.total*100),`%`]}):(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(ve,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Upload`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{P(e=>!e),tt(``),L(null),H(!1)},disabled:Ue||!R,title:R?`New folder`:`Open a folder inside your account to create one`,"aria-label":`New folder`,children:[(0,v.jsx)(pe,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`New folder`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{yt(T===`grid`?`list`:`grid`),H(!1)},title:T===`grid`?`List view`:`Grid view`,"aria-label":T===`grid`?`Switch to list view`:`Switch to grid view`,"aria-pressed":T===`grid`,children:[T===`grid`?(0,v.jsx)(ge,{size:16}):(0,v.jsx)(he,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:T===`grid`?`List view`:`Grid view`})]})]})]})]}),(0,v.jsxs)(`div`,{className:`data-breadcrumbs`,children:[S!==`.`&&(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:dt,title:`Up one level`,"aria-label":`Up one level`,children:(0,v.jsx)(fe,{size:14})}),Pt?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,ref:at,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>B(e=>!e),"aria-haspopup":`menu`,"aria-expanded":z,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),z&&(0,v.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:Ft.map(e=>(0,v.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>G(e.name),title:e.label,children:e.label},e.name))})]}),[D.length-2,D.length-1].map(e=>{let t=D[e];return(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G(`.`),children:`data`}),D.map((e,t)=>(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),$e&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`Folder name`,value:et,autoFocus:!0,onChange:e=>tt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Mt(),e.key===`Escape`&&P(!1)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Mt,children:`Create`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>P(!1),children:`Cancel`})]}),F&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`New name`,value:nt,autoFocus:!0,onChange:e=>rt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Nt(),e.key===`Escape`&&I(null)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Nt,children:`Rename`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>I(null),children:`Cancel`})]}),it&&(0,v.jsx)(`div`,{className:`data-error`,children:it}),(0,v.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Ot(t)}})]}),(0,v.jsxs)(`div`,{className:`data-body`,"data-drag-active":Je?`true`:void 0,onDragEnter:kt,onDragOver:kt,onDragLeave:At,onDrop:jt,children:[(de!==null||l!==null)&&(0,v.jsxs)(`section`,{className:`data-panel`,children:[de&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,de]}),st.length>0&&(0,v.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:st.map(e=>{let t=e===U;return(0,v.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>be(t?null:e),children:Pe([e])??e},e)})}),l&&!h&&(0,v.jsxs)(`div`,{className:`data-results-meta`,children:[W.length,` of `,l.length,` result`,l.length===1?``:`s`]}),l&&!h&&!U&&b>0&&!x&&(0,v.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!0),children:[b,` low-confidence result`,b===1?``:`s`,` hidden — show all`]}),l&&!h&&!U&&x&&(0,v.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!1),children:`Showing all results — hide low-confidence`}),l&&l.length===0&&!h&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),W&&W.length>0&&(0,v.jsx)(`ul`,{className:`data-results`,children:W.map(e=>(0,v.jsx)(Ne,{hit:e,mode:ie,onDownload:ct,onLocate:ut},e.nodeId))})]}),(0,v.jsxs)(`section`,{className:`data-panel`,children:[k&&(0,v.jsxs)(`div`,{className:`data-upload-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":k.total>0?Math.round(k.loaded/k.total*100):void 0,children:[(0,v.jsx)(`div`,{className:`data-upload-progress-track`,children:(0,v.jsx)(`div`,{className:`data-upload-progress-fill`,style:{width:`${k.total>0?Math.round(k.loaded/k.total*100):0}%`}})}),(0,v.jsxs)(`span`,{className:`data-upload-progress-label`,children:[`Uploading… `,k.total>0?`${Math.round(k.loaded/k.total*100)}%`:``]})]}),Ge&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,Ge]}),Ke&&(0,v.jsx)(`div`,{className:`data-status`,children:Ke}),Xe&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,Xe]}),Ve&&(0,v.jsx)(`div`,{className:`data-error`,children:Ve}),O&&(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:14,className:`spin`}),` Loading…`]}),!K&&!O&&w&&w.length>0&&(0,v.jsxs)(`div`,{className:`data-select-hint`,children:[(0,v.jsx)(_e,{size:13}),(0,v.jsx)(`span`,{children:`Press and hold a file to select, rename, or delete it.`})]}),!O&&w&&w.length===0&&!Ve&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!O&&w&&w.length>0&&T===`grid`&&(0,v.jsx)(`ul`,{className:`data-grid`,children:w.map(e=>{let t=e.displayName??e.name,r=K&&q.has(e.name);if(e.kind===`directory`)return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t})]})},e.name);if(e.kind===`file`){let i=xe(e.name),a=S===`.`?e.name:`${S}/${e.name}`;return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile${i?` data-grid-tile-image`:``}`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>i?bt(e):vt(e),title:K?void 0:i?`Preview ${t}`:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),i?(0,v.jsx)(`img`,{className:`data-grid-thumb`,src:f(n,a),alt:t,loading:`lazy`,onError:()=>console.warn(`[data] op=thumb-error path=${a}`)}):(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t}),!i&&(0,v.jsx)(`span`,{className:`data-grid-sub`,children:Ie(e.sizeBytes)})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-grid-cell`,children:(0,v.jsxs)(`div`,{className:`data-grid-tile data-entry-disabled`,children:[(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,children:t}),(0,v.jsx)(`span`,{className:`data-grid-sub`,children:`special`})]})},e.name)})}),!O&&w&&w.length>0&&T===`list`&&(0,v.jsx)(`ul`,{className:`data-entries`,children:w.map(e=>{let t=e.displayName??e.name;if(e.kind===`directory`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]})},e.name)}if(e.kind===`file`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn data-entry-file`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>vt(e),title:K?void 0:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,v.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${Le(e.modifiedAt)}`,children:[Ie(e.sizeBytes),` · `,Le(e.modifiedAt)]})]})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-entry`,children:(0,v.jsx)(`div`,{className:`data-entry-btn data-entry-file data-entry-disabled`,children:(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,v.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})})},e.name)})})]})]}),K&&(0,v.jsx)(`div`,{className:`data-select-bar`,role:`toolbar`,"aria-label":`Selection actions`,children:(0,v.jsxs)(`div`,{className:`data-select-bar-inner`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Tt,disabled:!Y||q.size===0,title:Y?`Share selected files`:`Sharing is not supported on this device`,children:[(0,v.jsx)(te,{size:16}),` Share`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Ct,disabled:q.size===0,children:[(0,v.jsx)(se,{size:16}),` Download`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:()=>{let e=[...q][0];e&&(I(e),rt(e))},disabled:q.size!==1,children:[(0,v.jsx)(oe,{size:16}),` Rename`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action data-select-delete`,onClick:wt,disabled:q.size===0,children:[(0,v.jsx)(ne,{size:16}),` Delete`]})]})}),E&&(0,v.jsx)(`div`,{className:`chat-attachment-overlay`,role:`dialog`,"aria-label":E.alt,onClick:()=>Re(null),children:(0,v.jsx)(`img`,{className:`chat-attachment-overlay-image`,src:E.src,alt:E.alt})})]})}function w({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){(0,_.useEffect)(()=>{console.info(`[data-ui] op=mount header=operator home=absent`)},[]);let r=(0,_.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),i=(0,_.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(`files`),{subAccounts:l,activeAccountId:te,switching:ne,switchAccount:u}=ie(t);return(0,_.useEffect)(()=>{if(!t)return;let e=!1;return fetch(`/api/whatsapp-reader/conversations?session_key=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():{conversations:[]}).then(t=>{e||o(t.conversations??[])}).catch(()=>{}),()=>{e=!0}},[t]),(0,v.jsxs)(`main`,{className:`data-main`,children:[(0,v.jsx)(ee,{variant:`operator`,onNavigate:i,onOpenConversations:a.length>0?()=>c(`conversations`):void 0,onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:r,onDisconnect:async()=>!0,disconnecting:!1,subAccounts:l,activeAccountId:te,switchingAccount:ne,onSwitchAccount:u}),s===`conversations`?(0,v.jsx)(be,{conversations:a,sessionKey:t,onBack:()=>c(`files`)}):(0,v.jsx)(C,{adminFetch:e,cacheKey:t,sessionRefetchNonce:n})]})}function Me({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsx)(`main`,{className:`data-main`,children:(0,v.jsx)(C,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})})})}function Ne({hit:e,mode:t,onDownload:n,onLocate:r}){let i=T(e.properties),a=Fe(e.properties),o=Pe(e.labels),s=E(e.properties),[c,ee]=(0,_.useState)(!1),l=a&&a.length>280,te=c||!l?a:a?.slice(0,280)+`…`,ne=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`,u=e.properties.relativePath,d=typeof u==`string`&&u.length>0,f=d?u.lastIndexOf(`/`):-1,p=d?f===-1?`data`:u.slice(0,f):null;return(0,v.jsxs)(`li`,{className:`data-result`,children:[(0,v.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${i??o??`file`}`,children:[o&&(0,v.jsx)(`div`,{className:`data-result-header`,children:(0,v.jsx)(`span`,{className:`data-result-labels`,children:o})}),i&&(0,v.jsx)(`div`,{className:`data-result-title`,children:i}),a&&(0,v.jsx)(`pre`,{className:`data-result-body`,children:te}),(0,v.jsxs)(`div`,{className:`data-result-scores`,children:[s&&(0,v.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,Le(s),` · `]}),ne]})]}),d&&(0,v.jsxs)(`button`,{type:`button`,className:`data-result-locate`,onClick:()=>r(e),title:`Locate in ${p}`,"aria-label":`Locate in ${p}`,children:[(0,v.jsx)(me,{size:12}),p]}),l&&(0,v.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>ee(e=>!e),children:c?`Show less`:`Show more`})]})}function Pe(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function T(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function Fe(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function E(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function Ie(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function Le(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}export{Me as n,Ee as t};
|
|
1
|
+
import{o as e}from"./chunk-CAM3fms7.js";import{C as t,D as n,L as r,M as i,P as a,_ as o,a as s,c,d as ee,f as l,g as te,h as ne,i as u,m as d,n as f,o as p,r as re,t as ie,u as ae,v as oe,w as se,x as ce,y as m}from"./useSubAccountSwitcher-DMbRhLPv.js";import{t as h}from"./chevron-left-DhVdq0aN.js";import{i as le}from"./Transcript-DkGa4CQH.js";import{i as ue,t as de}from"./graph-labels-D3BQdcpD.js";var fe=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),pe=n(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),me=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),he=n(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ge=n(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),_e=n(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),g=n(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ve=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);function ye(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||de.has(e)&&(t.add(e),n.push(e)));return n}var _=e(r(),1),v=i();function y(e){if(!e)return``;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function be({conversations:e,sessionKey:t,onBack:n}){let[r,i]=(0,_.useState)(null),a=s(e);return r?(0,v.jsxs)(`div`,{className:`op-conv op-conv-reader`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:()=>i(null),"aria-label":`Back to conversations`,children:[(0,v.jsx)(h,{size:16}),` Back`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:p(r)})]}),(0,v.jsx)(le,{sessionId:r.sessionId,projectDir:r.projectDir,sessionKey:t,forceDeliveredOnly:!0,suppressDirectives:r.source===`store`,store:r.source===`store`?{accountId:r.accountId,remoteJid:r.remoteJid}:void 0},c(r))]}):(0,v.jsxs)(`div`,{className:`op-conv op-conv-list`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:n,"aria-label":`Back to chat`,children:[(0,v.jsx)(h,{size:16}),` Chat`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:`Conversations`})]}),a.map(e=>(0,v.jsxs)(`div`,{className:`op-conv-group`,children:[(0,v.jsxs)(`div`,{className:`op-conv-group-head`,children:[(0,v.jsx)(ae,{channel:e.channel,size:14}),e.label]}),e.rows.map(e=>(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-row`,onClick:()=>{console.info(`[operator-ui] op=reader-open channel=${e.channel} key=${c(e)} readonly=true source=${e.source}`),i(e)},children:[(0,v.jsx)(`span`,{className:`op-conv-name`,children:p(e)}),e.modelGated&&(0,v.jsx)(`span`,{className:`op-conv-gated`,role:`img`,"aria-label":`Model unavailable`,children:(0,v.jsx)(g,{size:13})}),(0,v.jsx)(`span`,{className:`op-conv-when`,children:y(e.lastMessageAt)})]},c(e)))]},e.channel))]})}var b=/\.(png|jpe?g|gif|webp|svg)$/i;function xe(e){return b.test(e)}var Se=`maxy-data-view`,Ce=95*1024*1024,we=48*1024*1024;function Te(){return typeof window>`u`?`list`:window.localStorage.getItem(Se)===`grid`?`grid`:`list`}function Ee(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,v.jsx)(l,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,v.jsx)(`div`,{className:`data-page data-page-full`,children:(0,v.jsx)(x,{cacheKey:e})})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-empty`,children:[(0,v.jsx)(`p`,{children:`You are not signed in.`}),(0,v.jsxs)(`p`,{children:[`Open the `,(0,v.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:18,className:`spin`}),` Loading…`]})})}function x({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(w,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})}function De(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function Oe(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function ke(e){return new Promise((t,n)=>{let r=[],i=()=>e.readEntries(e=>{e.length===0?t(r):(r.push(...e),i())},n);i()})}function S(e){return new Promise((t,n)=>e.file(t,n))}async function Ae(e,t=``){let n=[];for(let r of e){if(!r)continue;let e=t?`${t}/${r.name}`:r.name;if(r.isFile)n.push({file:await S(r),relpath:e});else if(r.isDirectory){let t=await ke(r.createReader());n.push(...await Ae(t,e))}}return n}function je(e,t){if(e===422&&typeof t==`string`){if(/exceeds the .* limit/i.test(t))return`size`;if(/unsupported file type/i.test(t))return`mime`}return`http=${e}`}function C({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[i,a]=(0,_.useState)(``),s=(0,_.useRef)(null),[c,ee]=(0,_.useState)(``),[l,p]=(0,_.useState)(null),[ie,ae]=(0,_.useState)(`hybrid`),[h,le]=(0,_.useState)(!1),[de,g]=(0,_.useState)(null),[y,be]=(0,_.useState)(null),[b,Ee]=(0,_.useState)(0),[x,ke]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>De()),[w,Me]=(0,_.useState)(null),[T,Fe]=(0,_.useState)(()=>Te()),[E,Re]=(0,_.useState)(null),[D,ze]=(0,_.useState)([]),[O,Be]=(0,_.useState)(!1),[Ve,He]=(0,_.useState)(null),[Ue,We]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[Ge,j]=(0,_.useState)(null),[Ke,qe]=(0,_.useState)(null),[Je,Ye]=(0,_.useState)(!1),[Xe,Ze]=(0,_.useState)(null),M=(0,_.useRef)(null),[Qe,N]=(0,_.useState)(0),[$e,P]=(0,_.useState)(!1),[et,tt]=(0,_.useState)(``),[F,I]=(0,_.useState)(null),[nt,rt]=(0,_.useState)(``),[it,L]=(0,_.useState)(null),R=(()=>{let e=S===`.`?[]:S.split(`/`).filter(Boolean);return e.length>=2&&e[0]===`accounts`})(),[z,B]=(0,_.useState)(!1),at=(0,_.useRef)(null),[V,H]=(0,_.useState)(!1),ot=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=i.trim();if(!e){ee(``),p(null),g(null);return}ke(!1);let t=setTimeout(()=>ee(e),300);return()=>clearTimeout(t)},[i]),(0,_.useEffect)(()=>{if(!c){le(!1);return}let t=!1;return le(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(c)}&labels=FileArtifact&limit=20${x?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(p(e.results),ae(e.mode??`hybrid`),Ee(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||le(!1)}),()=>{t=!0}},[c,e,r,x]);let st=(0,_.useMemo)(()=>l?ye(l):[],[l]),U=y&&st.includes(y)?y:null,W=(0,_.useMemo)(()=>l?U?l.filter(e=>e.labels.includes(U)):l:null,[l,U]),ct=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[n]);(0,_.useEffect)(()=>{if(!l)return;let e=l.filter(e=>{let t=e.properties.relativePath;return typeof t!=`string`||t.length===0});e.length>0&&console.warn(`[data-search] op=locate-link-missing nodeId=${e.map(e=>e.nodeId).join(`,`)}`)},[l]),(0,_.useEffect)(()=>{let t=!1;return Be(!0),He(null),e(`/api/admin/files?path=${encodeURIComponent(S===`.`?``:S)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(Me(e.entries),ze(e.displayPath??[]))}).catch(e=>{t||(Me([]),ze([]),He(e instanceof Error?e.message:String(e)))}).finally(()=>{t||Be(!1)}),()=>{t=!0}},[e,S,Qe,r]),(0,_.useEffect)(()=>{Oe(S)},[S]);let lt=(0,_.useCallback)(()=>{N(e=>e+1)},[]),G=(0,_.useCallback)(e=>{B(!1),C(e)},[]),ut=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let n=t.lastIndexOf(`/`),r=n===-1?`.`:t.slice(0,n);console.log(`[data-search] op=locate nodeId=${e.nodeId} folder=${r}`),a(``),g(null),be(null),G(r)},[G]),dt=(0,_.useCallback)(()=>{if(S===`.`||S===``)return;let e=S.split(`/`).filter(Boolean);e.pop(),C(e.length===0?`.`:e.join(`/`))},[S]),ft=(0,_.useCallback)(e=>{re(n,S===`.`?e.name:`${S}/${e.name}`)},[S,n]),[K,pt]=(0,_.useState)(!1),[q,mt]=(0,_.useState)(new Set),ht=(0,_.useRef)(null),J=(0,_.useRef)(!1),Y=typeof navigator<`u`&&typeof navigator.share==`function`&&typeof navigator.canShare==`function`,gt=(0,_.useCallback)(e=>{pt(!0),mt(new Set([e])),console.info(`[data-ui] op=select-enter count=1`)},[]),X=(0,_.useCallback)(e=>{pt(!1),mt(new Set),console.info(`[data-ui] op=select-exit reason=${e}`)},[]),Z=(0,_.useCallback)(e=>{mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_t=(0,_.useCallback)(e=>{J.current=!1,ht.current=setTimeout(()=>{J.current=!0,gt(e)},500)},[gt]),Q=(0,_.useCallback)(()=>{ht.current&&=(clearTimeout(ht.current),null)},[]),vt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}ft(e)},[K,Z,ft]),yt=(0,_.useCallback)(e=>{Fe(e),typeof window<`u`&&window.localStorage.setItem(Se,e),console.info(`[data] op=view-mode mode=${e}`)},[]),bt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}Re({src:f(n,S===`.`?e.name:`${S}/${e.name}`),alt:e.displayName??e.name})},[K,Z,S,n]),xt=(0,_.useCallback)(()=>(w??[]).filter(e=>e.kind===`file`&&q.has(e.name)),[w,q]),St=(0,_.useCallback)(()=>(w??[]).filter(e=>(e.kind===`file`||e.kind===`directory`)&&q.has(e.name)),[w,q]),Ct=(0,_.useCallback)(()=>{let e=St(),t=e.some(e=>e.kind===`directory`);e.length===1&&!t?ft(e[0]):e.length>=1&&u(n,e.map(e=>S===`.`?e.name:`${S}/${e.name}`)),X(`action`)},[St,ft,S,n,X]),wt=(0,_.useCallback)(async()=>{let t=xt(),n=t.filter(e=>!e.protected),r=t.length-n.length;Ze(r>0?`${r} protected file(s) kept`:null);for(let t of n){let n=S===`.`?t.name:`${S}/${t.name}`;try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`)}catch(e){Ze(e instanceof Error?e.message:String(e))}}N(e=>e+1),X(`action`)},[xt,S,e,X]),Tt=(0,_.useCallback)(async()=>{let e=xt();if(console.info(`[data-ui] op=share supported=${Y} count=${e.length}`),Y)try{let t=await Promise.all(e.map(async e=>{let t=S===`.`?e.name:`${S}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=await(await fetch(r)).blob();return new File([i],e.name,{type:i.type||`application/octet-stream`})}));navigator.canShare({files:t})&&await navigator.share({files:t})}catch(e){console.warn(`[data-ui] op=share-failed err=${e instanceof Error?e.message:String(e)}`)}},[xt,Y,S,n]),Et=(0,_.useCallback)(()=>{M.current?.click()},[]),Dt=(0,_.useCallback)((e,t={})=>{let r=(r,i,a)=>{let o=new URLSearchParams({session_key:n,path:S===`.`?``:S,filename:e.name});t.relpath&&o.set(`relpath`,t.relpath),t.token&&o.set(`token`,t.token);for(let[e,t]of Object.entries(i))o.set(e,t);return new Promise(t=>{let n=new XMLHttpRequest;n.open(`POST`,`/api/admin/files/upload?${o.toString()}`),n.setRequestHeader(`Content-Type`,e.type||`application/octet-stream`),a&&(n.upload.onprogress=e=>{e.lengthComputable&&a(e.loaded)}),n.onload=()=>{let e={};try{e=JSON.parse(n.responseText)}catch{}t({status:n.status,data:e})},n.onerror=()=>t({status:0,data:{}}),n.onabort=()=>t({status:0,data:{error:`aborted`}}),n.send(r)})};if(e.size<=Ce)return r(e,{},n=>t.onProgress?.(n,e.size));let i=`${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`,a=Math.ceil(e.size/we);return(async()=>{let n={status:0,data:{}};for(let o=0;o<a;o++){let s=o*we;if(n=await r(e.slice(s,Math.min(s+we,e.size)),{uploadId:i,seq:String(o),total:String(a)},n=>t.onProgress?.(s+n,e.size)),!(n.status>=200&&n.status<300))return n}return n})()},[n,S]),Ot=(0,_.useCallback)(async e=>{j(null),We(!0),A({loaded:0,total:e.size});try{let{status:t,data:n}=await Dt(e,{onProgress:(e,t)=>A({loaded:e,total:t})});t>=200&&t<300&&n.path?(C(n.path.split(`/`).slice(0,-1).join(`/`)||`.`),N(e=>e+1)):j(t===0?`Network error during upload — the connection failed before the server responded.`:n.error??`Upload failed (HTTP ${t}).`)}finally{We(!1),A(null),M.current&&(M.current.value=``)}},[Dt]),kt=(0,_.useCallback)(e=>{R&&Array.from(e.dataTransfer.types).includes(`Files`)&&(e.preventDefault(),Ye(!0))},[R]),At=(0,_.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||Ye(!1)},[]),jt=(0,_.useCallback)(async e=>{e.preventDefault(),Ye(!1);let t=Math.random().toString(16).slice(2,10),n=Array.from(e.dataTransfer.items);if(console.info(`[data-ui] op=drop-received token=${t} items=${n.length}`),n.length===0)return;if(!R){console.info(`[data-ui] op=drop-rejected token=${t} reason=no-write`),j(`Open a folder inside your account to upload`);return}let r=n.map(e=>e.webkitGetAsEntry?.()).filter(e=>!!e);We(!0),j(null),qe(null);let i=performance.now();try{let e=await Ae(r),n=e.reduce((e,t)=>e+t.file.size,0),a=new Set(e.map(e=>e.relpath.split(`/`).slice(0,-1).join(`/`)).filter(Boolean)).size;console.info(`[data-ui] op=drop-walk token=${t} files=${e.length} dirs=${a} bytes=${n}`);let o=0,s=[];for(let n=0;n<e.length;n++){let{file:r,relpath:i}=e[n];console.info(`[data-ui] op=drop-file token=${t} rel="${i}" i=${n+1}/${e.length}`),A({loaded:0,total:r.size});let{status:a,data:c}=await Dt(r,{relpath:i,token:t,onProgress:(e,t)=>A({loaded:e,total:t})});if(a>=200&&a<300)o++,console.info(`[data-ui] op=drop-file-ok token=${t} rel="${i}"`);else{let e=a===0?`http=0`:je(a,c.error);s.push(`${i} (${e})`),console.info(`[data-ui] op=drop-file-skip token=${t} rel="${i}" reason=${e}`)}}let c=Math.round(performance.now()-i);console.info(`[data-ui] op=drop-done token=${t} uploaded=${o} skipped=${s.length} ms=${c}`),qe(`Uploaded ${o}, skipped ${s.length}${s.length?`: ${s.join(`, `)}`:``}`),N(e=>e+1)}catch(e){j(e instanceof Error?e.message:String(e))}finally{We(!1),A(null)}},[R,Dt]),Mt=(0,_.useCallback)(async()=>{let t=et.trim();if(t){L(null);try{let n=await e(`/api/admin/files/folder`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:S===`.`?``:S,name:t})}),r=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);P(!1),tt(``),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}}},[e,et,S]),Nt=(0,_.useCallback)(async()=>{if(!F)return;let t=nt.trim();if(!t)return;L(null);let n=S===`.`?F:`${S}/${F}`;try{let r=await e(`/api/admin/files/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:n,newName:t})}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);I(null),rt(``),X(`action`),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}},[e,nt,F,S,X]);(0,_.useEffect)(()=>{if(!z)return;let e=e=>{at.current&&!at.current.contains(e.target)&&B(!1)},t=e=>{e.key===`Escape`&&B(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[z]),(0,_.useEffect)(()=>{if(!V)return;let e=e=>{ot.current&&!ot.current.contains(e.target)&&H(!1)},t=e=>{e.key===`Escape`&&H(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[V]);let $=(0,_.useCallback)(e=>D.slice(0,e+1).map(e=>e.name).join(`/`),[D]),Pt=D.length>=2,Ft=Pt?[{name:`.`,label:`data`},...D.slice(0,D.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-toolbar`,children:[K?(0,v.jsxs)(`button`,{type:`button`,className:`data-select-cancel`,onClick:()=>X(`cancel`),"aria-label":`Cancel selection`,children:[(0,v.jsx)(d,{size:14}),` Cancel`]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-search-input`,children:[i===``&&(0,v.jsx)(ue,{size:14}),(0,v.jsx)(`input`,{ref:s,type:`text`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),h&&(0,v.jsx)(m,{size:14,className:`spin`}),i!==``&&(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:()=>{a(``),s.current?.focus()},title:`Clear search`,"aria-label":`Clear search`,children:(0,v.jsx)(d,{size:14})})]}),(0,v.jsxs)(`div`,{className:`data-toolbar-actions`,ref:ot,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-action-overflow`,onClick:()=>H(e=>!e),"aria-haspopup":`menu`,"aria-expanded":V,"aria-label":`File actions`,title:`File actions`,children:(0,v.jsx)(t,{size:16})}),(0,v.jsxs)(`div`,{className:`data-action-group`,role:`group`,"aria-label":`File actions`,"data-open":V?`true`:void 0,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{lt(),H(!1)},disabled:O,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[O?(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(o,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Refresh`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{Et(),H(!1)},disabled:Ue||!R,title:R?`Upload a file`:`Open a folder inside your account to upload`,"aria-label":`Upload a file`,children:[Ue?k&&k.total>0?(0,v.jsxs)(`span`,{className:`data-upload-pct`,children:[Math.round(k.loaded/k.total*100),`%`]}):(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(ve,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Upload`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{P(e=>!e),tt(``),L(null),H(!1)},disabled:Ue||!R,title:R?`New folder`:`Open a folder inside your account to create one`,"aria-label":`New folder`,children:[(0,v.jsx)(pe,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`New folder`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{yt(T===`grid`?`list`:`grid`),H(!1)},title:T===`grid`?`List view`:`Grid view`,"aria-label":T===`grid`?`Switch to list view`:`Switch to grid view`,"aria-pressed":T===`grid`,children:[T===`grid`?(0,v.jsx)(ge,{size:16}):(0,v.jsx)(he,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:T===`grid`?`List view`:`Grid view`})]})]})]})]}),(0,v.jsxs)(`div`,{className:`data-breadcrumbs`,children:[S!==`.`&&(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:dt,title:`Up one level`,"aria-label":`Up one level`,children:(0,v.jsx)(fe,{size:14})}),Pt?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,ref:at,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>B(e=>!e),"aria-haspopup":`menu`,"aria-expanded":z,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),z&&(0,v.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:Ft.map(e=>(0,v.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>G(e.name),title:e.label,children:e.label},e.name))})]}),[D.length-2,D.length-1].map(e=>{let t=D[e];return(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G(`.`),children:`data`}),D.map((e,t)=>(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),$e&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`Folder name`,value:et,autoFocus:!0,onChange:e=>tt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Mt(),e.key===`Escape`&&P(!1)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Mt,children:`Create`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>P(!1),children:`Cancel`})]}),F&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`New name`,value:nt,autoFocus:!0,onChange:e=>rt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Nt(),e.key===`Escape`&&I(null)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Nt,children:`Rename`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>I(null),children:`Cancel`})]}),it&&(0,v.jsx)(`div`,{className:`data-error`,children:it}),(0,v.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Ot(t)}})]}),(0,v.jsxs)(`div`,{className:`data-body`,"data-drag-active":Je?`true`:void 0,onDragEnter:kt,onDragOver:kt,onDragLeave:At,onDrop:jt,children:[(de!==null||l!==null)&&(0,v.jsxs)(`section`,{className:`data-panel`,children:[de&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,de]}),st.length>0&&(0,v.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:st.map(e=>{let t=e===U;return(0,v.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>be(t?null:e),children:Pe([e])??e},e)})}),l&&!h&&(0,v.jsxs)(`div`,{className:`data-results-meta`,children:[W.length,` of `,l.length,` result`,l.length===1?``:`s`]}),l&&!h&&!U&&b>0&&!x&&(0,v.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!0),children:[b,` low-confidence result`,b===1?``:`s`,` hidden — show all`]}),l&&!h&&!U&&x&&(0,v.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!1),children:`Showing all results — hide low-confidence`}),l&&l.length===0&&!h&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),W&&W.length>0&&(0,v.jsx)(`ul`,{className:`data-results`,children:W.map(e=>(0,v.jsx)(Ne,{hit:e,mode:ie,onDownload:ct,onLocate:ut},e.nodeId))})]}),(0,v.jsxs)(`section`,{className:`data-panel`,children:[k&&(0,v.jsxs)(`div`,{className:`data-upload-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":k.total>0?Math.round(k.loaded/k.total*100):void 0,children:[(0,v.jsx)(`div`,{className:`data-upload-progress-track`,children:(0,v.jsx)(`div`,{className:`data-upload-progress-fill`,style:{width:`${k.total>0?Math.round(k.loaded/k.total*100):0}%`}})}),(0,v.jsxs)(`span`,{className:`data-upload-progress-label`,children:[`Uploading… `,k.total>0?`${Math.round(k.loaded/k.total*100)}%`:``]})]}),Ge&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,Ge]}),Ke&&(0,v.jsx)(`div`,{className:`data-status`,children:Ke}),Xe&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,Xe]}),Ve&&(0,v.jsx)(`div`,{className:`data-error`,children:Ve}),O&&(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:14,className:`spin`}),` Loading…`]}),!K&&!O&&w&&w.length>0&&(0,v.jsxs)(`div`,{className:`data-select-hint`,children:[(0,v.jsx)(_e,{size:13}),(0,v.jsx)(`span`,{children:`Press and hold a file to select, rename, or delete it.`})]}),!O&&w&&w.length===0&&!Ve&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!O&&w&&w.length>0&&T===`grid`&&(0,v.jsx)(`ul`,{className:`data-grid`,children:w.map(e=>{let t=e.displayName??e.name,r=K&&q.has(e.name);if(e.kind===`directory`)return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t})]})},e.name);if(e.kind===`file`){let i=xe(e.name),a=S===`.`?e.name:`${S}/${e.name}`;return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile${i?` data-grid-tile-image`:``}`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>i?bt(e):vt(e),title:K?void 0:i?`Preview ${t}`:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),i?(0,v.jsx)(`img`,{className:`data-grid-thumb`,src:f(n,a),alt:t,loading:`lazy`,onError:()=>console.warn(`[data] op=thumb-error path=${a}`)}):(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t}),!i&&(0,v.jsx)(`span`,{className:`data-grid-sub`,children:Ie(e.sizeBytes)})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-grid-cell`,children:(0,v.jsxs)(`div`,{className:`data-grid-tile data-entry-disabled`,children:[(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,children:t}),(0,v.jsx)(`span`,{className:`data-grid-sub`,children:`special`})]})},e.name)})}),!O&&w&&w.length>0&&T===`list`&&(0,v.jsx)(`ul`,{className:`data-entries`,children:w.map(e=>{let t=e.displayName??e.name;if(e.kind===`directory`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]})},e.name)}if(e.kind===`file`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn data-entry-file`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>vt(e),title:K?void 0:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,v.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${Le(e.modifiedAt)}`,children:[Ie(e.sizeBytes),` · `,Le(e.modifiedAt)]})]})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-entry`,children:(0,v.jsx)(`div`,{className:`data-entry-btn data-entry-file data-entry-disabled`,children:(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,v.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})})},e.name)})})]})]}),K&&(0,v.jsx)(`div`,{className:`data-select-bar`,role:`toolbar`,"aria-label":`Selection actions`,children:(0,v.jsxs)(`div`,{className:`data-select-bar-inner`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Tt,disabled:!Y||q.size===0,title:Y?`Share selected files`:`Sharing is not supported on this device`,children:[(0,v.jsx)(te,{size:16}),` Share`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Ct,disabled:q.size===0,children:[(0,v.jsx)(se,{size:16}),` Download`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:()=>{let e=[...q][0];e&&(I(e),rt(e))},disabled:q.size!==1,children:[(0,v.jsx)(oe,{size:16}),` Rename`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action data-select-delete`,onClick:wt,disabled:q.size===0,children:[(0,v.jsx)(ne,{size:16}),` Delete`]})]})}),E&&(0,v.jsx)(`div`,{className:`chat-attachment-overlay`,role:`dialog`,"aria-label":E.alt,onClick:()=>Re(null),children:(0,v.jsx)(`img`,{className:`chat-attachment-overlay-image`,src:E.src,alt:E.alt})})]})}function w({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){(0,_.useEffect)(()=>{console.info(`[data-ui] op=mount header=operator home=absent`)},[]);let r=(0,_.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),i=(0,_.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(`files`),{subAccounts:l,activeAccountId:te,switching:ne,switchAccount:u}=ie(t);return(0,_.useEffect)(()=>{if(!t)return;let e=!1;return fetch(`/api/whatsapp-reader/conversations?session_key=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():{conversations:[]}).then(t=>{e||o(t.conversations??[])}).catch(()=>{}),()=>{e=!0}},[t]),(0,v.jsxs)(`main`,{className:`data-main`,children:[(0,v.jsx)(ee,{variant:`operator`,onNavigate:i,onOpenConversations:a.length>0?()=>c(`conversations`):void 0,onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:r,onDisconnect:async()=>!0,disconnecting:!1,subAccounts:l,activeAccountId:te,switchingAccount:ne,onSwitchAccount:u}),s===`conversations`?(0,v.jsx)(be,{conversations:a,sessionKey:t,onBack:()=>c(`files`)}):(0,v.jsx)(C,{adminFetch:e,cacheKey:t,sessionRefetchNonce:n})]})}function Me({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsx)(`main`,{className:`data-main`,children:(0,v.jsx)(C,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})})})}function Ne({hit:e,mode:t,onDownload:n,onLocate:r}){let i=T(e.properties),a=Fe(e.properties),o=Pe(e.labels),s=E(e.properties),[c,ee]=(0,_.useState)(!1),l=a&&a.length>280,te=c||!l?a:a?.slice(0,280)+`…`,ne=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`,u=e.properties.relativePath,d=typeof u==`string`&&u.length>0,f=d?u.lastIndexOf(`/`):-1,p=d?f===-1?`data`:u.slice(0,f):null;return(0,v.jsxs)(`li`,{className:`data-result`,children:[(0,v.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${i??o??`file`}`,children:[o&&(0,v.jsx)(`div`,{className:`data-result-header`,children:(0,v.jsx)(`span`,{className:`data-result-labels`,children:o})}),i&&(0,v.jsx)(`div`,{className:`data-result-title`,children:i}),a&&(0,v.jsx)(`pre`,{className:`data-result-body`,children:te}),(0,v.jsxs)(`div`,{className:`data-result-scores`,children:[s&&(0,v.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,Le(s),` · `]}),ne]})]}),d&&(0,v.jsxs)(`button`,{type:`button`,className:`data-result-locate`,onClick:()=>r(e),title:`Locate in ${p}`,"aria-label":`Locate in ${p}`,children:[(0,v.jsx)(me,{size:12}),p]}),l&&(0,v.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>ee(e=>!e),children:c?`Show less`:`Show more`})]})}function Pe(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function T(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function Fe(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function E(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function Ie(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function Le(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}export{Me as n,Ee as t};
|