@rubytech/create-maxy-code 0.1.454 → 0.1.456
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/package.json +1 -1
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/admin/PLUGIN.md +1 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +24 -6
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts +10 -0
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.d.ts.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js +44 -4
- package/payload/platform/plugins/admin/mcp/dist/tools/account-lifecycle.js.map +1 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -2
- package/payload/platform/plugins/docs/references/outlook-guide.md +2 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-bootstrap.test.js +52 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-bootstrap.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +11 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +6 -2
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/has-attachments.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/has-attachments.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/has-attachments.test.js +66 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/has-attachments.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-attachment.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-attachment.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-attachment.test.js +195 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-attachment.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js +19 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.d.ts +55 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.js +130 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js +2 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts +4 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js +2 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js +2 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js.map +1 -1
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +18 -3
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js +87 -67
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts +37 -11
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js +56 -14
- package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/{chunk-WC4WJR6X.js → chunk-F4D35LKL.js} +7 -3
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-5R0A40Is.js → AdminLoginScreens-Cl7VBbPS.js} +1 -1
- package/payload/server/public/assets/{AdminShell-B2HeKInP.js → AdminShell-lBaQG3aT.js} +1 -1
- package/payload/server/public/assets/{Checkbox-yjCERU3B.js → Checkbox-P8PNtn8n.js} +1 -1
- package/payload/server/public/assets/{admin-BDio0OER.js → admin-CB6VgLUJ.js} +1 -1
- package/payload/server/public/assets/{browser-bSeWXhod.js → browser-CKH8YoIg.js} +1 -1
- package/payload/server/public/assets/{calendar-MNAmsxL3.js → calendar-xQ-OEVti.js} +1 -1
- package/payload/server/public/assets/chat-DH8K5TeZ.js +1 -0
- package/payload/server/public/assets/chevron-left-Ceky-ebO.js +1 -0
- package/payload/server/public/assets/data-Cvv8Kg9J.js +1 -0
- package/payload/server/public/assets/{graph-DRWRwsUZ.js → graph-CrEmAyVE.js} +2 -2
- package/payload/server/public/assets/{graph-labels-Cy7GyGln.js → graph-labels-DbL7Cxod.js} +1 -1
- package/payload/server/public/assets/{maximize-2-BRHW5pKh.js → maximize-2-Up8UP3Iu.js} +1 -1
- package/payload/server/public/assets/{operator-Dv2k2JaW.js → operator-BE366HH-.js} +1 -1
- package/payload/server/public/assets/{page-BZRZZcqM.js → page-CQjjQz0V.js} +1 -1
- package/payload/server/public/assets/{page-CoBzMOIg.js → page-Wvb1S03b.js} +1 -1
- package/payload/server/public/assets/{public-CirpatD6.js → public-ZkXB-CHy.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-tv1JxnBS.js → rotate-ccw-TTz_MVO0.js} +1 -1
- package/payload/server/public/assets/{tasks-B8iXIZ3w.js → tasks-DNCoSRkP.js} +1 -1
- package/payload/server/public/assets/{time-entry-format-MGC9wMbZ.js → time-entry-format-BooKdDRT.js} +1 -1
- package/payload/server/public/assets/{useCopyFeedback-DdwMdpa-.js → useCopyFeedback-C23_n92I.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-DyoyGg7d.js → useSelectionMode-c4oZYAW0.js} +1 -1
- package/payload/server/public/assets/{useSubAccountSwitcher-CMi8n_8S.css → useSubAccountSwitcher-CHJo5leK.css} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-BDtJhfh_.js → useVoiceRecorder-BkxW-GL1.js} +1 -1
- package/payload/server/public/browser.html +5 -5
- package/payload/server/public/calendar.html +6 -6
- package/payload/server/public/chat.html +12 -12
- package/payload/server/public/data.html +10 -10
- package/payload/server/public/graph.html +11 -11
- package/payload/server/public/index.html +13 -13
- package/payload/server/public/operator.html +14 -14
- package/payload/server/public/public.html +12 -12
- package/payload/server/public/tasks.html +5 -5
- package/payload/server/server.js +1 -1
- package/payload/server/{userprofile-reconcile-GLGKDVQQ.js → userprofile-reconcile-QHVLY2AH.js} +12 -2
- package/payload/server/public/assets/chat-Bq4Uq3Ht.js +0 -1
- package/payload/server/public/assets/chevron-left-D5XwUM2x.js +0 -1
- package/payload/server/public/assets/data-DY10qHOy.js +0 -1
- /package/payload/server/public/assets/{useSubAccountSwitcher-B_zj_dY-.js → useSubAccountSwitcher-6UoTftbJ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-
|
|
1
|
+
import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-6UoTftbJ.js";import"./useVoiceRecorder-BkxW-GL1.js";import{v as i}from"./AdminShell-lBaQG3aT.js";import{a,c as o,i as s,o as c,r as l,s as u}from"./page-Wvb1S03b.js";import"./useCopyFeedback-C23_n92I.js";import"./useSelectionMode-c4oZYAW0.js";var d=n(),f=e(t(),1),p=r();function m({gateState:e,setGateState:t,grantInfo:n,resolvedSlugRef:r}){let[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(!1),[l,u]=(0,f.useState)(null);async function d(e){e.preventDefault();let n=a.trim().toLowerCase();if(!n){u(`Enter the email you were invited on.`);return}c(!0),u(null);try{let e=await fetch(`/api/access/request-magic-link`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contactValue:n,agentSlug:r.current})});if(e.status===429){u((await e.json().catch(()=>({})))?.error||`Too many requests. Try again later.`);return}t(`request-sent`)}catch{u(`Could not reach the server. Check your connection and try again.`)}finally{c(!1)}}return(0,p.jsxs)(`div`,{className:`access-gate`,children:[e===`verifying`&&(0,p.jsxs)(`div`,{className:`access-gate-message`,children:[(0,p.jsx)(`h2`,{children:`Verifying your link…`}),(0,p.jsx)(`p`,{children:`This takes a moment.`})]}),e===`verify-failed`&&(0,p.jsxs)(`div`,{className:`access-gate-message`,children:[(0,p.jsx)(`h2`,{children:`That link did not work`}),(0,p.jsx)(`p`,{children:`It may have expired, already been used, or been for a different agent. You can request a fresh one below.`}),(0,p.jsx)(i,{onClick:()=>{t(`request-link`),u(null)},children:`Request a new link`})]}),e===`request-link`&&(0,p.jsxs)(`form`,{className:`access-gate-form`,onSubmit:d,children:[(0,p.jsx)(`h2`,{children:n?.displayName?`Welcome back, ${n.displayName}`:`Sign in`}),(0,p.jsx)(`p`,{children:`Enter the email you were invited on and we will send you a fresh link.`}),(0,p.jsx)(`label`,{htmlFor:`access-email`,children:`Email`}),(0,p.jsx)(`input`,{id:`access-email`,type:`email`,inputMode:`email`,autoComplete:`email`,value:a,onChange:e=>o(e.target.value),disabled:s}),l&&(0,p.jsx)(`p`,{className:`access-gate-error`,children:l}),(0,p.jsx)(i,{type:`submit`,disabled:s||!a.trim(),children:s?`Sending…`:`Send me a link`})]}),e===`request-sent`&&(0,p.jsxs)(`div`,{className:`access-gate-message`,children:[(0,p.jsx)(`h2`,{children:`Check your email`}),(0,p.jsx)(`p`,{children:`If that address is on the invite list, a fresh link is on the way. It expires in 15 minutes.`}),(0,p.jsx)(i,{onClick:()=>{t(`request-link`),o(``),u(null)},children:`Try a different email`})]})]})}function h(){let[e,t]=(0,f.useState)(null),[n,r]=(0,f.useState)(null),[i,l]=(0,f.useState)(`loading`),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(null),[g,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(null),S=(0,f.useMemo)(()=>a(),[]),C=(0,f.useRef)(S||``),w=(0,f.useRef)(null),T=(0,f.useRef)(null),E=(0,f.useRef)(!1),D=(0,f.useRef)(null),[O,k]=(0,f.useState)(`request-link`),[A,j]=(0,f.useState)(null),M=(0,f.useRef)(null),N=(0,f.useRef)(null);(0,f.useEffect)(()=>{try{let e=sessionStorage.getItem(`maxy_session`);e&&(N.current=e)}catch{}},[]),(0,f.useEffect)(()=>{try{let e=c();e&&(sessionStorage.setItem(s,e),o&&console.info(`[public-webchat] op=seed-persisted len=${e.length} head=${e.slice(0,40)}`))}catch{}},[]);let P=(0,f.useCallback)(e=>{w.current=e,t(e);try{sessionStorage.setItem(`maxy_session`,e)}catch{}l(`chat`)},[]),F=(0,f.useCallback)(()=>{w.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}t(null),l(`auth-required`),k(`request-link`)},[]),I=(0,f.useCallback)(async e=>{k(`verifying`);try{let t=C.current,n=await fetch(`/api/access/verify-token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e,agentSlug:t})});if(window.history.replaceState({},``,window.location.pathname),n.ok){let e=await n.json().catch(()=>({}));return e?.displayName&&j({displayName:e.displayName,contactValue:``,expiresAt:null,status:`active`}),!0}return k(`verify-failed`),!1}catch{return k(`verify-failed`),!1}},[]),L=(0,f.useCallback)(async()=>{if(w.current)return w.current;if(T.current)return T.current;let e=(async()=>{try{let e=N.current,n=await fetch(`/api/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_id:u(),...S?{agent:S}:{},...e?{session_key:e}:{}})});if(!n.ok){let e=await n.json().catch(()=>({error:``}));return o&&console.error(`[session] POST /api/session failed: ${n.status} ${n.statusText}`,e),n.status===404?r(e.error||`Agent not found`):n.status===503&&r(e.error||`Service unavailable`),null}let i=await n.json();if(i.auth_required){i.agent_id&&(C.current=i.agent_id),p(i.displayName||``),i.agentImage&&h(i.agentImage),i.agentImageShape&&_(i.agentImageShape),i.showAgentName&&y(i.showAgentName),i.branding&&x(i.branding),l(`auth-required`);let e=new URLSearchParams(window.location.search).get(`token`);return e?await I(e)&&window.location.reload():k(`request-link`),null}w.current=i.session_key,t(i.session_key),i.displayName&&p(i.displayName),i.agentImage&&h(i.agentImage),i.agentImageShape&&_(i.agentImageShape),i.showAgentName&&y(i.showAgentName),i.branding&&x(i.branding),l(`chat`),i.resumed&&i.messages&&(E.current=!0,D.current=i.messages);try{sessionStorage.setItem(`maxy_session`,i.session_key)}catch{}return i.session_key}catch(e){return o&&console.error(`[session] fetch /api/session threw:`,e),r(`Unable to connect. Please check your connection and try again.`),null}finally{T.current=null}})();return T.current=e,e},[S,I]);return{sessionId:e,cacheKeyRef:w,sessionError:n,pageState:i,setPageState:l,agentDisplayName:d,agentImage:m,agentImageShape:g,showAgentName:v,agentSlug:S,branding:b,resolvedSlugRef:C,ensureSession:L,startNewSession:(0,f.useCallback)(async()=>{w.current=null,T.current=null,N.current=null,E.current=!1,D.current=null,t(null),r(null);try{sessionStorage.removeItem(`maxy_session`)}catch{}await L()},[L]),enterChat:P,enterGate:F,resumedRef:E,resumeMessagesRef:D,gateState:O,setGateState:k,grantInfo:A,setGrantInfo:j,gateCacheKeyRef:M}}function g(){let{ensureSession:e,pageState:t,gateState:n,setGateState:r,grantInfo:i,resolvedSlugRef:a}=h();return(0,f.useEffect)(()=>{e()},[e]),t===`loading`?(0,p.jsx)(`div`,{className:`public-loading`,children:`Loading…`}):t===`auth-required`?(0,p.jsx)(m,{gateState:n,setGateState:r,grantInfo:i,resolvedSlugRef:a}):(0,p.jsx)(`div`,{className:`public-shell`,children:(0,p.jsx)(l,{cacheKey:``,variant:`public`})})}(0,d.createRoot)(document.getElementById(`root`)).render((0,p.jsx)(g,{}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./useSubAccountSwitcher-
|
|
1
|
+
import{g as e}from"./useSubAccountSwitcher-6UoTftbJ.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-Ck5AOu5v.js";import{C as t,E as n,a as r,d as i,g as a,h as o,l as s,n as c,r as l,s as u,t as d,w as f,x as p}from"./useSubAccountSwitcher-B_zj_dY-.js";import{n as m,t as h}from"./time-entry-format-MGC9wMbZ.js";import{t as g}from"./rotate-ccw-tv1JxnBS.js";var _=a(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=a(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),y=f(),b=e(n(),1);function x(e=3e4){let[t,n]=(0,b.useState)(()=>Date.now());return(0,b.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function S(e,t){let n=new Map,r=(e,t,r)=>{let i=n.get(e)??{openCount:0,totalSeconds:0};i.totalSeconds+=t,r&&(i.openCount+=1),n.set(e,i)};for(let t of e)t.clientName&&r(t.clientName,t.secondsLogged,!0);for(let e of t)e.clientName&&r(e.clientName,e.secondsLogged,!1);let i=[...n.entries()].map(([e,t])=>({name:e,openCount:t.openCount,totalSeconds:t.totalSeconds}));return i.sort((e,t)=>t.openCount-e.openCount||e.name.localeCompare(t.name)),C(e,i),i}function C(e,t){let n=t.reduce((e,t)=>e+t.openCount,0),r=e.filter(e=>!e.clientName).length,i=n+r===e.length;return i||console.warn(`[tasks-clients] reconcile-mismatch assigned=${n} unassigned=${r} openTotal=${e.length}`),i}var w=p();function T(e){let t=[];return e.clientName&&t.push(e.clientName),e.propertyAddress&&t.push(e.propertyAddress),e.fee!=null&&t.push(`£${e.fee}`),t.join(` · `)}function E(e){return[e.clientName,e.propertyAddress].filter(Boolean).join(` · `)}function D(e,t){if(e.running&&e.runningStartedAt){let n=Date.parse(e.runningStartedAt);if(Number.isFinite(n))return e.secondsLogged+Math.max(0,(t-n)/1e3)}return e.secondsLogged}function O({clients:e,onSelect:t}){return(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Clients`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[e.length,` total`]})]}),e.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No clients yet.`}),e.map(e=>(0,w.jsx)(`button`,{className:`tasks-row tasks-client-row`,onClick:()=>t(e.name),children:(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),(0,w.jsxs)(`div`,{className:`tasks-row-sub`,children:[e.openCount,` open · `,h(e.totalSeconds),` logged`]})]})},e.name))]})}function k({adminFetch:e}){let[t,n]=(0,b.useState)({open:[],completed:[]}),[a,c]=(0,b.useState)(!1),[l,d]=(0,b.useState)(!1),f=(0,b.useRef)(!1),p=(0,b.useRef)(``),y=x(1e3),[C,k]=(0,b.useState)(`open`),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),[P,F]=(0,b.useState)(``),I=(0,b.useMemo)(()=>S(t.open,t.completed),[t]),L=(0,b.useCallback)(e=>{j(e),k(`open`)},[]);(0,b.useEffect)(()=>{A&&!I.some(e=>e.name===A)&&j(null)},[I,A]);let R=A?t.open.filter(e=>e.clientName===A||e.running):t.open,z=A?t.completed.filter(e=>e.clientName===A):t.completed,B=(0,b.useCallback)(async()=>{let t=await e(`/api/admin/tasks-list`);t.ok&&n(await t.json()),c(!0)},[e]);(0,b.useEffect)(()=>{B()},[B]);let V=(0,b.useCallback)(async(t,n,r)=>{if(!f.current){f.current=!0,d(!0);try{await e(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({taskId:n,...r})}),await B()}finally{f.current=!1,d(!1)}}},[e,B]),H=(0,b.useCallback)(e=>{let t=String(Math.round(e.secondsLogged/60));p.current=t,N(e.taskId),F(t)},[]),U=(0,b.useCallback)(()=>{N(null),F(``)},[]),W=(0,b.useCallback)(async e=>{let t=P.trim(),n=Number(t);if(!(t===``||!Number.isInteger(n)||n<0)){if(t===p.current){U();return}N(null),F(``),await V(`/api/admin/task-time-adjust`,e,{newSeconds:n*60})}},[P,V,U]),G=(0,b.useCallback)(e=>{V(`/api/admin/task-time-adjust`,e,{newSeconds:0})},[V]);if(!a)return(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(i,{size:18,className:`spin`}),` Loading…`]});let K=e=>M===e.taskId?(0,w.jsxs)(`div`,{className:`tasks-edit`,children:[(0,w.jsx)(`input`,{className:`tasks-edit-input`,type:`number`,min:0,step:1,"aria-label":`Logged minutes`,value:P,onChange:e=>F(e.target.value)}),(0,w.jsx)(`span`,{className:`tasks-edit-unit`,children:`min`}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void W(e.taskId),children:[(0,w.jsx)(o,{size:14}),` Save`]}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,onClick:U,children:[(0,w.jsx)(r,{size:14}),` Cancel`]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Edit time`,disabled:l||e.running,title:e.running?`Stop the timer before editing time`:void 0,onClick:()=>H(e),children:(0,w.jsx)(s,{size:14})}),(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Reset time`,disabled:l||e.running,title:e.running?`Stop the timer before resetting time`:void 0,onClick:()=>G(e.taskId),children:(0,w.jsx)(g,{size:14})})]});return(0,w.jsxs)(`div`,{className:`tasks-body`,children:[(0,w.jsxs)(`div`,{className:`tasks-tabs`,children:[(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`open`?`tasks-tab-active`:``}`,onClick:()=>k(`open`),children:[`Open `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.open.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`completed`?`tasks-tab-active`:``}`,onClick:()=>k(`completed`),children:[`Completed `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.completed.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`clients`?`tasks-tab-active`:``}`,onClick:()=>k(`clients`),children:[`Clients `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:I.length})]})]}),C===`clients`?(0,w.jsx)(O,{clients:I,onSelect:L}):(0,w.jsxs)(w.Fragment,{children:[A&&(0,w.jsxs)(`div`,{className:`tasks-filter-banner`,children:[(0,w.jsxs)(`span`,{children:[`Showing `,A]}),(0,w.jsx)(`button`,{className:`tasks-filter-clear`,onClick:()=>j(null),children:`Clear`})]}),C===`open`?(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Open tasks`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[R.length,` to do`]})]}),R.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No open tasks.`}),R.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row`,children:[(0,w.jsx)(`button`,{className:`tasks-check`,"aria-label":`Mark complete`,disabled:l||e.running,title:e.running?`Stop the timer before completing`:void 0,onClick:()=>void V(`/api/admin/task-complete`,e.taskId),children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),T(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:T(e)})]}),(0,w.jsx)(`div`,{className:`tasks-row-elapsed`,children:h(D(e,y))}),K(e),M===e.taskId?null:e.running?(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-stop`,e.taskId),children:[(0,w.jsx)(u,{size:14}),` Stop`]}):(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-start`,e.taskId),children:[(0,w.jsx)(m,{size:14}),` Start`]})]},e.taskId))]}):(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Completed`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[z.length,` done`]})]}),z.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`Nothing completed yet.`}),z.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row tasks-row-done`,children:[(0,w.jsx)(`span`,{className:`tasks-check tasks-check-done`,children:(0,w.jsx)(_,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),E(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:E(e)})]}),(0,w.jsxs)(`div`,{className:`tasks-row-elapsed`,children:[h(e.secondsLogged),e.fee==null?``:` · £${e.fee}`]}),K(e)]},e.taskId))]})]})]})}function A({cacheKey:e}){let{adminFetch:n,cacheKey:r}=t({initialCacheKey:e,surface:`tasks`}),{subAccounts:i,activeAccountId:a,switching:o,switchAccount:s}=d(r),l=(0,b.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,w.jsxs)(`main`,{className:`tasks-main`,children:[(0,w.jsx)(c,{variant:`operator`,onNavigate:(0,b.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:l,onDisconnect:async()=>!0,disconnecting:!1,cacheKey:r,subAccounts:i,activeAccountId:a,switchingAccount:o,onSwitchAccount:s}),(0,w.jsx)(k,{adminFetch:n})]})}function j(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(!1);return(0,b.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,w.jsx)(l,{cacheKey:e,surface:`tasks`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=tasks`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,w.jsx)(`div`,{className:`tasks-page tasks-page-full`,children:(0,w.jsx)(A,{cacheKey:e})})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-empty`,children:[(0,w.jsx)(`p`,{children:`You are not signed in.`}),(0,w.jsxs)(`p`,{children:[`Open the `,(0,w.jsx)(`a`,{href:`/`,className:`tasks-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(i,{size:18,className:`spin`}),` Loading…`]})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,w.jsx)(j,{}));
|
|
1
|
+
import{o as e}from"./chunk-Ck5AOu5v.js";import{C as t,E as n,a as r,d as i,g as a,h as o,l as s,n as c,r as l,s as u,t as d,w as f,x as p}from"./useSubAccountSwitcher-6UoTftbJ.js";import{n as m,t as h}from"./time-entry-format-BooKdDRT.js";import{t as g}from"./rotate-ccw-TTz_MVO0.js";var _=a(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=a(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),y=f(),b=e(n(),1);function x(e=3e4){let[t,n]=(0,b.useState)(()=>Date.now());return(0,b.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function S(e,t){let n=new Map,r=(e,t,r)=>{let i=n.get(e)??{openCount:0,totalSeconds:0};i.totalSeconds+=t,r&&(i.openCount+=1),n.set(e,i)};for(let t of e)t.clientName&&r(t.clientName,t.secondsLogged,!0);for(let e of t)e.clientName&&r(e.clientName,e.secondsLogged,!1);let i=[...n.entries()].map(([e,t])=>({name:e,openCount:t.openCount,totalSeconds:t.totalSeconds}));return i.sort((e,t)=>t.openCount-e.openCount||e.name.localeCompare(t.name)),C(e,i),i}function C(e,t){let n=t.reduce((e,t)=>e+t.openCount,0),r=e.filter(e=>!e.clientName).length,i=n+r===e.length;return i||console.warn(`[tasks-clients] reconcile-mismatch assigned=${n} unassigned=${r} openTotal=${e.length}`),i}var w=p();function T(e){let t=[];return e.clientName&&t.push(e.clientName),e.propertyAddress&&t.push(e.propertyAddress),e.fee!=null&&t.push(`£${e.fee}`),t.join(` · `)}function E(e){return[e.clientName,e.propertyAddress].filter(Boolean).join(` · `)}function D(e,t){if(e.running&&e.runningStartedAt){let n=Date.parse(e.runningStartedAt);if(Number.isFinite(n))return e.secondsLogged+Math.max(0,(t-n)/1e3)}return e.secondsLogged}function O({clients:e,onSelect:t}){return(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Clients`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[e.length,` total`]})]}),e.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No clients yet.`}),e.map(e=>(0,w.jsx)(`button`,{className:`tasks-row tasks-client-row`,onClick:()=>t(e.name),children:(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),(0,w.jsxs)(`div`,{className:`tasks-row-sub`,children:[e.openCount,` open · `,h(e.totalSeconds),` logged`]})]})},e.name))]})}function k({adminFetch:e}){let[t,n]=(0,b.useState)({open:[],completed:[]}),[a,c]=(0,b.useState)(!1),[l,d]=(0,b.useState)(!1),f=(0,b.useRef)(!1),p=(0,b.useRef)(``),y=x(1e3),[C,k]=(0,b.useState)(`open`),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),[P,F]=(0,b.useState)(``),I=(0,b.useMemo)(()=>S(t.open,t.completed),[t]),L=(0,b.useCallback)(e=>{j(e),k(`open`)},[]);(0,b.useEffect)(()=>{A&&!I.some(e=>e.name===A)&&j(null)},[I,A]);let R=A?t.open.filter(e=>e.clientName===A||e.running):t.open,z=A?t.completed.filter(e=>e.clientName===A):t.completed,B=(0,b.useCallback)(async()=>{let t=await e(`/api/admin/tasks-list`);t.ok&&n(await t.json()),c(!0)},[e]);(0,b.useEffect)(()=>{B()},[B]);let V=(0,b.useCallback)(async(t,n,r)=>{if(!f.current){f.current=!0,d(!0);try{await e(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({taskId:n,...r})}),await B()}finally{f.current=!1,d(!1)}}},[e,B]),H=(0,b.useCallback)(e=>{let t=String(Math.round(e.secondsLogged/60));p.current=t,N(e.taskId),F(t)},[]),U=(0,b.useCallback)(()=>{N(null),F(``)},[]),W=(0,b.useCallback)(async e=>{let t=P.trim(),n=Number(t);if(!(t===``||!Number.isInteger(n)||n<0)){if(t===p.current){U();return}N(null),F(``),await V(`/api/admin/task-time-adjust`,e,{newSeconds:n*60})}},[P,V,U]),G=(0,b.useCallback)(e=>{V(`/api/admin/task-time-adjust`,e,{newSeconds:0})},[V]);if(!a)return(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(i,{size:18,className:`spin`}),` Loading…`]});let K=e=>M===e.taskId?(0,w.jsxs)(`div`,{className:`tasks-edit`,children:[(0,w.jsx)(`input`,{className:`tasks-edit-input`,type:`number`,min:0,step:1,"aria-label":`Logged minutes`,value:P,onChange:e=>F(e.target.value)}),(0,w.jsx)(`span`,{className:`tasks-edit-unit`,children:`min`}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void W(e.taskId),children:[(0,w.jsx)(o,{size:14}),` Save`]}),(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,onClick:U,children:[(0,w.jsx)(r,{size:14}),` Cancel`]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Edit time`,disabled:l||e.running,title:e.running?`Stop the timer before editing time`:void 0,onClick:()=>H(e),children:(0,w.jsx)(s,{size:14})}),(0,w.jsx)(`button`,{className:`tasks-time-btn`,"aria-label":`Reset time`,disabled:l||e.running,title:e.running?`Stop the timer before resetting time`:void 0,onClick:()=>G(e.taskId),children:(0,w.jsx)(g,{size:14})})]});return(0,w.jsxs)(`div`,{className:`tasks-body`,children:[(0,w.jsxs)(`div`,{className:`tasks-tabs`,children:[(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`open`?`tasks-tab-active`:``}`,onClick:()=>k(`open`),children:[`Open `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.open.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`completed`?`tasks-tab-active`:``}`,onClick:()=>k(`completed`),children:[`Completed `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:t.completed.length})]}),(0,w.jsxs)(`button`,{className:`tasks-tab ${C===`clients`?`tasks-tab-active`:``}`,onClick:()=>k(`clients`),children:[`Clients `,(0,w.jsx)(`span`,{className:`tasks-tab-badge`,children:I.length})]})]}),C===`clients`?(0,w.jsx)(O,{clients:I,onSelect:L}):(0,w.jsxs)(w.Fragment,{children:[A&&(0,w.jsxs)(`div`,{className:`tasks-filter-banner`,children:[(0,w.jsxs)(`span`,{children:[`Showing `,A]}),(0,w.jsx)(`button`,{className:`tasks-filter-clear`,onClick:()=>j(null),children:`Clear`})]}),C===`open`?(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Open tasks`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[R.length,` to do`]})]}),R.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`No open tasks.`}),R.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row`,children:[(0,w.jsx)(`button`,{className:`tasks-check`,"aria-label":`Mark complete`,disabled:l||e.running,title:e.running?`Stop the timer before completing`:void 0,onClick:()=>void V(`/api/admin/task-complete`,e.taskId),children:(0,w.jsx)(v,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),T(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:T(e)})]}),(0,w.jsx)(`div`,{className:`tasks-row-elapsed`,children:h(D(e,y))}),K(e),M===e.taskId?null:e.running?(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-stop`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-stop`,e.taskId),children:[(0,w.jsx)(u,{size:14}),` Stop`]}):(0,w.jsxs)(`button`,{className:`tasks-btn tasks-btn-start`,disabled:l,onClick:()=>void V(`/api/admin/task-timer-start`,e.taskId),children:[(0,w.jsx)(m,{size:14}),` Start`]})]},e.taskId))]}):(0,w.jsxs)(`section`,{className:`tasks-card`,children:[(0,w.jsxs)(`div`,{className:`tasks-card-head`,children:[(0,w.jsx)(`span`,{className:`tasks-card-title`,children:`Completed`}),(0,w.jsxs)(`span`,{className:`tasks-card-count`,children:[z.length,` done`]})]}),z.length===0&&(0,w.jsx)(`div`,{className:`tasks-empty`,children:`Nothing completed yet.`}),z.map(e=>(0,w.jsxs)(`div`,{className:`tasks-row tasks-row-done`,children:[(0,w.jsx)(`span`,{className:`tasks-check tasks-check-done`,children:(0,w.jsx)(_,{size:18})}),(0,w.jsxs)(`div`,{className:`tasks-row-main`,children:[(0,w.jsx)(`div`,{className:`tasks-row-name`,children:e.name}),E(e)&&(0,w.jsx)(`div`,{className:`tasks-row-sub`,children:E(e)})]}),(0,w.jsxs)(`div`,{className:`tasks-row-elapsed`,children:[h(e.secondsLogged),e.fee==null?``:` · £${e.fee}`]}),K(e)]},e.taskId))]})]})]})}function A({cacheKey:e}){let{adminFetch:n,cacheKey:r}=t({initialCacheKey:e,surface:`tasks`}),{subAccounts:i,activeAccountId:a,switching:o,switchAccount:s}=d(r),l=(0,b.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,w.jsxs)(`main`,{className:`tasks-main`,children:[(0,w.jsx)(c,{variant:`operator`,onNavigate:(0,b.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:l,onDisconnect:async()=>!0,disconnecting:!1,cacheKey:r,subAccounts:i,activeAccountId:a,switchingAccount:o,onSwitchAccount:s}),(0,w.jsx)(k,{adminFetch:n})]})}function j(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(!1);return(0,b.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,w.jsx)(l,{cacheKey:e,surface:`tasks`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=tasks`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,w.jsx)(`div`,{className:`tasks-page tasks-page-full`,children:(0,w.jsx)(A,{cacheKey:e})})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-empty`,children:[(0,w.jsx)(`p`,{children:`You are not signed in.`}),(0,w.jsxs)(`p`,{children:[`Open the `,(0,w.jsx)(`a`,{href:`/`,className:`tasks-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,w.jsx)(`div`,{className:`tasks-page`,children:(0,w.jsxs)(`div`,{className:`tasks-loading`,children:[(0,w.jsx)(i,{size:18,className:`spin`}),` Loading…`]})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,w.jsx)(j,{}));
|
package/payload/server/public/assets/{time-entry-format-MGC9wMbZ.js → time-entry-format-BooKdDRT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./useSubAccountSwitcher-
|
|
1
|
+
import{g as e}from"./useSubAccountSwitcher-6UoTftbJ.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);function n(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(r).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`}export{t as n,n as t};
|
package/payload/server/public/assets/{useCopyFeedback-DdwMdpa-.js → useCopyFeedback-C23_n92I.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,g as n}from"./useSubAccountSwitcher-
|
|
1
|
+
import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,g as n}from"./useSubAccountSwitcher-6UoTftbJ.js";import{t as r}from"./useSelectionMode-c4oZYAW0.js";var i=n(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),a=e(t(),1);function o(e){let[t,n]=(0,a.useState)(`idle`),i=(0,a.useRef)(null),o=(0,a.useRef)(e?.onResult);return o.current=e?.onResult,(0,a.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),{status:t,copy:(0,a.useCallback)(async e=>{let t=await r(e);n(t?`ok`:`fail`),o.current?.(t),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>n(`idle`),1500)},[])}}export{i as n,o as t};
|
package/payload/server/public/assets/{useSelectionMode-DyoyGg7d.js → useSelectionMode-c4oZYAW0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-Ck5AOu5v.js";import{E as e,f as t,g as n,x as r}from"./useSubAccountSwitcher-
|
|
1
|
+
import"./chunk-Ck5AOu5v.js";import{E as e,f as t,g as n,x as r}from"./useSubAccountSwitcher-6UoTftbJ.js";var i=n(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),a=n(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),o=n(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),s=n(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),c=n(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),l=r(),u={whatsapp:{fill:`#25D366`,label:`WhatsApp`,path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.247-.694.247-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885M20.52 3.449C18.24 1.245 15.24.044 12.045.044 5.463.044.103 5.404.1 11.99c0 2.096.546 4.142 1.588 5.945L0 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.585 0 11.946-5.36 11.949-11.946 0-3.193-1.24-6.19-3.495-8.445`},telegram:{fill:`#229ED9`,label:`Telegram`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`}};function d({channel:e,size:t=16}){let n=u[e];return(0,l.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:n.fill,role:`img`,"aria-label":n.label,className:`channel-icon`,children:(0,l.jsx)(`path`,{d:n.path})})}var f={whatsapp:`whatsapp`,telegram:`telegram`};function p({channel:e,size:n=13}){let r=f[e];return r?(0,l.jsx)(d,{channel:r,size:n}):e===`webchat`?(0,l.jsx)(t,{size:n,className:`channel-icon`,role:`img`,"aria-label":`Web chat`,style:{color:`var(--text-tertiary)`}}):(0,l.jsx)(o,{size:n,className:`channel-icon`,role:`img`,"aria-label":e,style:{color:`var(--text-tertiary)`}})}function m(e){let t=h(e);if(!t.toLowerCase().endsWith(`@g.us`))return!1;let n=t.slice(0,t.length-5);return!n||n.includes(`@`)?!1:/^[0-9]+(-[0-9]+)*$/.test(n)}function h(e){let t=e.trim();for(;;){let e=t;if(t=t.replace(/^whatsapp:/i,``).trim(),t===e)return t}}var g=[`whatsapp`,`telegram`];function _(e){return e.source===`store`?`store:${e.remoteJid??``}`:e.sessionId}var v=[`whatsapp`,`telegram`,`webchat`],y={whatsapp:`WhatsApp`,telegram:`Telegram`,webchat:`Webchat`};function b(e){return v.map(t=>({channel:t,label:y[t],rows:e.filter(e=>e.channel===t)})).filter(e=>e.rows.length>0)}function x(e){let t=e.operatorName??e.whatsappName;return t?e.senderId?`${t} ${e.senderId}`:t:e.senderId??e.title}function S(e,t,n=`data`){let r=`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`+(n===`data`?``:`&root=${encodeURIComponent(n)}`),i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()}function C(e,t){let n=new URLSearchParams;n.set(`session_key`,e);for(let e of t)n.append(`path`,e);let r=document.createElement(`a`);r.href=`/api/admin/files/download-zip?${n.toString()}`,r.rel=`noopener noreferrer`,document.body.appendChild(r),r.click(),r.remove()}function w(e,t,n=`data`){return`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}&disposition=inline`+(n===`data`?``:`&root=${encodeURIComponent(n)}`)}e();async function T(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}export{b as a,_ as c,p as d,c as f,i as h,C as i,m as l,a as m,w as n,x as o,s as p,S as r,g as s,T as t,d as u};
|