1"use strict";(self.webpackChunkcourtcorrect_platform=self.webpackChunkcourtcorrect_platform||[]).push([[9599],{18539(e,t,n){n.d(t,{A:()=>c,f:()=>l});var i=n(96540),s=n(53669);const a=200;function l(e){const{isAdaptive:t=!0,isDisabled:n=!1,side:l="left",align:o="start"}=e,r=(0,i.useRef)(null),d=(0,i.useRef)(null),[c,p]=(0,i.useState)(!1),[m,h]=(0,i.useState)(l),[x,g]=(0,i.useState)(o),[u,f]=(0,i.useState)(!1),b=(0,i.useCallback)((e,t)=>{const n=window.innerHeight-e.bottom,i=e.top,s=window.innerWidth-e.right,a=e.left;if("bottom"===l||"top"===l){const e="bottom"===l?n:i;if(e<t&&("bottom"===l?i:n)>e)return"bottom"===l?"top":"bottom"}else{const e="right"===l?s:a;if(e<t&&("right"===l?a:s)>e)return"right"===l?"left":"right"}return l},[l]);(0,i.useLayoutEffect)(()=>{if(t&&d.current)if(c){const e=d.current.getBoundingClientRect(),t=r.current?.getBoundingClientRect();h(b(e,"bottom"===l||"top"===l?t?.height??a:t?.width??a)),g(o)}else h(l),g(o)},[c,t,l,o,b]);const j=(0,i.useCallback)(()=>{if(!t||!c||!d.current)return;const e=d.current.getBoundingClientRect(),n=r.current?.getBoundingClientRect(),i=b(e,"bottom"===l||"top"===l?n?.height??a:n?.width??a);i!==m&&(f(!0),h(i),g(o),requestAnimationFrame(()=>f(!1)))},[t,c,l,b,o,m]),w=(0,s.d)(j,50);return(0,i.useEffect)(()=>{if(t)return window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[w,t]),{ref:r,triggerRef:d,isOpen:c,onOpenChange:p,isDisabled:n,side:m,align:x,isRecalculating:u,avoidCollisions:t}}var o=n(31127),r=n(34164);var d=n(74848);const c=(0,i.forwardRef)(function(e,t){const{className:n,triggerClassName:i,isOpen:s,onOpenChange:a,side:l,align:c,trigger:p,children:m,showArrow:h=!0,isDisabled:x=!1,avoidCollisions:g,triggerRef:u}=e,f=!x&&s;return(0,d.jsxs)(o.bL,{open:f,onOpenChange:e=>{x&&e||a?.(e)},children:[(0,d.jsx)(o.l9,{asChild:!0,children:(0,d.jsx)("div",{ref:u,className:(0,r.$)("haTtcILP",i,x?"QCRXMj9e":void 0),children:p})}),(0,d.jsx)(o.ZL,{children:(0,d.jsxs)(o.UC,{ref:t,className:(0,r.$)("gWy5uj9M",n),side:l,align:c,sideOffset:5,avoidCollisions:g,children:[m,h?(0,d.jsx)(o.i3,{className:"cVDoQBYh"}):null]})})]})})},44582(e,t,n){n.d(t,{c:()=>l});var i=n(96540),s=n(18539);var a=n(74848);const l=(0,i.forwardRef)(({options:e,renderComponent:t,onSelect:n,valueStyles:l,onVisibilityChange:o,dropdownClassName:r,wrapperClassName:d,...c},p)=>{const[m,h]=(0,i.useState)(!1),x=e=>{h(e),o instanceof Function&&o(e)};return(0,a.jsx)(s.A,{isOpen:m,onOpenChange:x,side:"bottom",align:"end",className:"HmjGWc4I",trigger:(0,a.jsx)("span",{ref:p,...c,onClick:e=>{e.stopPropagation(),x(!m)},children:t()}),showArrow:!1,children:e?.map((e,t)=>e&&(0,a.jsxs)("div",{className:"UlbMlfT0",onClick:t=>{t.stopPropagation(),e&&"object"==typeof e&&"props"in e&&"function"==typeof e.props?.onClick&&e.props.onClick(t),n&&n(e),x(!1)},children:[(0,a.jsx)("div",{className:"YfaBejOC"}),(0,a.jsx)("div",{className:"wxSMm24s",style:l,children:e})]},`option-${t}`))})})},55435(e,t,n){n.d(t,{S:()=>r,A:()=>d});var i=n(96540),s=n(11646),a=n(99120);const l=n(78094).Ay.div.withConfig({componentId:"sc-wl421-0"})(['display:flex;align-items:center;gap:16px;margin-bottom:24px;p{color:#6f7170;font-size:14px;font-style:normal;font-weight:500;line-height:20px;margin:0;padding:16px;cursor:pointer;&.active{color:#0f1310;font-size:14px;font-style:normal;font-weight:500;line-height:20px;position:relative;&::before{content:"";position:absolute;bottom:0;width:100%;left:0;height:4px;background-color:#26c281;border-radius:4px 4px 0px 0px;}}}']);var o=n(74848);let r=function(e){return e.LETTERS="letters",e.EMAILS="emails",e}({});const d=i.memo(({active:e})=>{const t=(0,a.Zp)(),n=(0,s.J)(),i=n?.party_id&&n?.features.is_email_integration,d=n.features.is_new_frl_pipeline,c=n=>{if(e===n)return;const i=n===r.LETTERS?"/dashboard/templates/example-letters":"/dashboard/templates/emails";t(i)};return(0,o.jsxs)(l,{children:[!d&&(0,o.jsx)("p",{className:e===r.LETTERS?"active":"",onClick:()=>c(r.LETTERS),children:"Example Letters"}),i?(0,o.jsx)("p",{className:e===r.EMAILS?"active":"",onClick:()=>c(r.EMAILS),children:"Email Templates"}):null]})})}
1,67686(e,t,n){n.d(t,{A:()=>p});var i=n(30721),s=n(97534),a=n(78094),l=n(18824);const o=a.Ay.div.withConfig({componentId:"sc-kzy0bw-0"})(["position:relative;width:auto;h1{margin-bottom:24px;}@media ","{margin-left:0;width:100%;button{right:0px;}}"],l.A.w800px),r=a.Ay.p.withConfig({componentId:"sc-kzy0bw-1"})(["font:var(--font-l-regular);color:#6f7170 !important;margin-bottom:0 !important;"]),d=a.Ay.div.withConfig({componentId:"sc-kzy0bw-2"})(["display:flex;gap:10px;position:absolute;top:0;right:0;button{min-width:113px;}"]);var c=n(74848);const p=({title:e,subtitle:t,buttonText:n,secondaryButtonText:a,onButtonClick:l,onSecondaryButtonClick:p,containerStyle:m})=>(0,c.jsxs)(o,{style:m,children:[(0,c.jsx)("h1",{children:e}),t&&(0,c.jsx)(r,{children:t}),(0,c.jsxs)(d,{children:[a&&(0,c.jsx)(i.A,{variant:"white",text:a,onClick:p}),n&&(0,c.jsx)(i.A,{variant:"green",text:n,onClick:l,svgBefore:(0,c.jsx)(s.I,{name:"plus"})})]})]})},69599(e,t,n){n.d(t,{t:()=>I,A:()=>N});var i=n(96540),s=n(30721),a=n(65244),l=n(44582),o=n(42512),r=n(67686),d=n(95093),c=n.n(d),p=n(61225),m=n(99120),h=n(32892),x=n(97534),g=n(10017),u=n(86928),f=n(29577),b=n(81342),j=n(55435),w=n(97168),C=n(78094),y=n(74848);const v=C.Ay.div.withConfig({componentId:"sc-87x4zc-0"})(["font-size:14px;li{margin-bottom:5px;}"]),A=({callback:e,selectedEmailTemplates:t,onClose:n})=>{const i=(0,p.wA)();return t.length>0&&(0,y.jsx)(w.A,{title:"Delete multiple email templates",primary_action_click:async()=>{try{for(const e of t)await u.A.delete(`email-templates/templates/${e.id}`);i((0,b.nm)({message:"Deleted",style:"success"})),e&&e(),n()}catch{i((0,b.nm)({message:"Something went wrong"}))}},secondary_action_click:n,primary_action_label:"Delete",secondary_action_label:"Cancel",actions_variant:"red",onClose:n,children:(0,y.jsxs)(v,{children:["Are you sure you want to delete the following email templates? ",(0,y.jsx)("br",{}),(0,y.jsx)("ul",{children:t.map((e,t)=>(0,y.jsx)("li",{children:e.name},t))})]})})};var k=n(69375);const _=({emailTemplate:e,onDeleteCallback:t,onRenameCallback:n,onClose:s})=>{const a=(0,i.useRef)(),l=(0,p.wA)(),o={title:`${e.action} Email Template`,primary_action_label:e.action,actions_variant:"Delete"===e.action?"red":"green",children:"Delete"===e.action?(0,y.jsxs)("span",{children:["Are you sure you want to delete this email template?",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),e.name]}):(0,y.jsx)(k.A,{label:"New name",variant:"white",defaultValue:e.name,ref:a})};return e&&(0,y.jsx)(w.A,{...o,primary_action_click:()=>{const i=a.current?.value?.trim();if("Rename"===e.action&&(i.length<1||i.length>256))return l((0,b.nm)({message:"The new name has to be between 1 and 256 characters"}));(0,u.A)({url:`email-templates/templates/${e.id}`,method:"Delete"===e.action?"delete":"patch",data:{name:i}}).then(i=>{l((0,b.nm)({message:`${e.action}d`,style:"success"})),"Delete"===e.action?t&&t(e.id):n&&n(i.data)}).catch(()=>l((0,b.nm)({message:"Something went wrong"}))).finally(s)},secondary_action_label:"Cancel",secondary_action_click:s,onClose:s,children:o.children})};var S=n(46870);const I=i.memo(()=>(0,y.jsxs)(i.Fragment,{children:[(0,y.jsx)(j.A,{active:j.S.EMAILS}),(0,y.jsx)(r.A,{title:"Email Templates",subtitle:"Add your email templates here."})]})),E=i.memo(({selectedEmailTemplates:e,onDelete:t,onClearSelection:n})=>(0,y.jsxs)(S.cf,{isVisible:e?.length>0,children:[(0,y.jsxs)("button",{className:"delete",onClick:t,children:[(0,y.jsx)("img",{src:"/img/trash_red.svg",alt:"delete"}),"Delete"]}),(0,y.jsxs)("span",{children:[e?.filter?.(e=>!e?.is_default)?.length," selected"]}),(0,y.jsxs)("span",{className:"button",onClick:n,children:[(0,y.jsx)("img",{src:"/img/close_grey.svg",alt:"clear"}),"Clear Selection"]})]})),T=i.memo(({emailTemplate:e,setEmailTemplates:t})=>{const n=(0,m.Zp)();return(0,y.jsxs)(S.OU,{children:[(0,y.jsx)(g.m,{title:"Edit",placement:"top",children:(0,y.jsx)(x.I,{className:"email-actions-edit-button",name:"edit",onClick:()=>n(`/dashboard/templates/emails/edit/${e.id}`)})}),(0,y.jsx)(g.m,{title:"More",placement:"top",children:(0,y.jsx)(l.c,{options:[(0,y.jsxs)("span",{children:[(0,y.jsx)(x.I,{name:"edit-underscore"}),"Rename"]}),(0,y.jsxs)("span",{children:[(0,y.jsx)(x.I,{name:"delete"}),"Delete"]})],onSelect:n=>{"Rename"===n.props.children[1]?t({...e,action:"Rename"}):t({...e,action:"Delete"})},renderComponent:()=>(0,y.jsx)(x.I,{name:"dots-vertical"}),dropdownClassName:"email-actions-dropdown"})})]})}),N=()=>{const e=(0,p.d4)(e=>e.auth.user),t=(0,m.Zp)(),n=(0,p.wA)(),l=(0,h.EN)(),[r,d]=(0,i.useState)([]),[x,g]=(0,i.useState)([]),[j,w]=(0,i.useState)(""),[C,v]=(0,i.useState)(!1),[k,N]=(0,i.useState)({}),[D,R]=(0,i.useState)(!1),[L,z]=(0,i.useState)(!1),M=(0,i.useMemo)(()=>r.filter(e=>e.name.toLowerCase().includes(j.toLowerCase())),[r,j]),B=(0,i.useCallback)(()=>{v(!1),u.A.get("email-templates/templates").then(e=>{d([...e.data.items])}).catch(()=>{n((0,b.nm)({message:"Could not retrieve emails"})),t("/dashboard/templates/emails")}).finally(()=>v(!0))},[n,t]);(0,i.useEffect)(()=>{l.trackEvent(h.Fj.email.enterTab),B()},[B]);const O=(0,i.useCallback)(e=>{g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),$=(0,i.useCallback)(e=>{N(e),R(!0)},[]);return(0,y.jsxs)(i.Fragment,{children:[!C&&(0,y.jsx)(o.A,{}),(0,y.jsxs)(S.j_,{children:[D?(0,y.jsx)(_,{emailTemplate:k,onDeleteCallback:e=>d(r.filter(t=>t.id!==e)),onRenameCallback:e=>{d(r.map(t=>
1t.id===e.id?e:t)),B()},onClose:()=>R(!1)}):null,L?(0,y.jsx)(A,{selectedEmailTemplates:r.filter(e=>x.includes(e.id)),callback:()=>{d(r.filter(e=>!x.includes(e.id))),g([])},onClose:()=>z(!1)}):null,(0,y.jsx)(I,{}),(0,y.jsx)(S.xq,{children:(0,y.jsxs)("div",{className:"top-row",children:[(0,y.jsx)(f.S,{inputClassName:"yREZjUUl",label:"Search through templates",placeholder:"Search",value:j,onChange:e=>(w(e.trim()),void(x.length&&g([]))),updateState:!0}),e.is_admin?(0,y.jsx)(s.A,{text:"+ New",variant:"green",size:"small",onClick:()=>t("/dashboard/templates/emails/new")}):null]})}),(0,y.jsx)(E,{selectedEmailTemplates:x,onDelete:()=>z(!0),onClearSelection:()=>g([])}),(0,y.jsxs)(S.XI,{children:[(0,y.jsxs)("tr",{children:[e.is_admin?(0,y.jsx)("th",{style:{width:"20px"},className:"checkbox",children:(0,y.jsx)(a.A,{onChange:()=>{const e=M;x.length===e.length?g([]):g(e.map(e=>e.id))},checked:x.length===M.length&&x.length>0})}):null,(0,y.jsx)("th",{children:(0,y.jsx)(S.IB,{children:"Name"})}),(0,y.jsx)("th",{children:(0,y.jsx)(S.IB,{children:"Created on"})}),(0,y.jsx)("th",{children:(0,y.jsx)(S.IB,{children:"Last Update"})}),e.is_admin?(0,y.jsx)("th",{style:{width:"20px"}}):null]}),M.map((n,i)=>(0,y.jsxs)("tr",{children:[e.is_admin?(0,y.jsx)("td",{className:"checkbox",children:(0,y.jsx)(a.A,{onChange:()=>O(n.id),checked:x.includes(n.id)})}):null,(0,y.jsx)("td",{children:(0,y.jsx)("span",{style:{color:"#2653C2",textDecoration:"underline",cursor:"pointer"},onClick:()=>t(`/dashboard/templates/emails/edit/${n.id}`),children:n.name})}),(0,y.jsx)("td",{children:c()(n?.created_at).format("MMM DD, YYYY")}),(0,y.jsx)("td",{children:n?.updated_at?`${c()(n?.updated_at).format("MMM DD, YYYY")}${n?.updated_bys?" by "+n.updated_by:""}`:null}),e.is_admin?(0,y.jsx)("td",{children:(0,y.jsx)(T,{emailTemplate:n,setEmailTemplates:$})}):null]},`email-template-row-${i}`))]})]})]})}},46870(e,t,n){n.d(t,{ED:()=>p,IB:()=>l,OU:()=>x,Oq:()=>r,XI:()=>o,cf:()=>h,j_:()=>s,lX:()=>d,mr:()=>m,ud:()=>c,xq:()=>a});var i=n(78094);const s=i.Ay.div.withConfig({componentId:"sc-1nptdd0-0"})(["li{list-style-type:inherit;}
1span.button{cursor:pointer;}"]),a=i.Ay.div.withConfig({componentId:"sc-1nptdd0-1"})(["background:#f7fcfa;.top-row{display:flex;justify-content:space-between;padding:20px;margin:24px 0;gap:24px;align-items:end;label{color:#0f1310;}.inputfield,.letters-dropdown{width:100%;}.inputfield{img{bottom:12px;}}button{min-width:110px;height:42px;}}.tags{padding:0 20px 24px;display:flex;gap:16px;flex-wrap:wrap;}.clear-filters{color:#008347;font-size:14px;cursor:pointer;margin-right:24px;margin-top:4px;}border-radius:8px;"]),l=i.Ay.div.withConfig({componentId:"sc-1nptdd0-2"})(["font-weight:500;font-size:14px;"]),o=i.Ay.table.withConfig({componentId:"sc-1nptdd0-3"})(["position:relative;border:1px solid #e4f6ed;border-radius:8px;text-align:left;font-size:14px;border-collapse:separate;width:100%;margin:20px 0px 0px 0px;border-spacing:0;.checkbox{& > div{width:fit-content;}}img{cursor:pointer;}tr{border-bottom:1px solid #e4f6ed;width:100%;}th{background:#f7fcfa;padding:0 20px;height:52px;width:33%;border-right:1px solid #e4f6ed;}th:first-child{border-top-left-radius:8px;}th:last-child{border-top-right-radius:8px;border-right:none;}td{font-weight:500;font-size:14px;color:#6f7170;padding:8px 20px;height:52px;border-top:1px solid #e4f6ed;border-right:1px solid #e4f6ed;}td:last-child{border-right:none;}input{margin:0 auto;}p{margin:0;}"]),r=i.Ay.div.withConfig({componentId:"sc-1nptdd0-6"})(["border-radius:8px;border:1px solid #f3f3f3;background:#fff;display:flex;padding:36px;flex-direction:column;align-items:flex-start;gap:16px;margin:30px 0 0 0;"]),d=i.Ay.div.withConfig({componentId:"sc-1nptdd0-7"})(["width:100%;display:flex;flex-direction:column;padding:0 0 16px 0;border-bottom:1px solid #e4e5e7;"]),c=i.Ay.div.withConfig({componentId:"sc-1nptdd0-8"})(["display:flex;justify-content:flex-end;align-items:center;gap:16px;"]),p=i.Ay.div.withConfig({componentId:"sc-1nptdd0-9"})(["display:flex;flex-direction:column;"]),m=i.Ay.div.withConfig({componentId:"sc-1nptdd0-10"})(["background:#f7fcfa;border-radius:8px;padding:24px 36px 36px 36px;margin-top:30px;"]),h=i.Ay.div.withConfig({componentId:"sc-1nptdd0-11"})(["display:flex;align-items:center;margin:15px 0 10px 0;max-height:",";overflow:hidden;transition:max-height 200ms ease-out;button:not(:first-child),span{margin-left:20px;}button.delete{background:transparent;border:0;display:flex;align-items:center;color:#cf2d2d;font-size:14px;cursor:pointer;}span{color:#6f7170;font-size:14px;display:flex;align-items:center;}
1span.button{cursor:pointer;}"],({isVisible:e})=>e?"100px":"0"),x=i.Ay.div.withConfig({componentId:"sc-1nptdd0-12"})(["display:flex;align-items:center;.email-actions-edit-button{margin-right:10px;cursor:pointer;}.email-actions-dropdown{transform:translateX(-88px);}"])}}]);
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.