whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/QuoteSlider-CSPN6fM1.js
import{bs as M,u as V,bu as ee,a9 as se,a as te,w as ne,bY as re,bv as le,f as ie,I as ae,J as oe,K as de,d as ce,Y as me,bt as ue,g as xe,Z as O,p as w,a1 as he,b as G,j as s,bw as pe,bx as be,by as o,l as c,ey as fe,aA as S,aO as je,bz as ge,bA as ye,bf as Ce,a$ as _e,bB as $e,b1 as Ne,b2 as ve,i as f,N as we,bp as Se,D as Te,h as W,bC as ke,aH as Ee,bD as Pe,bE as Re,bj as Ae,bq as T,bF as ze,r as k,e as E,H as Be,bG as He}from"./bundle.OlIVtvc7.js";import{E as Ie}from"./EmailRecord-DsIG6Q4V.js";import{I as Fe}from"./InvoiceStatus-BkeECTVy.js";import{C as De}from"./CloudPlay-C_FtsbNl.js";import{H as Qe}from"./History-C-yFGmPI.js";const Le=M(null),Oe=M(!1);W.extend(He);const b=Be.div` background-color: ${({theme:r})=>r.backgroundColor}; &:hover { background-color: ${({theme:r})=>r.hoverBackgroundColor}; } `;function Ge(){const[r]=V();return l=>{var x,j,p,a,g,y,C;let u=Ae(`activity_${l.activity_type_id}`,{});const t={client:s.jsx(T,{to:f("/clients/:id",{id:(x=l.client)==null?void 0:x.hashed_id}),children:(j=l.client)==null?void 0:j.label}),user:((p=l.user)==null?void 0:p.label)??r("system"),quote:s.jsx(T,{to:f("/quotes/:id/edit",{id:(a=l.quote)==null?void 0:a.hashed_id}),children:(g=l==null?void 0:l.quote)==null?void 0:g.label}),contact:s.jsx(T,{to:f("/clients/:id/edit",{id:(y=l==null?void 0:l.contact)==null?void 0:y.hashed_id}),children:(C=l==null?void 0:l.contact)==null?void 0:C.label}),notes:(l==null?void 0:l.notes)&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"'",l==null?void 0:l.notes,"'"]})};for(const[h,_]of Object.entries(t))u=ze(u,`:${h}`,()=>_);return u}}function Ze(){var A,z,B,H,I,F,D;const[r]=V(),l=ee(),u=se(),t=te(),x=ne(),j=re({showCommonBulkAction:!0,showEditAction:!0}),{timeFormat:p}=le(),{dateFormat:a}=ie(),g=ae(),y=oe(),C=de({withTimezone:!0,formatOnlyDate:!0}),h=ce(),_=me(),K=ue(),P=xe(),Y=Ge(),[e,Z]=O(Le),[$,J]=O(Oe),[N,U]=w.useState(!1),[R,X]=w.useState([]),{data:d}=he({id:e==null?void 0:e.invoice_id}),{data:i}=G({queryKey:["/api/v1/quotes",e==null?void 0:e.id,"slider"],queryFn:()=>k("GET",E(`/api/v1/quotes/${e==null?void 0:e.id}?include=activities.history&reminder_schedule=true`)).then(n=>n.data.data),enabled:e!==null&&$,staleTime:1/0}),{data:v}=G({queryKey:["/api/v1/activities",e==null?void 0:e.id,"quote"],queryFn:()=>k("POST",E("/api/v1/activities/entity"),{entity:"quote",entity_id:e==null?void 0:e.id}).then(n=>n.data.data),enabled:e!==null&&$,staleTime:1/0}),q=async()=>{const n=await l.fetchQuery(["/api/v1/quotes",e==null?void 0:e.id,"emailHistory"],()=>k("POST",E("/api/v1/emails/entityHistory"),{entity:"quote",entity_id:e==null?void 0:e.id}),{staleTime:1/0}).then(m=>m.data);X(n)};return w.useEffect(()=>{e&&q()},[e]),s.jsx(pe,{size:"regular",visible:$,onClose:()=>{J(!1),Z(null)},title:`${r("quote")} ${e==null?void 0:e.number}`,topRight:e&&(_("edit_quote")||K(e))?s.jsx(Re,{label:r("actions"),resource:e,actions:j}):null,withoutActionContainer:!0,withoutHeaderBorder:!0,children:s.jsxs(be,{tabs:[r("overview"),r("history"),r("activity"),r("email_history")],width:"full",withHorizontalPadding:!0,horizontalPaddingWidth:"1.5rem",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"px-6",children:[s.jsx(o,{className:"border-b border-dashed",leftSide:r("quote_amount"),pushContentToRight:!0,withoutWrappingLeftSide:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?h(e==null?void 0:e.amount,(A=e.client)==null?void 0:A.country_id,(z=e.client)==null?void 0:z.settings.currency_id):null}),s.jsx(o,{className:"border-b border-dashed",leftSide:r("balance_due"),pushContentToRight:!0,withoutWrappingLeftSide:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?h(e.balance,(B=e.client)==null?void 0:B.country_id,(H=e.client)==null?void 0:H.settings.currency_id):null}),s.jsx(o,{className:"border-b border-dashed",leftSide:r("date"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?c(e==null?void 0:e.date,a):null}),s.jsx(o,{className:"border-b border-dashed",leftSide:r("valid_until"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?c(e.due_date,a):null}),s.jsx(o,{leftSide:r("status"),pushContentToRight:!0,noExternalPadding:!0,children:e?s.jsx(fe,{entity:e}):null})]}),s.jsx(S,{withoutPadding:!0,borderColor:t.$20}),s.jsxs("div",{className:"flex space-x-4 items-center justify-center px-6 py-5",children:[s.jsxs(b,{className:"flex flex-col items-center justify-center space-y-2 shadow-sm border px-14 py-5 cursor-pointer rounded-md",onClick:()=>e?je(e):null,style:{borderColor:t.$20},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:[s.jsx(De,{color:t.$17,filledColor:t.$17,size:"1.3rem"}),s.jsx("span",{className:"font-medium whitespace-nowrap",style:{color:t.$3},children:r("view_portal")})]}),e?s.jsxs(b,{className:"flex flex-col items-center justify-center space-y-2 shadow-sm border px-14 py-5 cursor-pointer rounded-md",onClick:()=>{navigator.clipboard.writeText(ye(e)??""),Ce.success("copied_to_clipboard",{value:""})},style:{borderColor:t.$20},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:[s.jsx(ge,{color:t.$17,filledColor:t.$17,size:"1.3rem"}),s.jsx("span",{className:"font-medium whitespace-nowrap",style:{color:t.$3},children:r("copy_link")})]}):null]}),s.jsx(S,{withoutPadding:!0,borderColor:t.$20}),e&&e.next_send_date?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2 whitespace-nowrap px-6",children:[s.jsx(_e,{size:"regular",width:"auto",tooltipElement:s.jsx("article",{className:ve("prose prose-sm",{"prose-invert":!(x!=null&&x.dark_mode)}),dangerouslySetInnerHTML:{__html:Ne((i==null?void 0:i.reminder_schedule)??"")}}),children:s.jsxs("h3",{className:"flex mt-2 italic",children:[r("reminders")," ",s.jsx($e,{className:"mt-1 ml-1"})]})}),s.jsx(o,{className:"border-b border-dashed",leftSide:r("next_send_date"),pushContentToRight:!0,noExternalPadding:!0,withoutWrappingLeftSide:!0,style:{borderColor:t.$20},children:e?C(e.next_send_date,"","",y(g(e.client,"timezone_id")).timeZone):null}),s.jsx(o,{className:"border-b border-dashed",leftSide:r("reminder_last_sent"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?c(e.reminder_last_sent,a):null}),e.reminder1_sent?s.jsx(o,{className:"border-b border-dashed",leftSide:r("first_reminder"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?c(e.reminder1_sent,a):null}):null,e.reminder2_sent?s.jsx(o,{className:"border-b border-dashed",leftSide:r("second_reminder"),pushContentToRight:!0,noExternalPadding:!0,style:{borderColor:t.$20},children:e?c(e.reminder2_sent,a):null}):null,e.reminder3_sent?s.jsx(o,{leftSide:r("third_reminder"),pushContentToRight:!0,noExternalPadding:!0,children:e?c(e.reminder3_sent,a):null}):null]}),s.jsx(S,{withoutPadding:!0,borderColor:t.$20})]}):null,d&&s.jsx("div",{className:"flex flex-col space-y-4 px-6 py-5",children:s.jsxs(b,{className:"flex flex-col items-start justify-center space-y-2 shadow-sm text-sm border p-5 w-full cursor-pointer rounded-md",onClick:()=>{!P("invoice",d)&&u(f("/invoices/:id/edit",{id:d.id}))},style:{borderColor:t.$20},theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$4},children:[s.jsxs("span",{className:"font-medium",style:{color:t.$3},children:[r("invoice")," ",d.number]}),s.jsxs("div",{className:"inline-flex items-center space-x-1",style:{color:t.$17},children:[s.jsx("span",{children:h(d.amount,(I=d.client)==null?void 0:I.country_id,(F=d.client)==null?void 0:F.settings.currency_id)}),s.jsx("span",{children:"-"}),s.jsx("span",{children:c(d.date,a)})]}),s.jsx("div",{children:s.jsx(Fe,{entity:d})})]})})]}),s.jsxs("div",{children:[(i==null?void 0:i.activities)&&i.activities.filter(({history:n})=>n==null?void 0:n.id).length===0&&s.jsx(we,{children:r("api_404")}),!!((D=i==null?void 0:i.activities)!=null&&D.length)&&s.jsx("div",{className:"flex flex-col px-3",children:(i==null?void 0:i.activities)&&i.activities.filter(({history:n})=>n==null?void 0:n.id).map(n=>{var m,Q,L;return s.jsxs(b,{className:"flex items-center justify-start p-4 space-x-3 rounded-md cursor-pointer",onClick:()=>u(f("/activities/:id",{id:n.id})),theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$25},children:[s.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:t.$20},children:s.jsx(Qe,{size:"1.3rem",color:t.$16,filledColor:t.$16})}),s.jsxs("div",{className:"flex flex-col items-start space-y-0.5 justify-center",children:[s.jsxs("div",{className:"flex space-x-1 text-sm",children:[s.jsx("span",{style:{color:t.$3},children:e!=null&&e.client?h(n.history.amount,(m=e==null?void 0:e.client)==null?void 0:m.country_id,(Q=e==null?void 0:e.client)==null?void 0:Q.settings.currency_id):null}),s.jsx("div",{children:s.jsx(Se,{color:t.$17,size:"1.1rem"})}),s.jsx(Te,{to:`/clients/${n.client_id}`,renderSpan:P("client",e==null?void 0:e.client),children:(L=e==null?void 0:e.client)==null?void 0:L.display_name})]}),s.jsxs("div",{className:"flex items-center space-x-1 text-xs",style:{color:t.$17},children:[s.jsx("span",{children:c(n.created_at,`${a} ${p}`)}),s.jsx("span",{children:W.unix(n.created_at).fromNow()})]})]})]},n.id)})})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center border-b px-6 pb-4 justify-between",style:{borderColor:t.$20},children:[s.jsx(ke,{label:r("comments_only"),checked:N,onValueChange:n=>U(n)}),s.jsx(Ee,{entity:"quote",entityId:i==null?void 0:i.id,label:(i==null?void 0:i.number)||""})]}),s.jsx("div",{className:"flex flex-col pt-3 px-3",children:v==null?void 0:v.filter(n=>N&&n.activity_type_id===141||!N).map(n=>s.jsxs(b,{className:"flex space-x-3 p-4 rounded-md flex-1 min-w-0",theme:{backgroundColor:t.$1,hoverBackgroundColor:t.$25},children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("div",{className:"p-2 rounded-full",style:{backgroundColor:t.$20},children:s.jsx(Pe,{size:"1.3rem",color:t.$16,filledColor:t.$16})})}),s.jsxs("div",{className:"flex flex-col space-y-0.5 flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",style:{color:t.$3},children:Y(n)}),s.jsxs("div",{className:"flex w-full items-center space-x-1 text-xs truncate",style:{color:t.$17},children:[s.jsx("span",{className:"whitespace-nowrap",children:c(n.created_at,`${a} ${p}`)}),s.jsx("span",{children:"-"}),s.jsx("span",{children:n.ip})]})]})]},n.id))})]}),s.jsxs("div",{className:"flex flex-col space-y-2 px-6",children:[!R.length&&s.jsx("span",{className:"text-sm px-4",style:{color:t.$3},children:r("email_history_empty")}),R.map((n,m)=>s.jsx(Ie,{className:"py-4",emailRecord:n,index:m,withAllBorders:!0},m))]})]})})}export{Ze as Q,Oe as a,Le as q,Ge as u};
Copyright ©2021 || Defacer Indonesia