whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> //home/qbizpnmr/arif.umairtax.com/public/TaskDetails-DEMDYSXK.js
import{p as V,R as L,P as O,t as I,eT as T,h as f,c7 as ie,Y as U,bt as Q,eZ as G,j as e,eP as j,u as K,a as ee,e_ as te,f3 as re,f4 as oe,f5 as M,f6 as le,f7 as R,f8 as w,cx as N,cv as ce,bb as de,b2 as se,cb as ue,H as he,eU as me,C as xe,eN as J,ae as Y,cu as fe,cV as ge,bq as pe,i as _e,ay as je,db as Ce,cW as ve,cy as ke,eV as be,cz as z,eI as we}from"./bundle.OlIVtvc7.js";import{T as Z,f as A}from"./TaskClock-SGIUUrSZ.js";import{C as ye}from"./ClientActionButtons-DC8u7uNL.js";import{r as $e}from"./react-responsive-DfXP7Il0.js";function W(){return W=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(a[o]=r[o])}return a},W.apply(this,arguments)}function Ne(a,s){if(a==null)return{};var r=Te(a,s),o,i;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);for(i=0;i<t.length;i++)o=t[i],!(s.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(a,o)&&(r[o]=a[o])}return r}function Te(a,s){if(a==null)return{};var r={},o=Object.keys(a),i,t;for(t=0;t<o.length;t++)i=o[t],!(s.indexOf(i)>=0)&&(r[i]=a[i]);return r}var F=V.forwardRef(function(a,s){var r=a.color,o=r===void 0?"currentColor":r,i=a.size,t=i===void 0?24:i,n=Ne(a,["color","size"]);return L.createElement("svg",W({ref:s,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n),L.createElement("circle",{cx:"12",cy:"12",r:"10"}),L.createElement("line",{x1:"10",y1:"15",x2:"10",y2:"9"}),L.createElement("line",{x1:"14",y1:"15",x2:"14",y2:"9"}))});F.propTypes={color:O.string,size:O.oneOfType([O.string,O.number])};F.displayName="PauseCircle";/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function y(a){if(a!==0)return f.unix(a).format("YYYY-MM-DD")}function v(a){if(a!==0)return f.unix(a).format("HH:mm:ss")}function Se(a,s,r){const o=y(a),i=v(s);let t=f.unix(s).diff(f.unix(a),"seconds");if(!r&&t<0&&s){const n=f(`${o} ${i}`,"YYYY-MM-DD HH:mm:ss").unix();t=f.unix(n).diff(f.unix(a),"seconds")}if(t<0)return"00:00:00";if(s&&o!=="1970-01-01"){let n=Math.floor(t/3600).toString();t-=Number(n)*3600;let c=Math.floor(t/60).toString();t-=Number(c)*60;let m=t.toString();return Number(n)<10&&(n="0"+n.toString()),Number(c)<10&&(c="0"+c.toString()),Number(m)<10&&(m="0"+m.toString()),n+":"+c+":"+m}else return"00:00:00"}function Me(){const a=I();return(s,r,o,i,t)=>{const n=T(s),c=n[t][E.Start],m=r&&a.show_task_end_date?y(r):y(c||f().unix()),u=f(`${m} ${o}`,"YYYY-MM-DD HH:mm:ss").unix();return n[t][i]=u,JSON.stringify(n)}}function Ve(){const a=I();return(s,r,o,i,t)=>{const n=v(r||f().unix()),c=f(`${o} ${n}`,"YYYY-MM-DD HH:mm:ss").unix(),m=T(s);if(m[i][t]=c,a&&!a.show_task_end_date&&m[i][E.End]){const u=v(m[i][E.End]),p=f(`${o} ${u}`,"YYYY-MM-DD HH:mm:ss").unix();m[i][E.End]=p}return JSON.stringify(m)}}function De(a,s,r,o){let i=f.unix(r);const t=s.split(":");t[0]&&(i=i.add(parseFloat(t[0]),"hour")),t[1]&&(i=i.add(parseFloat(t[1]),"minute")),t[2]&&(i=i.add(parseFloat(t[2]),"second"));const n=T(a);return n[o][1]=i.unix(),JSON.stringify(n)}function He({start:a,task:s}){const[r,o]=V.useState(Math.floor(Date.now()/1e3)-a),i=V.useRef(void 0),t=()=>{o(Math.floor(Date.now()/1e3)-a),i.current&&clearInterval(i.current),i.current=setInterval(()=>{o(C=>C+1)},1e3)};V.useEffect(()=>(i.current&&(clearInterval(i.current),document.removeEventListener("visibilitychange",t)),o(Math.floor(Date.now()/1e3)-a),i.current=setInterval(()=>{o(C=>C+1)},1e3),document.addEventListener("visibilitychange",t),()=>{i.current&&clearInterval(i.current),document.removeEventListener("visibilitychange",t)}),[]),V.useEffect(()=>{o(Math.floor(Date.now()/1e3)-a)},[a]);const n=C=>{const $=H=>String(H).padStart(2,"0"),k=Math.floor(C/3600),S=Math.floor(C%3600/60),D=C%60;return`${$(k)}:${$(S)}:${$(D)}`},c=ie(),m=U(),u=Q(),p=G();return e.jsxs("span",{className:"flex items-center space-x-2",children:[e.jsx("span",{children:n(r)}),j(s)&&!s.invoice_id&&e.jsx(F,{className:"cursor-pointer",color:"#808080",size:24,stroke:c,strokeWidth:"1",onClick:()=>(m("edit_task")||u(s))&&p(s),cursor:m("edit_task")||u(s)?"pointer":"not-allowed"})]})}var E=(a=>(a[a.Start=0]="Start",a[a.End=1]="End",a[a.Description=2]="Description",a[a.Billable=3]="Billable",a))(E||{});const Pe=he.div` background-color: ${({theme:a})=>a.backgroundColor}; &:hover { background-color: ${({theme:a})=>a.hoverBackgroundColor}; } `;function Ye(a){const{task:s,handleChange:r}=a,[o]=K(),i=ee(),t=te(),n=I(),c=Me(),m=Ve(),[u,p]=V.useState(),C=()=>{const l=T(s.time_log),d=l.at(-1);let x=f().unix();d&&d[1]!==0&&(x=d[1]+1),l.push([x,0,"",!0]),r("time_log",JSON.stringify(l))},$=l=>{const d=T(s.time_log);d.splice(l,1),r("time_log",JSON.stringify(d))},k=(l,d,x,_)=>{p(_),r("time_log",c(s.time_log,l,d,x,_))},S=(l,d,x,_)=>{p(x),r("time_log",m(s.time_log,l,d,x,_))},D=(l,d,x)=>{p(x),r("time_log",De(s.time_log,l,d,x))},H=(l,d,x)=>{const _=T(s.time_log);_[d][x]=l,r("time_log",JSON.stringify(_))},B=(l,d,x)=>{const _=T(s.time_log);_[d][x]=l,r("time_log",JSON.stringify(_))},h=l=>{const d=l.split(":");return d.length===3&&d.every(x=>x.length===2)},P=l=>/^\d{4}-\d{2}-\d{2}$/.test(l),ne=()=>{let l=4;return n!=null&&n.show_task_end_date&&(l+=1),n!=null&&n.settings.allow_billable_task_items&&(l+=1),l};return V.useEffect(()=>{if(typeof u=="number"){const l=T(s.time_log),d=l[u]&&l[u][0],x=l[u]&&l[u][1];d&&x&&d>x&&(l[u][1]=d,r("time_log",JSON.stringify(l))),p(void 0)}},[u]),e.jsxs(re,{children:[e.jsxs(oe,{children:[e.jsx(M,{className:"px-3",withoutHorizontalPadding:!0,children:o("start_date")}),e.jsx(M,{className:"px-3",withoutHorizontalPadding:!0,children:o("start_time")}),(n==null?void 0:n.show_task_end_date)&&e.jsx(M,{className:"px-3",withoutHorizontalPadding:!0,children:o("end_date")}),e.jsx(M,{className:"px-3",withoutHorizontalPadding:!0,children:o("end_time")}),e.jsx(M,{className:"px-3",withoutHorizontalPadding:!0,children:o("duration")}),(n==null?void 0:n.settings.allow_billable_task_items)&&e.jsx(M,{className:"pl-16 pr-3",withoutHorizontalPadding:!0,children:o("billable")}),e.jsx(M,{withoutHorizontalPadding:!0})]}),e.jsxs(le,{children:[s.time_log&&JSON.parse(s.time_log).map(([l,d,x,_],b)=>e.jsxs(e.Fragment,{children:[e.jsxs(R,{className:"border-b",style:{borderColor:i.$20},children:[e.jsx(w,{className:"pl-3 py-3",withoutPadding:!0,children:e.jsx(N,{style:{color:i.$3,colorScheme:i.$0},type:"date",value:y(l),onValueChange:g=>S(l,P(g)?g:y(l)||"",b,0)},`${f().unix().toString()}StartDate`)}),e.jsx(w,{className:"pl-3 py-3",withoutPadding:!0,children:e.jsx(N,{style:{color:i.$3,colorScheme:i.$0},type:"time",step:"1",value:v(l),onValueChange:g=>k(l,h(g)?g:v(l)||"",0,b)},`${f().unix().toString()}StartTime`)}),(n==null?void 0:n.show_task_end_date)&&e.jsx(w,{className:"pl-3 py-3",withoutPadding:!0,children:e.jsx(N,{style:{color:i.$3,colorScheme:i.$0},type:"date",value:y(d),onValueChange:g=>S(d,g?P(g)?g:y(d)||"":y(d)||y(l)||"",b,1)},`${f().unix().toString()}EndDate`)}),e.jsx(w,{className:"pl-3 py-3",withoutPadding:!0,children:e.jsx(N,{style:{color:i.$3,colorScheme:i.$0},type:"time",step:"1",value:v(d),onValueChange:g=>k(d,g?h(g)?g:v(d)||"":v(d)||v(l)||"",1,b)},`${f().unix().toString()}EndTime`)}),e.jsx(w,{className:"pl-3 py-3",withoutPadding:!0,children:d!==0||s.created_at===0?e.jsx(N,{debounceTimeout:1e3,value:Se(l,d,n==null?void 0:n.show_task_end_date),onValueChange:g=>D(g,l,b)}):e.jsx(He,{start:l,task:s},`duration-clock-${b}`)}),(n==null?void 0:n.settings.allow_billable_task_items)&&e.jsx(w,{className:"pl-16 py-3",withoutPadding:!0,children:e.jsx(ce,{style:{color:i.$3,colorScheme:i.$0},checked:_||typeof _>"u",onValueChange:(g,ae)=>B(ae||!1,b,3)})}),e.jsx(w,{rowSpan:n!=null&&n.settings.show_task_item_description?2:1,children:e.jsx("div",{className:"cursor-pointer",onClick:()=>$(b),children:e.jsx(de,{color:i.$3,hoverColor:i.$3,borderColor:i.$5,hoverBorderColor:i.$17,size:"1.6rem"})})})]}),(n==null?void 0:n.settings.show_task_item_description)&&e.jsx(R,{children:e.jsx(w,{colSpan:ne(),children:e.jsx(N,{element:"textarea",textareaRows:2,value:x,onValueChange:g=>H(g,b,2)})})})]})),e.jsx(R,{children:e.jsx(w,{colSpan:100,className:"p-1",withoutPadding:!0,children:e.jsx(Pe,{className:se("w-full py-4 inline-flex justify-center items-center space-x-2 rounded-[0.1875rem]",{"cursor-not-allowed":j(s)&&s.created_at!==0,"cursor-pointer":!j(s)||s.created_at===0}),onClick:()=>{j(s)&&s.created_at!==0||(s.created_at?t(s):C())},theme:{backgroundColor:i.$1,hoverBackgroundColor:i.$20},children:j(s)&&s.created_at!==0?e.jsx("span",{children:o("stop_task_to_add_task_entry")}):e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{children:e.jsx(ue,{size:"1.15rem",color:i.$17})}),e.jsx("span",{className:"font-medium",children:o("add_item")})]})})})})]})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function X({size:a="1.2rem",color:s="#000",filledColor:r="#000"}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{height:a,width:a},viewBox:"0 0 18 18",children:[e.jsx("path",{d:"M5.245 2.878L14.737 8.134C15.422 8.513 15.422 9.487 14.737 9.866L5.245 15.122C4.576 15.493 3.75 15.014 3.75 14.256V3.744C3.75 2.986 4.575 2.507 5.245 2.878Z",fill:r,"data-color":"color-2","data-stroke":"none"}),e.jsx("path",{d:"M5.245 2.878L14.737 8.134C15.422 8.513 15.422 9.487 14.737 9.866L5.245 15.122C4.576 15.493 3.75 15.014 3.75 14.256V3.744C3.75 2.986 4.575 2.507 5.245 2.878Z",stroke:s,strokeWidth:"1.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"})]})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function q({size:a="1.2rem",color:s="#000",filledColor:r="#000"}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{height:a,width:a},viewBox:"0 0 18 18",children:[e.jsx("path",{d:"M5.25 2.75H3.75C3.19772 2.75 2.75 3.19772 2.75 3.75V14.25C2.75 14.8023 3.19772 15.25 3.75 15.25H5.25C5.80228 15.25 6.25 14.8023 6.25 14.25V3.75C6.25 3.19772 5.80228 2.75 5.25 2.75Z",fill:r,"data-color":"color-2","data-stroke":"none"}),e.jsx("path",{d:"M14.25 2.75H12.75C12.1977 2.75 11.75 3.19772 11.75 3.75V14.25C11.75 14.8023 12.1977 15.25 12.75 15.25H14.25C14.8023 15.25 15.25 14.8023 15.25 14.25V3.75C15.25 3.19772 14.8023 2.75 14.25 2.75Z",fill:r,"data-color":"color-2","data-stroke":"none"}),e.jsx("path",{d:"M5.25 2.75H3.75C3.19772 2.75 2.75 3.19772 2.75 3.75V14.25C2.75 14.8023 3.19772 15.25 3.75 15.25H5.25C5.80228 15.25 6.25 14.8023 6.25 14.25V3.75C6.25 3.19772 5.80228 2.75 5.25 2.75Z",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("path",{d:"M14.25 2.75H12.75C12.1977 2.75 11.75 3.19772 11.75 3.75V14.25C11.75 14.8023 12.1977 15.25 12.75 15.25H14.25C14.8023 15.25 15.25 14.8023 15.25 14.25V3.75C15.25 3.19772 14.8023 2.75 14.25 2.75Z",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}f.extend(we);function ze(a){var S,D,H,B;const[s]=K(),r=ee(),o=U(),i=Q(),{task:t,handleChange:n,errors:c,page:m}=a,u=I(),p=$e.useMediaQuery({query:"(min-width: 768px)"}),C=G(),$=te(),k=me(t.time_log,{inSeconds:!0,calculateLastTimeLog:!1});return e.jsx(xe,{title:e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("span",{children:s("task")}),t&&m==="edit"&&p&&e.jsx(J,{entity:t,withoutDropdown:!0})]}),className:"shadow-sm",topRight:t&&m==="edit"&&p&&e.jsxs("div",{className:"flex items-center space-x-5",children:[j(t)&&e.jsx(Z,{task:t}),!j(t)&&k&&e.jsx("span",{className:"text-sm font-mono",style:{color:r.$17},children:A(Number(k))}),!j(t)&&!t.invoice_id&&e.jsx(Y,{behavior:"button",onClick:()=>$(t),disableWithoutIcon:!0,disabled:!o("edit_task")&&!i(t),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{size:"1.1rem",color:r.$1,filledColor:r.$1}),e.jsx("span",{style:{color:r.$1},children:s("start")})]})}),j(t)&&!t.invoice_id&&e.jsx(Y,{behavior:"button",onClick:()=>C(t),disabled:!o("edit_task")&&!i(t),disableWithoutIcon:!0,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{color:r.$1,filledColor:r.$1,size:"1.1rem"}),e.jsx("span",{style:{color:r.$1},children:s("stop")})]})})]}),style:{borderColor:r.$24},headerClassName:se("px-6",{"py-2":m==="edit","py-4":m!=="edit"||!p}),headerStyle:{borderColor:r.$20},withoutHeaderPadding:!0,children:e.jsxs("div",{className:"flex flex-col space-y-4 items-center justify-start w-full px-6 pb-8 pt-2",children:[t&&m==="edit"&&!p&&e.jsxs("div",{className:"flex justify-between items-center space-x-2 w-full",children:[e.jsx(J,{entity:t,withoutDropdown:!0}),e.jsxs("div",{className:"flex items-center space-x-2",children:[j(t)&&e.jsx(Z,{task:t}),!j(t)&&k&&e.jsx("span",{className:"text-sm font-mono",style:{color:r.$17},children:A(Number(k))}),!j(t)&&!t.invoice_id&&e.jsx(Y,{behavior:"button",onClick:()=>$(t),disableWithoutIcon:!0,disabled:!o("edit_task")&&!i(t),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{size:"1.1rem",color:r.$1,filledColor:r.$1}),e.jsx("span",{style:{color:r.$1},children:s("start")})]})}),j(t)&&!t.invoice_id&&e.jsx(Y,{behavior:"button",onClick:()=>C(t),disabled:!o("edit_task")&&!i(t),disableWithoutIcon:!0,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{color:r.$1,filledColor:r.$1,size:"1.1rem"}),e.jsx("span",{style:{color:r.$1},children:s("stop")})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full lg:w-3/5 place-items-center",children:[e.jsxs("div",{className:"flex flex-col space-y-2 w-full",children:[e.jsx(fe,{inputLabel:s("client"),value:t.client_id,onChange:h=>{var P;n("client_id",h.id),t.id||n("rate",((P=h==null?void 0:h.settings)==null?void 0:P.default_task_rate)??0)},clearButton:!!t.client_id,onClearButtonClick:()=>n("client_id",""),readonly:!!t.project_id,errorMessage:c==null?void 0:c.errors.client_id}),t.client_id&&e.jsx(ye,{clientId:t.client_id})]}),e.jsxs("div",{className:"flex self-start items-center justify-center w-full",children:[e.jsx("div",{className:"flex flex-1 item-center gap-2",style:{color:r.$3,colorScheme:r.$0},children:e.jsx(ge,{value:t.project_id,inputLabel:s("project"),onChange:h=>{n("project_id",h.id),n("client_id",h.client_id),n("rate",h.task_rate)},clientId:t.client_id,clearButton:!!t.project_id,onClearButtonClick:()=>{n("project_id",""),n("client_id","")},errorMessage:c==null?void 0:c.errors.project_id})}),(t==null?void 0:t.project_id)&&e.jsx("div",{className:"flex item-center gap-2 pl-2 mt-6",style:{color:r.$3,colorScheme:r.$0},children:e.jsx(pe,{to:_e("/projects/:id",{id:t.project_id}),children:e.jsx(je,{element:Ce,size:18})})})]}),e.jsx(ve,{inputLabel:s("assigned_user"),value:t==null?void 0:t.assigned_user_id,onChange:h=>n("assigned_user_id",h.id),onClearButtonClick:()=>n("assigned_user_id",""),errorMessage:c==null?void 0:c.errors.assigned_user_id,readonly:!o("edit_task")}),e.jsx(N,{label:s("task_number"),value:t.number,onValueChange:h=>n("number",h),errorMessage:c==null?void 0:c.errors.number,width:"100%"}),e.jsx(ke,{label:s("rate"),value:t.rate||"",onValueChange:h=>n("rate",parseFloat(h)),errorMessage:c==null?void 0:c.errors.rate,width:"100%"}),e.jsx(be,{inputLabel:s("status"),value:t.status_id,onChange:h=>h&&n("status_id",h.id),onClearButtonClick:()=>n("status_id",""),readonly:a.taskModal,errorMessage:c==null?void 0:c.errors.status_id}),t&&((S=u==null?void 0:u.custom_fields)==null?void 0:S.task1)&&e.jsx(z,{field:"task1",defaultValue:t.custom_value1||"",value:u.custom_fields.task1,onValueChange:h=>n("custom_value1",h)}),t&&((D=u==null?void 0:u.custom_fields)==null?void 0:D.task2)&&e.jsx(z,{field:"task2",defaultValue:t.custom_value2||"",value:u.custom_fields.task2,onValueChange:h=>n("custom_value2",h)}),t&&((H=u==null?void 0:u.custom_fields)==null?void 0:H.task3)&&e.jsx(z,{field:"task3",defaultValue:t.custom_value3||"",value:u.custom_fields.task3,onValueChange:h=>n("custom_value3",h)}),t&&((B=u==null?void 0:u.custom_fields)==null?void 0:B.task4)&&e.jsx(z,{field:"task4",defaultValue:t.custom_value4||"",value:u.custom_fields.task4,onValueChange:h=>n("custom_value4",h)})]}),e.jsx("div",{className:"w-full lg:w-3/5",children:e.jsx(N,{label:s("description"),element:"textarea",value:t.description,onValueChange:h=>n("description",h),errorMessage:c==null?void 0:c.errors.description,width:"100%"})})]})})}export{E as L,X as M,ze as T,Ve as a,v as b,Ye as c,Se as d,q as e,De as h,y as p,Me as u};
Copyright ©2021 || Defacer Indonesia