PageSourceSearch

https://repsshield.com/assets/automation-mhZxDjX1.js

js repsshield.com collected 2026-10-02 02:02:08 UTC 14,652 bytes, 1 lines download raw bytes

1import{j as e,C as m,b as T,au as C,c as S,e as o,aS as z,d as x,L as d,R as p,w as D,V as h,aF as g,b0 as I,Q as J,B as r,ae as N,q as b,aB as F,b1 as E,b2 as B,b3 as O,b4 as K,b5 as L,b6 as X,a$ as y,_ as j,b7 as Y}from"./index-DGo-vssZ.js";import{r as A}from"./vendor-Qgthw7N1.js";import{u as Z}from"./useAutomation-B2DSQfVe.js";import{C as v}from"./checkbox-i5ygXx_L.js";import{T as ee}from"./test-tube-diagonal-CXQTMvzO.js";import"./automationService-OVbtW0oB.js";function se({automation:s,onUpdate:l,onSave:n,isSaving:a}){return e.jsxs(m,{children:[e.jsxs(T,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(C,{className:"h-5 w-5 text-blue-500"}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(S,{children:"Email Automation"}),s.enabled&&e.jsx(o,{className:"bg-green-500 text-xs",children:"Active"}),!s.enabled&&e.jsx(o,{variant:"secondary",className:"text-xs",children:"Disabled"})]}),s.matchCount&&s.matchCount>0&&e.jsxs(o,{variant:"outline",className:"text-xs",children:[s.matchCount," matches"]})]}),e.jsx(z,{children:"Configure trusted patterns to boost AI confidence for email activities"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{htmlFor:"email-enabled",className:"text-sm font-medium",children:"Enable email automation"}),e.jsx(v,{id:"email-enabled",checked:s.enabled,onCheckedChange:t=>l({...s,enabled:t})})]}),s.enabled&&e.jsxs(e.Fragment,{children:[s.matchCount&&s.matchCount>0&&e.jsxs(p,{className:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",children:[e.jsx(D,{className:"h-4 w-4 text-green-600"}),e.jsxs(h,{className:"text-sm text-green-800 dark:text-green-200",children:["Matched ",s.matchCount," emails this month"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"email-contacts",className:"text-sm",children:["Trusted Contacts ",e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(g,{id:"email-contacts",placeholder:"Comma-separated, e.g.: [email protected], @realestate.com",value:s.trustedContacts.join(", "),onChange:t=>l({...s,trustedContacts:t.target.value.split(",").map(c=>c.trim()).filter(Boolean)}),rows:3,className:"font-mono text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use @domain.com to match entire domains"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"email-keywords",className:"text-sm",children:["Keywords ",e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(g,{id:"email-keywords",placeholder:"Comma-separated, e.g.: property, listing, contract",value:s.keywords.join(", "),onChange:t=>l({...s,keywords:t.target.value.split(",").map(c=>c.trim()).filter(Boolean)}),rows:2,className:"font-mono text-sm"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(v,{id:"email-auto-approve",checked:s.autoApprove,onCheckedChange:t=>l({...s,autoApprove:t})}),e.jsxs(d,{htmlFor:"email-auto-approve",className:"text-sm cursor-pointer flex items-center gap-2",children:["Auto-approve high confidence matches",s.autoApprove&&e.jsx(I,{className:"h-4 w-4 text-green-500"})]})]}),e.jsxs(p,{children:[e.jsx(J,{className:"h-4 w-4"}),e.jsx(h,{className:"text-xs",children:"Enable for fully trusted sources. Disable to manually review all matches."})]})]}),n&&e.jsx("div",{className:"pt-2",children:e.jsx(r,{size:"sm",onClick:n,disabled:a,className:"w-full",children:a?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"h-3 w-3 mr-2 animate-spin"}),"Saving..."]}):"Save Email Automation"})})]})]})]})}function ae({automation:s,onUpdate:l,onSave:n,isSaving:a}){return e.jsxs(m,{children:[e.jsxs(T,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(b,{className:"h-5 w-5 text-purple-500"}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(S,{children:"Calendar Automation"}),s.enabled&&e.jsx(o,{className:"bg-purple-500 text-xs",children:"Active"}),!s.enabled&&e.jsx(o,{variant:"secondary",className:"text-xs",children:"Disabled"})]}),s.matchCount&&s.matchCount>0&&e.jsxs(o,{variant:"outline",className:"text-xs",children:[s.matchCount," matches"]})]}),e.jsx(z,{children:"Configure trusted patterns to boost AI confidence for calendar events"})]}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{htmlFor:"calendar-enabled",className:"text-sm font-medium",children:"Enable calendar automation"}),e.jsx(v,{id:"calendar-enabled",checked:s.enabled,onCheckedChange:t=>l({...s,enabled:t})})]}),s.enabled&&e.jsxs(e.Fragment,{children:[s.matchCount&&s.matchCount>0&&e.jsxs(p,{className:"bg-purple-50 dark:bg-purple-950 border-purple-200 dark:border-purple-800",children:[e.jsx(D,{className:"h-4 w-4 text-purple-600"}),e.jsxs(h,{className:"text-sm text-purple-800 dark:text-purple-200",children:["Matched ",s.matchCount," events this month"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"calendar-keywords",className:"text-sm",children:"Trusted Keywords"}),e.jsx(g,{id:"calendar-keywords",placeholder:"Comma-separated, e.g.: inspection, showing, walkthrough",value:s.trustedKeywords.join(", "),onChange:t=>l({...s,trustedKeywords:t.target.value.split(",").map(c=>
1c.trim()).filter(Boolean)}),rows:2,className:"font-mono text-sm"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"calendar-organizers",className:"text-sm",children:["Trusted Organizers ",e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(g,{id:"calendar-organizers",placeholder:"Comma-separated, e.g.: [email protected], [email protected]",value:s.trustedOrganizers.join(", "),onChange:t=>l({...s,trustedOrganizers:t.target.value.split(",").map(c=>c.trim()).filter(Boolean)}),rows:3,className:"font-mono text-sm"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(v,{id:"calendar-auto-approve",checked:s.autoApprove,onCheckedChange:t=>l({...s,autoApprove:t})}),e.jsxs(d,{htmlFor:"calendar-auto-approve",className:"text-sm cursor-pointer flex items-center gap-2",children:["Auto-approve high confidence matches",s.autoApprove&&e.jsx(I,{className:"h-4 w-4 text-green-500"})]})]}),e.jsxs(p,{children:[e.jsx(F,{className:"h-4 w-4"}),e.jsx(h,{className:"text-xs",children:"Most users disable auto-approve for calendar events to review duration and details."})]})]}),n&&e.jsx("div",{className:"pt-2",children:e.jsx(r,{size:"sm",onClick:n,disabled:a,className:"w-full",children:a?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"h-3 w-3 mr-2 animate-spin"}),"Saving..."]}):"Save Calendar Automation"})})]})]})]})}const k=[{id:"template-1",name:"Client Email Tracking",description:"Auto-approve emails from trusted clients",icon:"📧",type:"email",template:{trustedContacts:[],keywords:[],autoApprove:!0}},{id:"template-2",name:"Tenant Communications",description:"Boost confidence for tenant-related emails",icon:"👥",type:"email",template:{keywords:["tenant","lease","rent","maintenance"],autoApprove:!0}},{id:"template-3",name:"Document Review",description:"Require review for contract emails",icon:"📄",type:"email",template:{keywords:["contract","agreement","review","document"],autoApprove:!1}},{id:"template-4",name:"Property Showings",description:"Require review for viewing appointments",icon:"🏠",type:"calendar",template:{trustedKeywords:["showing","viewing","tour","open house"],autoApprove:!1}},{id:"template-5",name:"Maintenance Coordination",description:"Track maintenance activities",icon:"🔧",type:"calendar",template:{trustedKeywords:["maintenance","repair","contractor"],autoApprove:!1}},{id:"template-6",name:"Investor Meetings",description:"Auto-approve investor communications",icon:"💼",type:"calendar",template:{trustedKeywords:["investor","partnership","funding"],autoApprove:!0}}];function te({open:s,onOpenChange:l,onUseTemplate:n}){return e.jsx(E,{open:s,onOpenChange:l,children:e.jsxs(B,{className:"max-w-2xl max-h-[80vh]",children:[e.jsxs(O,{children:[e.jsx(K,{children:"Automation Templates"}),e.jsx(L,{children:"Quick-start configurations for common patterns"})]}),e.jsx(X,{className:"h-[450px] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Email Templates"]}),e.jsx("div",{className:"space-y-2",children:k.filter(a=>a.type==="email").map(a=>e.jsx(m,{className:"cursor-pointer hover:bg-accent transition-colors",children:e.jsx(x,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"text-2xl",children:a.icon}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("h4",{className:"font-semibold text-sm",children:a.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.description}),e.jsxs(r,{size:"sm",variant:"outline",onClick:()=>n(a),className:"gap-2 h-7 text-xs",children:[e.jsx(y,{className:"h-3 w-3"}),"Use Template"]})]})]})})},a.id))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(b,{className:"h-4 w-4"}),"Calendar Templates"]}),e.jsx("div",{className:"space-y-2",children:k.filter(a=>a.type==="calendar").map(a=>e.jsx(m,{className:"cursor-pointer hover:bg-accent transition-colors",children:e.jsx(x,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"text-2xl",children:a.icon}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("h4",{className:"font-semibold text-sm",children:a.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.description}),e.jsxs(r,{size:"sm",variant:"outline",onClick:()=>n(a),className:"gap-2 h-7 text-xs",children:[e.jsx(y,{className:"h-3 w-3"}),"Use Template"]})]})]})})},a.id))})]})]})})]})})}const le=[{id:"suggestion-1",name:"ABC Realty Client Emails",pattern:"23 emails from *@abcrealty.com in the past month",confidence:95,type:"email",suggestion:{trustedContacts:["@abcrealty.com"],autoApprove:!0}}
1,{id:"suggestion-2",name:"Weekly Property Inspections",pattern:'Recurring calendar events every Tuesday with "inspection"',confidence:89,type:"calendar",suggestion:{trustedKeywords:["inspection","walkthrough"],autoApprove:!1}}];function ne({open:s,onOpenChange:l,onApplySuggestion:n,onCustomizeSuggestion:a}){return e.jsx(E,{open:s,onOpenChange:l,children:e.jsxs(B,{className:"max-w-xl",children:[e.jsxs(O,{children:[e.jsxs(K,{className:"flex items-center gap-2",children:[e.jsx(j,{className:"h-5 w-5 text-purple-500"}),"AI Setup Assistant"]}),e.jsx(L,{children:"Detected patterns in your recent activity"})]}),e.jsx("div",{className:"space-y-3",children:le.map(t=>e.jsx(m,{className:"border-purple-200 dark:border-purple-800",children:e.jsxs(x,{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.type==="email"?e.jsx(C,{className:"h-4 w-4 text-blue-500"}):e.jsx(b,{className:"h-4 w-4 text-purple-500"}),e.jsx("h3",{className:"font-semibold text-sm",children:t.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.pattern})]}),e.jsxs(o,{variant:"outline",className:"text-purple-600 border-purple-600 text-xs",children:[t.confidence,"%"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{variant:"outline",size:"sm",className:"h-7 text-xs",children:"Ignore"}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>a(t),className:"h-7 text-xs",children:"Customize"}),e.jsxs(r,{size:"sm",onClick:()=>n(t),className:"gap-2 h-7 text-xs",children:[e.jsx(j,{className:"h-3 w-3"}),"Apply"]})]})]})},t.id))}),e.jsxs(Y,{children:[e.jsx(r,{variant:"outline",onClick:()=>l(!1),size:"sm",children:"Close"}),e.jsxs(r,{variant:"outline",className:"gap-2",size:"sm",children:[e.jsx(j,{className:"h-4 w-4"}),"Analyze Again"]})]})]})})}function xe(){const{emailAutomation:s,setEmailAutomation:l,calendarAutomation:n,setCalendarAutomation:a,emailMutation:t,calendarMutation:c,handleSave:M,handleSaveEmail:R,handleSaveCalendar:H,handleTest:q,isLoading:P,isSaving:w,isSavingEmail:Q,isSavingCalendar:U}=Z(),[V,f]=A.useState(!1),[W,u]=A.useState(!1),_=i=>{i.type==="email"?t.mutate({...s,...i.template,type:"email"}):c.mutate({...n,...i.template,type:"calendar"}),f(!1)},$=i=>{i.type==="email"?t.mutate({...s,...i.suggestion,type:"email"}):c.mutate({...n,...i.suggestion,type:"calendar"}),u(!1)},G=i=>{i.type==="email"?l({...s,...i.suggestion}):a({...n,...i.suggestion}),u(!1)};return P?e.jsx("div",{className:"container max-w-4xl mx-auto py-12 px-4",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(N,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):e.jsxs("div",{className:"container max-w-4xl mx-auto py-12 px-4 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Activity Automation"}),e.jsx("p",{className:"text-muted-foreground",children:"Configure trusted patterns to boost AI confidence and enable auto-approval"})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(r,{variant:"outline",onClick:()=>f(!0),className:"gap-2",children:[e.jsx(y,{className:"h-4 w-4"}),"Templates"]}),e.jsxs(r,{variant:"outline",onClick:()=>u(!0),className:"gap-2",children:[e.jsx(j,{className:"h-4 w-4"}),"AI Assistant"]})]}),e.jsxs(p,{children:[e.jsx(F,{className:"h-4 w-4"}),e.jsxs(h,{className:"text-sm",children:[e.jsx("strong",{children:"How it works:"})," Automation boosts AI confidence for trusted patterns. The AI determines activity details based on actual content. High confidence items can be auto-approved."]})]}),e.jsx(se,{automation:s,onUpdate:l,onSave:R,isSaving:Q}),e.jsx(ae,{automation:n,onUpdate:a,onSave:H,isSaving:U}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:q,className:"gap-2",children:[e.jsx(ee,{className:"h-3 w-3"}),"Test"]}),e.jsx(r,{size:"sm",onClick:M,disabled:w,children:w?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"h-3 w-3 mr-2 animate-spin"}),"Saving..."]}):"Save All"})]}),e.jsx(te,{open:V,onOpenChange:f,onUseTemplate:_}),e.jsx(ne,{open:W,onOpenChange:u,onApplySuggestion:$,onCustomizeSuggestion:G})]})}
1export{xe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.