PageSourceSearch

https://nashobahub-prod.onrender.com/assets/ComplianceAdminDashboard-CAo7ob0_.js

js nashobahub-prod.onrender.com collected 2026-10-03 11:42:09 UTC 65,741 bytes, 1 lines download raw bytes

1import{j as e,av as Fs,u as As,r as g,o as G,a as T,B as c,ax as Ms,aZ as $s,b as ge,az as Us,C as w,a1 as k,a2 as C,a4 as S,ao as We,a3 as Z,_ as Je,d as N,S as Rs,I as j,E as _,F as P,G as E,H as F,J as v,aq as je,am as Ge,T as fe,a$ as Ze,U as Xe,V as Ye,W as es,Y as ss,Z as Os,L as u,K as as,X as qs,a9 as X,a0 as ts,q as x,Q as A}from"./index-CU4TP-S4.js";import{T as Bs,a as Ls,b as Y,c as ee}from"./tabs-DGAvBb6E.js";import{S as L}from"./skeleton-CytUjfKO.js";import{r as zs,g as is,M as Ks}from"./ModuleDocumentation-BBM7zgo9.js";import{D as Qs,a as Vs,b as Is,d as D}from"./dropdown-menu-BG9ytj-i.js";import{S as ve}from"./scale-peM39fbo.js";import{F as Ne}from"./file-text-BgBpfFOt.js";import{C as Hs}from"./clock-BHlwe1eO.js";import{C as Ws}from"./circle-check-big-Tm_bNKhb.js";import{B as Js}from"./building-2-D6YIm3bs.js";import{F as Gs}from"./filter-lFr9rgfD.js";import{E as z}from"./external-link-cnWKgyDk.js";import{E as Zs}from"./ellipsis-vertical-PBpXGMLA.js";import{S as rs}from"./square-pen-DYQEIR0l.js";import{S as Xs}from"./square-check-big-dFQe1w1I.js";import{C as be}from"./copy-5gJh_YQI.js";import{A as Ys}from"./archive-DyY93ibG.js";import{i as ls}from"./isPast-qvTP0QwY.js";import{i as ye}from"./isWithinInterval-BY72R8LW.js";import{a as se}from"./addDays-mZetPhvN.js";import{C as ea}from"./clipboard-DQ5O5nwY.js";import{U as ns}from"./upload-BT12gFSl.js";import{E as ds}from"./eye-off-DT88Dd3V.js";import{P as cs}from"./paperclip-CYddCVSe.js";import{D as os}from"./download-D-QUB3Y_.js";import{I as sa}from"./image-DVqlGyvi.js";import{f as ms}from"./formatDistanceToNow-JFohnt7d.js";import{f as M}from"./format-Dvax21W1.js";import"./constructNow-Cag914m3.js";import"./differenceInCalendarMonths-D7oNCLih.js";import"./endOfMonth-ChOZM375.js";zs({moduleKey:"compliance",moduleName:"Compliance Management",description:"Regulatory deadline tracking, task management, and audit documentation",lastUpdated:"2024-12-01",sections:[{id:"overview",title:"Overview",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Compliance Management module helps track regulatory deadlines, manage recurring tasks, and maintain audit history. It ensures your organization stays compliant with all required filings, renewals, license applications, and regulatory obligations across federal, state, and local jurisdictions."}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Calendar View"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Visual calendar showing all upcoming compliance deadlines with color-coded status indicators."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Task Management"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create, assign, and track compliance tasks with automated reminders and recurrence."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Audit Trail"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete history of all task changes, completions, and attachments for regulatory review."})]})]})]})},{id:"task-categories",title:"Task Categories",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Compliance tasks are organized by category for better organization and filtering:"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Tax"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Sales tax, excise tax, federal returns"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Licensing"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Permits, renewals, applications"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Regulatory"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"TTB, ABC, FDA requirements"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Insurance"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Policy renew
1als, claims, certificates"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Environmental"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"EPA, waste disposal, permits"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Health & Safety"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"OSHA, inspections, certifications"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Payroll"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Tax deposits, W-2s, 1099s"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Privacy"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Data protection, policies"})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[e.jsx("h5",{className:"font-medium text-sm",children:"Administrative"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"General business compliance"})]})]})]})},{id:"task-management",title:"Creating & Managing Tasks",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Task Properties"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Task Name"}),": Clear, descriptive title"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Description"}),": Detailed instructions"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Category"}),": Tax, Licensing, Regulatory, etc."]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Subcategory"}),": More specific classification"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Jurisdiction"}),": Federal, State, Local"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Regulatory Body"}),": IRS, TTB, State ABC, etc."]})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Priority Levels"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("span",{className:"text-green-600 font-medium",children:"Low"}),": Routine tasks with flexibility"]}),e.jsxs("li",{children:["• ",e.jsx("span",{className:"text-amber-600 font-medium",children:"Medium"}),": Standard compliance items"]}),e.jsxs("li",{children:["• ",e.jsx("span",{className:"text-orange-600 font-medium",children:"High"}),": Important deadlines approaching"]}),e.jsxs("li",{children:["• ",e.jsx("span",{className:"text-red-600 font-medium",children:"Critical"}),": Urgent, risk of penalties"]})]})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Task Statuses"}),e.jsxs("div",{className:"grid grid-cols-5 gap-2 text-sm",children:[e.jsxs("div",{className:"text-center p-2 rounded bg-slate-100 dark:bg-slate-800",children:[e.jsx("div",{className:"font-medium",children:"Pending"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Not started"})]}),e.jsxs("div",{className:"text-center p-2 rounded bg-blue-100 dark:bg-blue-900/30",children:[e.jsx("div",{className:"font-medium text-blue-800 dark:text-blue-300",children:"In Progress"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Being worked on"})]}),e.jsxs("div",{className:"text-center p-2 rounded bg-green-100 dark:bg-green-900/30",children:[e.jsx("div",{className:"font-medium text-green-800 dark:text-green-300",children:"Completed"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Successfully done"})]}),e.jsxs("div",{className:"text-center p-2 rounded bg-red-100 dark:bg-red-900/30",children:[e.jsx("div",{className:"font-medium text-red-800 dark:text-red-300",children:"Overdue"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Past deadline"})]}),e.jsxs("div",{className:"text-center p-2 rounded bg-gray-100 dark:bg-gray-800",children:[e.jsx("div",{className:"font-medium",children:"Cancelled"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"No longer needed"})]})]})]})]})},{id:"recurrence",title:"Recurring Tasks",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up recurring schedules for tasks that repeat on regular intervals:"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Recurrence Options"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"One Time"}),": Single occurrence task"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Daily"}),": Every day"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Weekly"}),": Every week"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Monthly"}),": Once per month"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Quarterly"}),": Every 3 months"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Semi-Annual"}),": Every 6 months"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Annual"}),": Once per year"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Custom"}),": Specify days between occurrences"]})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"How Recurrence Works"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"When a recurring task is completed, the system automatically creates the next occurrence based on the schedule. The new task inherits all properties from the original with an updated due date."})]})]}),e.jsxs("div",{className:"bg-primary/5 rounded-lg p-4 border-l-4 border-primary",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Archiving Recurring Tasks"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Archiving a recurring task stops future occurrences from being created. Use this when a compliance requirement is no longer applicable."})]})]})}
1,{id:"reminders",title:"Email Reminders",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure automated email reminders to notify assigned owners before deadlines:"}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-3",children:"Reminder Configuration"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Multiple Intervals"}),": Set reminders at 30, 14, 7, and 1 days before due date"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Assigned Owner"}),": Reminders sent to the task's assigned email"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Manual Send"}),": Send reminders manually at any time"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Reminder Tracking"}),": View history of sent reminders per task"]})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Reminder Email Contains"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("li",{children:"• Task name and description"}),e.jsx("li",{children:"• Due date and days remaining"}),e.jsx("li",{children:"• Priority level"}),e.jsx("li",{children:"• Category and regulatory body"}),e.jsx("li",{children:"• Link to portal (if configured)"})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Best Practices"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("li",{children:"• Set earlier reminders for complex tasks"}),e.jsx("li",{children:"• Use 30-day reminder for annual renewals"}),e.jsx("li",{children:"• Critical tasks should have multiple reminders"}),e.jsx("li",{children:"• Verify assigned email is current"})]})]})]})]})},{id:"portal-integration",title:"Portal Integration",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Link tasks to external regulatory portals for quick access during task completion:"}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-3",children:"Portal Information"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Portal URL"}),": Direct link to the regulatory portal or filing system"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Username"}),": Account username for the portal"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Password"}),": Account password (securely stored)"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Portal Notes"}),": Instructions for navigating the portal, finding forms, etc."]})]})]}),e.jsxs("div",{className:"bg-primary/5 rounded-lg p-4 border-l-4 border-primary",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Quick Access"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Click the portal link directly from the task view to open the regulatory site. Credentials are displayed for easy copy/paste during login."})]})]})},{id:"cost-tracking",title:"Cost Tracking",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track costs associated with compliance activities for budgeting and reporting:"}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Estimated Cost"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Budget amount when creating the task. Used for forecasting and budget planning."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Actual Cost"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Real cost recorded upon completion. Includes filing fees, professional services, etc."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Penalty Amount"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track any penalties incurred for late filings or violations."})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Cost Reports"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("li",{children:"• Annual cost summaries by category"}),e.jsx("li",{children:"• Budget vs. actual variance analysis"}),e.jsx("li",{children:"• Penalty tracking and trends"}),e.jsx("li",{children:"• Export for accounting integration"})]})]})]})},{id:"audit-history",title:"Audit History",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Maintain a complete audit trail of all compliance activities for regulatory review:"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"What's Tracked"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("li",{children:"• Task creation with creator info"}),e.jsx("li",{children:"• All field modifications with old/new values"}),e.jsx("li",{children:"• Status changes with timestamps"}),e.jsx("li",{children:"• Completion details and who completed"}),e.jsx("li",{children:"• Attachment uploads"}),e.jsx("li",{children:"• Reminder sends"})]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Completion Documentation"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Completion Notes"}),": Details about how task was completed"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Confirmation Number"}),": Filing confirmation or receipt number"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Attachments"}),": Supporting documents, receipts, confirmations"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Completed By"}),": User who marked task complete"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Completion Date"}),": When task was marked complete"]})]})]})]}),e.jsxs("div",{className:"bg-primary/5 rounded-lg p-4 border-l-4 border-primary",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Audit-Ready Documentation"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Export complete audit history for any task or time period. Documentation includes all changes, attachments, and completion records needed for regulatory audits."})]})]})},{id:"calendar",title:"Calendar View",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"The calendar provides a visual overview of all compliance deadlines:"}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[e.jsx("h4",{className:"font-medium mb-3",children:"Calendar Features"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Monthly View"}),": See all tasks for the current month at a glance"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Color Co
1ding"}),": Tasks colored by status (pending=gray, in progress=blue, overdue=red, completed=green)"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Quick Actions"}),": Click any task to view details or update status"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Priority Indicators"}),": Visual markers for high-priority items"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Filter by Category"}),": Show only specific task categories"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Today Indicator"}),": Current date highlighted for reference"]})]})]}),e.jsxs("div",{className:"bg-primary/5 rounded-lg p-4 border-l-4 border-primary",children:[e.jsx("h4",{className:"font-medium mb-2",children:"Due Date Indicators"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tasks show days until due with color-coded urgency: green for plenty of time, amber for approaching, red for urgent or overdue."})]})]})},{id:"admin-tabs",title:"Admin Dashboard Tabs",content:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"The Compliance Admin Dashboard provides three main views:"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h5",{className:"font-medium",children:"Overview Tab"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Dashboard with key metrics: tasks due soon, overdue count, completed this month, upcoming by category, and recent activity feed."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h5",{className:"font-medium",children:"All Tasks Tab"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete list of all compliance tasks with filtering by category, status, priority, and search. Create, edit, view details, and manage tasks from this view."})]}),e.jsxs("div",{className:"border-l-4 border-primary pl-4",children:[e.jsx("h5",{className:"font-medium",children:"Calendar Tab"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Visual calendar showing tasks by due date. Click dates to see tasks due, navigate months, and get a timeline view of compliance deadlines."})]})]})]})}]});const K=[{value:"tax",label:"Tax"},{value:"licensing",label:"Licensing"},{value:"regulatory",label:"Regulatory"},{value:"insurance",label:"Insurance"},{value:"environmental",label:"Environmental"},{value:"health_safety",label:"Health & Safety"},{value:"payroll",label:"Payroll"},{value:"privacy",label:"Privacy"},{value:"security",label:"Security"},{value:"administrative",label:"Administrative"},{value:"other",label:"Other"}],q=[{value:"low",label:"Low",color:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},{value:"medium",label:"Medium",color:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400"},{value:"high",label:"High",color:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400"},{value:"critical",label:"Critical",color:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"}],B=[{value:"pending",label:"Pending",color:"bg-slate-100 text-slate-800 dark:bg-slate-900/30 dark:text-slate-400"},{value:"in_progress",label:"In Progress",color:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},{value:"completed",label:"Completed",color:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},{value:"overdue",label:"Overdue",color:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},{value:"cancelled",label:"Cancelled",color:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-400"}],us=[{value:"one_time",label:"One Time"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"quarterly",label:"Quarterly"},{value:"semi_annual",label:"Semi-Annual"},{value:"annual",label:"Annual"},{value:"custom",label:"Custom"}],ae={taskName:"",description:"",steps:[],category:"tax",subcategory:"",jurisdiction:"",regulatoryBody:"",recurrence:"one_time",customRecurrenceDays:null,dueDate:"",reminderDays:[7,3,1],assignedToName:"",assignedToEmail:"",status:"pending",priority:"medium",portalUrl:"",portalUsername:"",portalPassword:"",portalNotes:"",estimatedCost:"",actualCost:"",penaltyAmount:"",completionNotes:"",confirmationNumber:"",tags:[]};function Aa(){var ze,Ke,Qe,Ve,Ie,He;const[,xs]=Fs(),{toast:r}=As(),[hs,ps]=g.useState("overview"),[we,$]=g.useState(!1),[ke,Q]=g.useState(!1),[t,U]=g.useState(null),[l,n]=g.useState(ae),[te,gs]=g.useState("all"),[ie,js]=g.useState("all"),[re,fs]=g.useState("all"),[le,vs]=g.useState(""),[ne,de]=g.useState(!1),[ce,Ce]=g.useState(!1),[V,Se]=g.useState(null),[De,Te]=g.useState(null),[oe,_e]=g.useState(!1),[Pe,Ee]=g.useState(null),{data:f,isLoading:I}=G({queryKey:["/api/compliance/stats"]}),{data:R=[],isLoading:Ns,refetch:bs}=G({queryKey:["/api/compliance/tasks"]}),{data:Fe=[]}=G({queryKey:["/api/compliance/upcoming"]}),me=T({mutationFn:async s=>A("POST","/api/compliance/tasks",s),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),x.invalidateQueries({queryKey:["/api/compliance/upcoming"]}),$(!1),n(ae),r({title:"Success",description:"Task created successfully"})},onError:()=>{r({title:"Error",description:"Failed to create task",variant:"destructive"})}}),ue=T({mutationFn:async({id:s,data:a})=>A("PATCH",`/api/compliance/tasks/${s}`,a),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),x.invalidateQueries({queryKey:["/api/compliance/upcoming"]}),$(!1),U(null),n(ae),r({title:"Success",description:"Task updated successfully"})},onError:()=>{r({title:"Error",description:"Failed to update task",variant:"destructive"})}}),ys=T({mutationFn:async s=>A("DELETE",`/api/compliance/tasks/${s}`),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),x.invalidateQueries({queryKey:["/api/compliance/upcoming"]}
1),r({title:"Success",description:"Task deleted successfully"})},onError:()=>{r({title:"Error",description:"Failed to delete task",variant:"destructive"})}}),H=T({mutationFn:async s=>A("POST",`/api/compliance/tasks/${s}/send-reminder`),onSuccess:()=>{r({title:"Success",description:"Reminder email sent successfully"})},onError:s=>{r({title:"Error",description:(s==null?void 0:s.message)||"Failed to send reminder",variant:"destructive"})}}),Ae=T({mutationFn:async s=>A("POST",`/api/compliance/tasks/${s}/archive`),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),x.invalidateQueries({queryKey:["/api/compliance/upcoming"]}),r({title:"Success",description:"Task archived - it will no longer recur"})},onError:()=>{r({title:"Error",description:"Failed to archive task",variant:"destructive"})}}),Me=T({mutationFn:async s=>A("POST",`/api/compliance/tasks/${s}/complete`),onSuccess:s=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),x.invalidateQueries({queryKey:["/api/compliance/upcoming"]}),s.nextCycle?r({title:"Task Completed",description:`Moved to next cycle. New due date: ${new Date(s.nextDueDate).toLocaleDateString("en-US")}`}):r({title:"Task Completed",description:"One-time task marked as complete"})},onError:()=>{r({title:"Error",description:"Failed to complete task",variant:"destructive"})}}),$e=T({mutationFn:async s=>A("POST",`/api/compliance/tasks/${s}/duplicate`),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),x.invalidateQueries({queryKey:["/api/compliance/stats"]}),r({title:"Success",description:"Task duplicated successfully"})},onError:()=>{r({title:"Error",description:"Failed to duplicate task",variant:"destructive"})}}),{data:W=[],refetch:Ue}=G({queryKey:["/api/compliance/tasks",t==null?void 0:t.id,"attachments"],queryFn:async()=>{if(!(t!=null&&t.id))return[];const s=await fetch(`/api/compliance/tasks/${t.id}/attachments`);return s.ok?s.json():[]},enabled:!!(t!=null&&t.id)&&(we||ke)}),ws=async s=>{if(!t)return;_e(!0);const a=new FormData;a.append("file",s);try{const i=await fetch(`/api/compliance/tasks/${t.id}/attachments`,{method:"POST",body:a});if(!i.ok){const d=await i.json();throw new Error(d.message||"Upload failed")}await Ue(),r({title:"Success",description:"Document uploaded successfully"})}catch(i){r({title:"Error",description:i instanceof Error?i.message:"Failed to upload",variant:"destructive"})}finally{_e(!1)}},ks=async s=>{if(t){Ee(s);try{if(!(await fetch(`/api/compliance/tasks/${t.id}/attachments/${s}`,{method:"DELETE"})).ok)throw new Error("Delete failed");await Ue(),r({title:"Success",description:"Document deleted"})}catch{r({title:"Error",description:"Failed to delete document",variant:"destructive"})}finally{Ee(null)}}},Re=s=>s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`:"",Oe=()=>{U(null),n(ae),de(!1),$(!0)},qe=s=>{U(s),de(!1),n({taskName:s.task_name,description:s.description||"",steps:s.steps||[],category:s.category,subcategory:s.subcategory||"",jurisdiction:s.jurisdiction||"",regulatoryBody:s.regulatory_body||"",recurrence:s.recurrence,customRecurrenceDays:s.custom_recurrence_days,dueDate:s.due_date?s.due_date.split("T")[0]:"",reminderDays:s.reminder_days||[7,3,1],assignedToName:s.assigned_to_name||"",assignedToEmail:s.assigned_to_email||"",status:s.status,priority:s.priority,portalUrl:s.portal_url||"",portalUsername:s.portal_username||"",portalPassword:s.portal_password||"",portalNotes:s.portal_notes||"",estimatedCost:s.estimated_cost||"",actualCost:s.actual_cost||"",penaltyAmount:s.penalty_amount||"",completionNotes:s.completion_notes||"",confirmationNumber:s.confirmation_number||"",tags:s.tags||[]}),$(!0)},Cs=()=>{const s={id:crypto.randomUUID(),order:l.steps.length+1,instruction:"",attachments:[]};n(a=>({...a,steps:[...a.steps,s]}))},Ss=s=>{const a=l.steps.filter((i,d)=>d!==s).map((i,d)=>({...i,order:d+1}));n(i=>({...i,steps:a}))},Ds=(s,a)=>{const i=[...l.steps];i[s]={...i[s],instruction:a},n(d=>({...d,steps:i}))},Be=async(s,a,i)=>{var o,m;if(!t){r({title:"Error",description:"Please save the task first before adding screenshots",variant:"destructive"});return}if(!((o=t.steps)==null?void 0:o.find(h=>h.id===s))){r({title:"Save Required",description:"Please save the task to persist this step before adding screenshots",variant:"destructive"});return}Se(s);try{const h=new FormData;h.append("file",i);const b=await fetch(`/api/compliance/tasks/${t.id}/steps/${s}/attachments`,{method:"POST",body:h,credentials:"include"});if(!b.ok){const y=await b.json().catch(()=>({}));throw new Error(y.message||"Upload failed")}const p=await b.json(),O=[...l.steps];O[a].attachments||(O[a].attachments=[]),O[a].attachments.push(p.attachment),n(y=>({...y,steps:O}));const Es=((m=t.steps)==null?void 0:m.map(y=>y.id===s?{...y,attachments:[...y.attachments||[],p.attachment]}:y))||[];U({...t,steps:Es}),x.invalidateQueries({queryKey:["/api/compliance/tasks"]}
1),r({title:"Success",description:"Screenshot uploaded successfully"})}catch(h){r({title:"Error",description:h instanceof Error?h.message:"Failed to upload screenshot",variant:"destructive"})}finally{Se(null)}},Ts=async(s,a)=>{var d;if(!t){r({title:"Error",description:"Please save the task first before adding screenshots",variant:"destructive"});return}if(!((d=t.steps)==null?void 0:d.find(o=>o.id===s))){r({title:"Save Required",description:"Please save the task to persist this step before adding screenshots",variant:"destructive"});return}try{const o=await navigator.clipboard.read();let m=null;for(const b of o){for(const p of b.types)if(p.startsWith("image/")){m=await b.getType(p);break}if(m)break}if(!m){r({title:"No Image Found",description:"No image found in clipboard. Copy a screenshot first (use Print Screen or Snipping Tool).",variant:"destructive"});return}const h=new File([m],`screenshot-${Date.now()}.png`,{type:m.type});await Be(s,a,h)}catch(o){o.name==="NotAllowedError"?r({title:"Permission Denied",description:"Please allow clipboard access to paste screenshots.",variant:"destructive"}):r({title:"Error",description:"Failed to paste from clipboard. Try using the upload button instead.",variant:"destructive"})}},_s=async(s,a,i)=>{var d,o;if(t){Te(i);try{const m=await fetch(`/api/compliance/tasks/${t.id}/steps/${s}/attachments/${i}`,{method:"DELETE",credentials:"include"});if(!m.ok){const p=await m.json().catch(()=>({}));throw new Error(p.message||"Delete failed")}const h=[...l.steps];h[a].attachments=((d=h[a].attachments)==null?void 0:d.filter(p=>p.id!==i))||[],n(p=>({...p,steps:h}));const b=((o=t.steps)==null?void 0:o.map(p=>p.id===s?{...p,attachments:(p.attachments||[]).filter(O=>O.id!==i)}:p))||[];U({...t,steps:b}),x.invalidateQueries({queryKey:["/api/compliance/tasks"]}),r({title:"Success",description:"Screenshot deleted successfully"})}catch(m){r({title:"Error",description:m instanceof Error?m.message:"Failed to delete screenshot",variant:"destructive"})}finally{Te(null)}}},xe=s=>{U(s),Ce(!1),Q(!0)},Ps=()=>{t?ue.mutate({id:t.id,data:l}):me.mutate(l)},Le=R.filter(s=>!(te!=="all"&&s.category!==te||ie!=="all"&&s.status!==ie||re!=="all"&&s.priority!==re||le&&!s.task_name.toLowerCase().includes(le.toLowerCase()))),he=s=>{const a=B.find(i=>i.value===s);return a?a.color:"bg-gray-100 text-gray-800"},pe=s=>{const a=q.find(i=>i.value===s);return a?a.color:"bg-gray-100 text-gray-800"},J=s=>{if(!s)return null;const a=new Date(s),i=new Date;return ls(a)?{label:"Overdue",color:"text-red-600 dark:text-red-400"}:ye(a,{start:i,end:se(i,7)})?{label:ms(a,{addSuffix:!0}),color:"text-amber-600 dark:text-amber-400"}:{label:ms(a,{addSuffix:!0}),color:"text-muted-foreground"}};return e.jsxs("div",{className:"min-h-screen bg-background","data-testid":"compliance-admin-dashboard",children:[e.jsx("header",{className:"sticky top-0 z-50 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"container flex h-16 items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>xs("/"),"data-testid":"button-return-hub",children:[e.jsx(Ms,{className:"h-4 w-4 mr-2"}),"Return to Hub"]}),e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600 text-white",children:e.jsx(ve,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Compliance Management"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Track deadlines, filings, and regulatory requirements"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>bs(),"data-testid":"button-refresh",children:[e.jsx($s,{className:"h-4 w-4 mr-2"}),"Refresh"]}),e.jsxs(c,{size:"sm",onClick:Oe,"data-testid":"button-create-task",children:[e.jsx(ge,{className:"h-4 w-4 mr-2"}),"Add Task"]})]})]})}),e.jsx("main",{className:"container py-6",children:e.jsxs(Bs,{value:hs,onValueChange:ps,children:[e.jsxs(Ls,{className:"mb-6","data-testid":"compliance-tabs",children:[e.jsx(Y,{value:"overview","data-testid":"tab-overview",children:"Overview"}),e.jsx(Y,{value:"tasks","data-testid":"tab-tasks",children:"All Tasks"}),e.jsx(Y,{value:"calendar","data-testid":"tab-calendar",children:"Calendar"}),e.jsxs(Y,{value:"documentation","data-testid":"tab-documentation",children:[e.jsx(Us,{className:"h-4 w-4 mr-2"}),"Docs"]})]}),e.jsxs(ee,{value:"overview",className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(w,{"data-testid":"card-total-tasks",children:[e.jsxs(k,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[e.jsx(C,{className:"text-sm font-medium",children:"Total Tasks"}),e.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(S,{children:I?e.jsx(L,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:(f==null?void 0:f.total_tasks)||0})})]}),e.jsxs(w,{"data-testid":"card-overdue",children:[e.jsxs(k,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[e.jsx(C,{className:"text-sm font-medium",children:"Overdue"}),e.jsx(We,{className:"h-4 w-4 text-red-500"})]}),e.jsx(S,{children:I?e.jsx(L,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold text-red-600",children:(f==null?void 0:f.past_due)||0})})]}),e.jsxs(w,{"data-testid":"card-due-this-week",children:[e.jsxs(k,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[e.jsx(C,{className:"text-sm font-medium",children:"Due This Week"}),e.jsx(Hs,{className:"h-4 w-4 text-amber-500"})]}),e.jsx(S,{children:I?e.jsx(L,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold text-amber-600",children:(f==null?void 0:f.due_this_week)||0})})]}),e.jsxs(w,{"data-testid":"card-completed",children:[e.jsxs(k,{className:"flex flex-row items-center justify-between gap-2 space-y-0 pb-2",children:[e.jsx(C,{className:"text-sm font-medium",children:"Completed"}),e.jsx(Ws,{className:"h-4 w-4 text-green-500"})]}),e.jsx(S,{children:I?e.jsx(L,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold text-green-600",children:(f==null?void 0:f.completed)||0})})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs(w,{children:[e.jsxs(k,{children:[e.jsxs(C,{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-5 w-5 text-amber-500"}),"Upcoming Deadlines"]}),e.jsx(Z,{children:"Tasks due within the next 30 days"})]}),e.jsx(S,{children:e.jsx(Je,{className:"h-[300px]",children:Fe.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No upcoming deadlines"}):e.jsx("div",{className:"space-y-3",children:Fe.map(s=>{var i,d;const a=J(s.due_date);return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover-elevate cursor-pointer",onClick:()=>xe(s),"data-testid":`upcoming-task-${s.id}`,children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:s.task_name}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(N,{variant:"outline",className:he(s.status),children:(i=B.find(o=>o.value===s.status))==null?void 0:i.label}),e.jsx(N,{variant:"outline",className:pe(s.priority),children:(d=q.find(o=>o.value===s.priority))==null?void 0:d.label})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:`text-sm font-medium ${a==null?void 0:a.color}`,children:s.due_date&&M(new Date(s.due_date),"MMM d, yyyy")}),e.jsx("p",{className:`text-xs ${a==null?void 0:a.color}`,children:a==null?void 0:a.label})]})]},s.id)})})})})]}),e.jsxs(w,{children:[e.jsxs(k,{children:[e.jsxs(C,{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-5 w-5 text-indigo-500"}),"Tasks by Category"]}),e.jsx(Z,{children:"Distribution of compliance tasks"})]}),e.jsx(S,{children:e.jsx("div",{className:"space-y-3",children:K.map(s=>{const a=R.filter(d=>d.category===s.value).length,i=R.length>0?a/R.length*100:0;return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-sm",children:s.label})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-24 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-indigo-500 rounded-full",style:{width:`${i}%`}})}),e.jsx("span",{className:"text-sm font-medium w-8 text-right",children:a})]})]},s.value)})})})]})]})]}),e.jsx(ee,{value:"tasks",className:"space-y-4",children:e.jsxs(w,{children:[e.jsx(k,{children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(C,{children:"All Compliance Tasks"}),e.jsx(Z,{children:"Manage all your compliance deadlines and requirements"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Rs,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(j,{placeholder:"Search tasks...",value:le,onChange:s=>vs(s.target.value),className:"pl-8 w-48","data-testid":"input-search-tasks"})]}),e.jsxs(_,{value:te,onValueChange:gs,children:[e.jsxs(P,{className:"w-40","data-testid":"filter-category",children:[e.jsx(Gs,{className:"h-4 w-4 mr-2"}),e.jsx(E,{placeholder:"Category"})]}),e.jsxs(F,{children:[e.jsx(v,{value:"all",children:"All Categories"}),K.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))]})]}),e.jsxs(_,{value:ie,onValueChange:js,children:[e.jsx(P,{className:"w-36","data-testid":"filter-status",children:e.jsx(E,{placeholder:"Status"})}),e.jsxs(F,{children:[e.jsx(v,{value:"all",children:"All Statuses"}),B.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))]})]}),e.jsxs(_,{value:re,onValueChange:fs,children:[e.jsx(P,{className:"w-32","data-testid":"filter-priority",children:e.jsx(E,{placeholder:"Priority"})}),e.jsxs(F,{children:[e.jsx(v,{value:"all",children:"All"}),q.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))]})]})]})]})}),e.jsx(S,{children:Ns?e.jsx("div",{className:"space-y-2",children:[1,2,3,4,5].map(s=>e.jsx(L,{className:"h-16 w-full"},s))}):Le.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ve,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-lg font-medium",children:"No tasks foun
1d"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:R.length===0?"Create your first compliance task to get started":"No tasks match your current filters"}),e.jsxs(c,{onClick:Oe,"data-testid":"button-create-first-task",children:[e.jsx(ge,{className:"h-4 w-4 mr-2"}),"Add Task"]})]}):e.jsx(Je,{className:"h-[500px]",children:e.jsx("div",{className:"space-y-2",children:Le.map(s=>{var i,d,o;const a=J(s.due_date);return e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover-elevate","data-testid":`task-row-${s.id}`,children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium truncate",children:s.task_name}),s.portal_url&&e.jsx(z,{className:"h-3 w-3 text-muted-foreground shrink-0"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(N,{variant:"outline",className:he(s.status),children:(i=B.find(m=>m.value===s.status))==null?void 0:i.label}),e.jsx(N,{variant:"outline",className:pe(s.priority),children:(d=q.find(m=>m.value===s.priority))==null?void 0:d.label}),e.jsx(N,{variant:"outline",children:(o=K.find(m=>m.value===s.category))==null?void 0:o.label}),s.assigned_to_name&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Assigned to: ",s.assigned_to_name]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.due_date&&e.jsxs("div",{className:"text-right hidden md:block",children:[e.jsx("p",{className:`text-sm font-medium ${a==null?void 0:a.color}`,children:M(new Date(s.due_date),"MMM d, yyyy")}),e.jsx("p",{className:`text-xs ${a==null?void 0:a.color}`,children:a==null?void 0:a.label})]}),e.jsxs(Qs,{children:[e.jsx(Vs,{asChild:!0,children:e.jsx(c,{variant:"ghost",size:"icon","data-testid":`task-menu-${s.id}`,children:e.jsx(Zs,{className:"h-4 w-4"})})}),e.jsxs(Is,{align:"end",children:[e.jsxs(D,{onClick:()=>xe(s),children:[e.jsx(je,{className:"h-4 w-4 mr-2"}),"View Details"]}),e.jsxs(D,{onClick:()=>qe(s),children:[e.jsx(rs,{className:"h-4 w-4 mr-2"}),"Edit"]}),e.jsxs(D,{onClick:()=>{if(!s.assigned_to_email){r({title:"No Email",description:"Set an assigned email first to send reminders",variant:"destructive"});return}H.mutate(s.id)},disabled:H.isPending,children:[e.jsx(Ge,{className:"h-4 w-4 mr-2"}),"Send Reminder Now"]}),s.portal_url&&e.jsxs(D,{onClick:()=>window.open(s.portal_url,"_blank"),children:[e.jsx(z,{className:"h-4 w-4 mr-2"}),"Open Portal"]}),s.status!=="completed"&&e.jsxs(D,{onClick:()=>Me.mutate(s.id),disabled:Me.isPending,"data-testid":`button-complete-${s.id}`,children:[e.jsx(Xs,{className:"h-4 w-4 mr-2"}),s.recurrence==="one_time"?"Complete":"Complete & Next Cycle"]}),e.jsxs(D,{onClick:()=>$e.mutate(s.id),disabled:$e.isPending,"data-testid":`button-duplicate-${s.id}`,children:[e.jsx(be,{className:"h-4 w-4 mr-2"}),"Duplicate"]}),e.jsxs(D,{onClick:()=>Ae.mutate(s.id),disabled:Ae.isPending,className:"text-amber-600","data-testid":`button-archive-${s.id}`,children:[e.jsx(Ys,{className:"h-4 w-4 mr-2"}),"Archive"]}),e.jsxs(D,{onClick:()=>ys.mutate(s.id),className:"text-red-600","data-testid":`button-delete-${s.id}`,children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})]},s.id)})})})})]})}),e.jsx(ee,{value:"calendar",className:"space-y-4",children:e.jsxs(w,{children:[e.jsxs(k,{children:[e.jsxs(C,{className:"flex items-center gap-2",children:[e.jsx(Ze,{className:"h-5 w-5"}),"Compliance Calendar"]}),e.jsx(Z,{children:"Visual overview of upcoming deadlines"})]}),e.jsx(S,{children:e.jsx("div",{className:"grid gap-4",children:[{label:"Overdue",filter:s=>s.due_date&&ls(new Date(s.due_date))&&s.status!=="completed",color:"border-red-500 bg-red-50 dark:bg-red-950/20"},{label:"Due This Week",filter:s=>s.due_date&&ye(new Date(s.due_date),{start:new Date,end:se(new Date,7)})&&s.status!=="completed",color:"border-amber-500 bg-amber-50 dark:bg-amber-950/20"},{label:"Due This Month",filter:s=>s.due_date&&ye(new Date(s.due_date),{start:se(new Date,7),end:se(new Date,30)})&&s.status!=="completed",color:"border-blue-500 bg-blue-50 dark:bg-blue-950/20"}].map(s=>{const a=R.filter(s.filter);return e.jsxs("div",{className:`p-4 rounded-lg border-l-4 ${s.color}`,children:[e.jsxs("h3",{className:"font-semibold mb-3",children:[s.label," (",a.length,")"]}),a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No tasks"}):e.jsxs("div",{className:"space-y-2",children:[a.slice(0,5).map(i=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-background hover-elevate cursor-pointer",onClick:()=>xe(i),children:[e.jsx("span",{className:"font-medium text-sm",children:i.task_name}),e.jsx("span",{className:"text-xs text-muted-foreground",children:i.due_date&&M(new Date(i.due_date),"MMM d")})]},i.id)),a.length>5&&e.jsxs("p",{className:"text-xs text-muted-foreground text-center pt-2",children:["+",a.length-5," more tasks"]})]})]},s.label)})})})]})}),e.jsx(ee,{value:"documentation",children:is("compliance")&&e.jsx(Ks,{documentation:is("compliance")})})]})}),e.jsx(Xe,{open:we,onOpenChange:$,children:e.jsxs(Ye,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(es,{children:[e.jsx(ss,{children:t?"Edit Task":"Create New Task"}
1),e.jsx(Os,{children:t?"Update the compliance task details":"Add a new compliance task to track"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"taskName",children:"Task Name *"}),e.jsx(j,{id:"taskName",value:l.taskName,onChange:s=>n(a=>({...a,taskName:s.target.value})),placeholder:"e.g., Quarterly Sales Tax Filing","data-testid":"input-task-name"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"description",children:"Description"}),e.jsx(as,{id:"description",value:l.description,onChange:s=>n(a=>({...a,description:s.target.value})),placeholder:"Detailed description of the compliance task...",rows:3,"data-testid":"input-description"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Step-by-Step Directions"}),e.jsxs(c,{type:"button",variant:"outline",size:"sm",onClick:Cs,"data-testid":"button-add-step",children:[e.jsx(ge,{className:"w-4 h-4 mr-1"}),"Add Step"]})]}),l.steps.length>0?e.jsx("div",{className:"space-y-4 mt-2",children:l.steps.map((s,a)=>e.jsxs("div",{className:"border rounded-lg p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"flex items-center justify-center w-6 h-9 text-sm font-medium text-muted-foreground",children:[s.order,"."]}),e.jsx(j,{value:s.instruction,onChange:i=>Ds(a,i.target.value),placeholder:`Step ${s.order} instruction...`,className:"flex-1","data-testid":`input-step-${a}`}),e.jsx(c,{type:"button",variant:"ghost",size:"icon",onClick:()=>Ss(a),className:"text-destructive hover:text-destructive","data-testid":`button-remove-step-${a}`,children:e.jsx(qs,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"ml-8 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Screenshots"}),(()=>{var d;const i=(d=t==null?void 0:t.steps)==null?void 0:d.some(o=>o.id===s.id);return t?i?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(c,{type:"button",variant:"outline",size:"sm",className:"h-7",disabled:V===s.id,onClick:()=>s.id&&Ts(s.id,a),"data-testid":`button-paste-step-${a}`,children:V===s.id?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"w-3 h-3 mr-1 animate-spin"}),"Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ea,{className:"w-3 h-3 mr-1"}),"Paste Screenshot"]})}),e.jsxs("label",{className:"cursor-pointer",children:[e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:o=>{var h;const m=(h=o.target.files)==null?void 0:h[0];m&&s.id&&Be(s.id,a,m),o.target.value=""},disabled:V===s.id,"data-testid":`input-upload-step-${a}`}),e.jsx(c,{type:"button",variant:"ghost",size:"sm",className:"h-7",disabled:V===s.id,asChild:!0,children:e.jsxs("span",{children:[e.jsx(ns,{className:"w-3 h-3 mr-1"}),"Upload"]})})]})]}):e.jsx("span",{className:"text-xs text-amber-600",children:"Save changes to enable screenshots for this step"}):e.jsx("span",{className:"text-xs text-amber-600",children:"Save task first to add screenshots"})})()]}),s.attachments&&s.attachments.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:s.attachments.map(i=>e.jsxs("div",{className:"relative group border rounded-md overflow-hidden",children:[e.jsx("img",{src:`/api/compliance/tasks/${t==null?void 0:t.id}/steps/${s.id}/attachments/${i.id}`,alt:i.fileName,className:"w-20 h-20 object-cover","data-testid":`img-step-attachment-${i.id}`}),e.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:e.jsx(c,{type:"button",variant:"destructive",size:"icon",className:"h-6 w-6",onClick:()=>s.id&&_s(s.id,a,i.id),disabled:De===i.id,"data-testid":`button-delete-attachment-${i.id}`,children:De===i.id?e.jsx(X,{className:"w-3 h-3 animate-spin"}):e.jsx(fe,{className:"w-3 h-3"})})}),e.jsx("span",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs px-1 py-0.5 truncate",children:i.fileName})]},i.id))})]})]},s.id||a))}):e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'No steps added. Click "Add Step" to add step-by-step directions.'})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{children:"Category *"}),e.jsxs(_,{value:l.category,onValueChange:s=>n(a=>({...a,category:s})),children:[e.jsx(P,{"data-testid":"select-category",children:e.jsx(E,{})}),e.jsx(F,{children:K.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{children:"Priority *"}),e.jsxs(_,{value:l.priority,onValueChange:s=>n(a=>({...a,priority:s})),children:[e.jsx(P,{"data-testid":"select-priority",children:e.jsx(E,{})}),e.jsx(F,{children:q.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{children:"Status"}),e.jsxs(_,{value:l.status,onValueChange:s=>n(a=>({...a,status:s})),children:[e.jsx(P,{"data-testid":"select-status",children:e.jsx(E,{})}),e.jsx(F,{children:B.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{children:"Recurrence"}),e.jsxs(_,{value:l.recurrence,onValueChange:s=>n(a=>({...a,recurrence:s})),children:[e.jsx(P,{"data-testid":"select-recurrence",children:e.jsx(E,{})}),e.jsx(F,{children:us.map(s=>e.jsx(v,{value:s.value,children:s.label},s.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"dueDate",children:"Due Date"}),e.jsx(j,{id:"dueDate",type:"date",value:l.dueDate,onChange:s=>n(a=>({...a,dueDate:s.target.value})),"data-testid":"input-due-date"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"reminderDays",children:"Email Reminder Days (before due date)"}),e.jsx(j,{id:"reminderDays",defaultValue:l.reminderDays.join(", "),onBlur:s=>{const a=s.target.value.split(",").map(i=>parseInt(i.trim())).filter(i=>!isNaN(i)&&i>0);n(i=>({...i,reminderDays:a}))},placeholder:"e.g., 7, 3, 1","data-testid":"input-reminder-days"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated days before due date to send email reminders"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"jurisdiction",children:"Jurisdiction"}),e.jsx(j,{id:"jurisdiction",value:l.jurisdiction,onChange:s=>n(a=>({...a,jurisdiction:s.target.value})),placeholder:"e.g., Massachusetts, Federal","data-testid":"input-jurisdiction"})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"assignedToName",children:"Assigned To (Name)"}),e.jsx(j,{id:"assignedToName",value:l.assignedToName,onChange:s=>n(a=>({...a,assignedToName:s.target.value})),placeholder:"e.g., Mike Support","data-testid":"input-assigned-name"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"assignedToEmail",children:"Assigned To (Email)"}),e.jsx(j,{id:"assignedToEmail",type:"email",value:l.assignedToEmail,onChange:s=>n(a=>({...a,assignedToEmail:s.target.value})),placeholder:"e.g., [email protected]","data-testid":"input-assigned-email"})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"regulatoryBody",children:"Regulatory Body"}),e.jsx(j,{id:"regulatoryBody",value:l.regulatoryBody,onChange:s=>n(a=>({...a,regulatoryBody:s.target.value})),placeholder:"e.g., ABCC, IRS, DOR","data-testid":"input-regulatory-body"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"portalUrl",children:"Portal URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{id:"portalUrl",type:"url",value:l.portalUrl,onChange:s=>n(a=>({...a,portalUrl:s.target.value})),placeholder:"https://...",className:"flex-1","data-testid":"input-portal-url"}),l.portalUrl&&e.jsxs(c,{type:"button",variant:"outline",onClick:()=>window.open(l.portalUrl,"_blank"),"data-testid":"button-launch-portal",children:[e.jsx(z,{className:"w-4 h-4 mr-1"}),"Launch"]}
1)]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"portalUsername",children:"Portal Username"}),e.jsx(j,{id:"portalUsername",value:l.portalUsername,onChange:s=>n(a=>({...a,portalUsername:s.target.value})),placeholder:"Username for portal login","data-testid":"input-portal-username"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"portalPassword",children:"Portal Password"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{id:"portalPassword",type:ne?"text":"password",value:l.portalPassword,onChange:s=>n(a=>({...a,portalPassword:s.target.value})),placeholder:"Password for portal login",className:"flex-1","data-testid":"input-portal-password"}),e.jsx(c,{type:"button",variant:"ghost",size:"icon",onClick:()=>de(!ne),"data-testid":"button-toggle-password",children:ne?e.jsx(ds,{className:"w-4 h-4"}):e.jsx(je,{className:"w-4 h-4"})})]})]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"completionNotes",children:"Completion Notes"}),e.jsx(as,{id:"completionNotes",value:l.completionNotes,onChange:s=>n(a=>({...a,completionNotes:s.target.value})),placeholder:"Notes about task completion...",rows:2,"data-testid":"input-completion-notes"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(u,{htmlFor:"confirmationNumber",children:"Confirmation Number"}),e.jsx(j,{id:"confirmationNumber",value:l.confirmationNumber,onChange:s=>n(a=>({...a,confirmationNumber:s.target.value})),placeholder:"e.g., 123456789","data-testid":"input-confirmation-number"})]})]}),t&&e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(u,{className:"flex items-center gap-1",children:[e.jsx(cs,{className:"w-4 h-4"}),"Documents"]}),e.jsxs("label",{htmlFor:"doc-upload-input",children:[e.jsx(c,{type:"button",variant:"outline",size:"sm",disabled:oe,asChild:!0,children:e.jsxs("span",{children:[oe?e.jsx(X,{className:"w-3 h-3 mr-1 animate-spin"}):e.jsx(ns,{className:"w-3 h-3 mr-1"}),oe?"Uploading...":"Upload File"]})}),e.jsx("input",{id:"doc-upload-input",type:"file",className:"hidden",onChange:s=>{var i;const a=(i=s.target.files)==null?void 0:i[0];a&&ws(a),s.target.value=""},"data-testid":"input-upload-doc"})]})]}),W.length>0?e.jsx("div",{className:"space-y-2",children:W.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-2 border rounded-lg gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:s.file_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.uploaded_by_name||"Unknown",s.file_size?` · ${Re(s.file_size)}`:""]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("a",{href:`/api/compliance/tasks/${t.id}/attachments/${s.id}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(c,{type:"button",variant:"ghost",size:"icon","data-testid":`button-download-doc-${s.id}`,children:e.jsx(os,{className:"w-4 h-4"})})}),e.jsx(c,{type:"button",variant:"ghost",size:"icon",disabled:Pe===s.id,onClick:()=>ks(s.id),"data-testid":`button-delete-doc-${s.id}`,children:Pe===s.id?e.jsx(X,{className:"w-4 h-4 animate-spin"}):e.jsx(fe,{className:"w-4 h-4 text-muted-foreground"})})]})]},s.id))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No documents attached. Upload permits, filings, receipts, or any relevant files."})]})]}),e.jsxs(ts,{children:[e.jsx(c,{variant:"outline",onClick:()=>$(!1),children:"Cancel"}),e.jsx(c,{onClick:Ps,disabled:!l.taskName||me.isPending||ue.isPending,"data-testid":"button-save-task",children:me.isPending||ue.isPending?"Saving...":t?"Update Task":"Create Task"})]})]})}),e.jsx(Xe,{open:ke,onOpenChange:Q,children:e.jsxs(Ye,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(es,{children:e.jsxs(ss,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-5 w-5 text-indigo-500"}),t==null?void 0:t.task_name]})}),t&&e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(N,{className:he(t.status),children:(ze=B.find(s=>s.value===t.status))==null?void 0:ze.label}
1),e.jsx(N,{className:pe(t.priority),children:(Ke=q.find(s=>s.value===t.priority))==null?void 0:Ke.label}),e.jsx(N,{variant:"outline",children:(Qe=K.find(s=>s.value===t.category))==null?void 0:Qe.label}),e.jsx(N,{variant:"outline",children:(Ve=us.find(s=>s.value===t.recurrence))==null?void 0:Ve.label})]}),t.description&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Description"}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),t.steps&&t.steps.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Step-by-Step Directions"}),e.jsx("div",{className:"space-y-4",children:t.steps.sort((s,a)=>s.order-a.order).map((s,a)=>e.jsxs("div",{className:"border rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"font-medium text-muted-foreground",children:[s.order,"."]}),e.jsx("span",{className:"text-muted-foreground flex-1",children:s.instruction})]}),s.attachments&&s.attachments.length>0&&e.jsx("div",{className:"mt-2 ml-6 flex flex-wrap gap-2",children:s.attachments.map(i=>e.jsxs("a",{href:`/api/compliance/tasks/${t.id}/steps/${s.id}/attachments/${i.id}`,target:"_blank",rel:"noopener noreferrer",className:"relative group border rounded-md overflow-hidden",children:[e.jsx("img",{src:`/api/compliance/tasks/${t.id}/steps/${s.id}/attachments/${i.id}`,alt:i.fileName,className:"w-24 h-24 object-cover","data-testid":`view-img-step-attachment-${i.id}`}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:e.jsx(sa,{className:"w-6 h-6 text-white opacity-0 group-hover:opacity-100 transition-opacity"})}),e.jsx("span",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs px-1 py-0.5 truncate",children:i.fileName})]},i.id))})]},s.id||a))})]}),W.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(cs,{className:"h-4 w-4"}),"Documents"]}),e.jsx("div",{className:"space-y-2",children:W.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-2 border rounded-lg gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:s.file_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.uploaded_by_name||"Unknown",s.file_size?` · ${Re(s.file_size)}`:""]})]})]}),e.jsx("a",{href:`/api/compliance/tasks/${t.id}/attachments/${s.id}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(c,{type:"button",variant:"ghost",size:"icon","data-testid":`view-button-download-doc-${s.id}`,children:e.jsx(os,{className:"w-4 h-4"})})})]},s.id))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.due_date&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-1 flex items-center gap-2",children:[e.jsx(Ze,{className:"h-4 w-4"}),"Due Date"]}),e.jsx("p",{className:(Ie=J(t.due_date))==null?void 0:Ie.color,children:M(new Date(t.due_date),"MMMM d, yyyy")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(He=J(t.due_date))==null?void 0:He.label})]}),t.assigned_to_name&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Assigned To"}),e.jsx("p",{children:t.assigned_to_name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.assigned_to_email})]}),t.jurisdiction&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Jurisdiction"}),e.jsx("p",{children:t.jurisdiction})]}),t.regulatory_body&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Regulatory Body"}),e.jsx("p",{children:t.regulatory_body})]})]}),t.portal_url&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-2 flex items-center gap-2",children:[e.jsx(z,{className:"h-4 w-4"}),"Portal Access"]}),e.jsxs("div",{className:"space-y-2 bg-muted/50 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:t.portal_url,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-600 hover:underline text-sm truncate flex-1 mr-2",children:t.portal_url}),e.jsxs(c,{variant:"default",size:"sm",onClick:()=>window.open(t.portal_url,"_blank"),"data-testid":"button-view-launch-portal",children:[e.jsx(z,{className:"w-4 h-4 mr-1"}),"Launch"]}
1)]}),t.portal_username&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Username:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:t.portal_username}),e.jsx(c,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{navigator.clipboard.writeText(t.portal_username),r({title:"Copied",description:"Username copied to clipboard"})},"data-testid":"button-copy-username",children:e.jsx(be,{className:"w-3 h-3"})})]})]}),t.portal_password&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Password:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:ce?t.portal_password:"••••••••"}),e.jsx(c,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>Ce(!ce),"data-testid":"button-view-toggle-password",children:ce?e.jsx(ds,{className:"w-3 h-3"}):e.jsx(je,{className:"w-3 h-3"})}),e.jsx(c,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{navigator.clipboard.writeText(t.portal_password),r({title:"Copied",description:"Password copied to clipboard"})},"data-testid":"button-copy-password",children:e.jsx(be,{className:"w-3 h-3"})})]})]}),t.portal_notes&&e.jsxs("div",{className:"text-sm pt-2 border-t",children:[e.jsx("span",{className:"text-muted-foreground",children:"Notes: "}),e.jsx("span",{children:t.portal_notes})]})]})]}),t.completion_notes&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Completion Notes"}),e.jsx("p",{className:"text-muted-foreground",children:t.completion_notes})]}),t.confirmation_number&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:"Confirmation Number"}),e.jsx("p",{className:"font-mono bg-muted px-2 py-1 rounded inline-block",children:t.confirmation_number})]}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 pt-4 border-t",children:[e.jsxs("p",{children:["Created: ",M(new Date(t.created_at),"MMMM d, yyyy h:mm a")]}),t.completed_at&&e.jsxs("p",{children:["Completed: ",M(new Date(t.completed_at),"MMMM d, yyyy h:mm a")]}),t.last_reminder_sent&&e.jsxs("p",{children:["Last Reminder: ",M(new Date(t.last_reminder_sent),"MMMM d, yyyy h:mm a")]})]})]}),e.jsxs(ts,{children:[e.jsx(c,{variant:"outline",onClick:()=>Q(!1),children:"Close"}),(t==null?void 0:t.assigned_to_email)&&e.jsxs(c,{variant:"outline",onClick:()=>{H.mutate(t.id)},disabled:H.isPending,children:[e.jsx(Ge,{className:"h-4 w-4 mr-2"}),"Send Reminder"]}),e.jsxs(c,{onClick:()=>{Q(!1),t&&qe(t)},children:[e.jsx(rs,{className:"h-4 w-4 mr-2"}),"Edit Task"]})]})]})})]})}export{Aa 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.