{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x.localeCompare(p):p.localeCompare(x)}}getSortFieldName(){return this.sortBy||this.key}}const ne={props:{pagination:{type:Object,default:()=>({})}},computed:{pages(){return this.pagination.totalPages===void 0?[]:this.pageLinks()},hasFirst(){return this.pagination.currentPage>=4||this.pagination.totalPages<10},hasLast(){return this.pagination.currentPage<=this.pagination.totalPages-3||this.pagination.totalPages<10},hasFirstEllipsis(){return this.pagination.currentPage>=4&&this.pagination.totalPages>=10},hasLastEllipsis(){return this.pagination.currentPage<=this.pagination.totalPages-3&&this.pagination.totalPages>=10},shouldShowPagination(){return this.pagination.totalPages===void 0||this.pagination.count===0?!1:this.pagination.totalPages>1}},methods:{isActive(a){return(this.pagination.currentPage||1)===a},pageClicked(a){a==="..."||a===this.pagination.currentPage||a>this.pagination.totalPages||a<1||this.$emit("pageChange",a)},pageLinks(){const a=[];let t=2,e=this.pagination.totalPages-1;this.pagination.totalPages>=10&&(t=Math.max(1,this.pagination.currentPage-2),e=Math.min(this.pagination.currentPage+2,this.pagination.totalPages));for(let n=t;n<=e;n++)a.push(n);return a}}},re={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 sm:px-6"},ie={class:"flex justify-between flex-1 sm:hidden"},se={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},le={class:"text-sm text-gray-700"},oe=_(" Showing "+h(" ")+" "),de={key:0,class:"font-medium"},ge=_(" "+h(" ")+" to "+h(" ")+" "),ce={key:1,class:"font-medium"},ue={key:0},he={key:1},ye=_(" "+h(" ")+" of "+h(" ")+" "),fe={key:2,class:"font-medium"},me=_(" "+h(" ")+" results "),pe={class:"relative z-0 inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},be=c("span",{class:"sr-only"},"Previous",-1),xe={key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},ve=["onClick"],ke={key:2,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},Ce=c("span",{class:"sr-only"},"Next",-1);function Pe(a,t,e,n,b,l){const g=T("BaseIcon");return l.shouldShowPagination?(i(),s("div",re,[c("div",ie,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[0]||(t[0]=d=>l.pageClicked(e.pagination.currentPage-1))}," Previous ",2),c("a",{href:"#",class:u([{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages},"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[1]||(t[1]=d=>l.pageClicked(e.pagination.currentPage+1))}," Next ",2)]),c("div",se,[c("div",null,[c("p",le,[oe,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",de,h(e.pagination.currentPage*e.pagination.limit-(e.pagination.limit-1)),1)):m("",!0),ge,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",ce,[e.pagination.currentPage*e.pagination.limit<=e.pagination.totalCount?(i(),s("span",ue,h(e.pagination.currentPage*e.pagination.limit),1)):(i(),s("span",he,h(e.pagination.totalCount),1))])):m("",!0),ye,e.pagination.totalCount?(i(),s("span",fe,h(e.pagination.totalCount),1)):m("",!0),me])]),c("div",null,[c("nav",pe,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"]),onClick:t[2]||(t[2]=d=>l.pageClicked(e.pagination.currentPage-1))},[be,k(g,{name:"ChevronLeftIcon"})],2),l.hasFirst?(i(),s("a",{key:0,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(1),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(1)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[3]||(t[3]=d=>l.pageClicked(1))}," 1 ",2)):m("",!0),l.hasFirstEllipsis?(i(),s("span",xe," ... ")):m("",!0),(i(!0),s(C,null,P(l.pages,d=>(i(),s("a",{key:d,href:"#",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(d),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(d),disabled:d==="..."},"relative items-center hidden px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 md:inline-flex"]),onClick:p=>l.pageClicked(d)},h(d),11,ve))),128)),l.hasLastEllipsis?(i(),s("span",ke," ... ")):m("",!0),l.hasLast?(i(),s("a",{key:3,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(e.pagination.totalPages),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(e.pagination.totalPages)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[4]||(t[4]=d=>l.pageClicked(e.pagination.totalPages))},h(e.pagination.totalPages),3)):m("",!0),c("a",{href:"#",class:u(["relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50",{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages}]),onClick:t[5]||(t[5]=d=>l.pageClicked(e.pagination.currentPage+1))},[Ce,k(g,{name:"ChevronRightIcon"})],2)])])])])):m("",!0)}var _e=Z(ne,[["render",Pe]]);const we={class:"flex flex-col"},Se={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 pb-4 lg:pb-0"},Te={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},Ne={class:"relative overflow-hidden bg-white border-b border-gray-200 shadow sm:rounded-lg"},Be=["onClick"],Fe={key:0,class:"asc-direction"},Ae={key:1,class:"desc-direction"},Le={key:0},Ve={key:1},De={key:0,class:"absolute top-0 left-0 z-10 flex items-center justify-center w-full h-full bg-white bg-opacity-60"},Ie={key:1,class:"text-center text-gray-500 pb-2 flex h-[160px] justify-center items-center flex-col"},Me={class:"block mt-1"},Re={props:{columns:{type:Array,required:!0},data:{type:[Array,Function],required:!0},sortBy:{type:String,default:""},sortOrder:{type:String,default:""},tableClass:{type:String,default:"min-w-full divide-y divide-gray-200"},theadClass:{type:String,default:"bg-gray-50"},tbodyClass:{type:String,default:""},noResultsMessage:{type:String,default:"No Results Found"},loading:{type:Boolean,default:!1},loadingType:{type:String,default:"placeholder",validator:function(a){return["placeholder","spinner"].indexOf(a)!==-1}},placeholderCount:{type:Number,default:3}},setup(a,{expose:t}){const e=a;let n=N([]),b=F(!1),l=N(e.columns.map(r=>new ae(r))),g=N({fieldName:"",order:""}),d=F("");const p=A(()=>Array.isArray(e.data)),x=A(()=>{if(!p.value||g.fieldName===""||l.length===0)return n.value;const r=D(g.fieldName);return r?[...n.value].sort(r.getSortPredicate(g.order,l)):n.value});function D(r){return l.find(o=>o.key===r)}function I(r){let o="whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";return r.defaultThClass&&(o=r.defaultThClass),r.sortable?o=`${o} cursor-pointer`:o=`${o} pointer-events-none`,r.thClass&&(o=`${o} ${r.thClass}`),o}function B(r){let o="px-6 py-4 text-sm text-gray-500 whitespace-nowrap";return r.defaultTdClass&&(o=r.defaultTdClass),r.tdClass&&(o=`${o} ${r.tdClass}`),o}function M(r){let o="w-full";return r.placeholderClass&&(o=`${o} ${r.placeholderClass}`),o}function z(){return d.value=null,e.data}async function E(){const r=d.value&&d.value.currentPage||1;b.value=!0;const o=await e.data({sort:g,page:r});return b.value=!1,d.value=o.pagination,o.data}function R(r){g.fieldName!==r.key?(g.fieldName=r.key,g.order="asc"):g.order=g.order==="asc"?"desc":"asc",p.value||w()}async function w(){const r=p.value?z():await E();n.value=r.map(o=>new te(o,l))}async function j(r){d.value.currentPage=r,await w()}async function H(){await w()}function Y(r,o){return U.exports.get(r,o)}return p.value&&J(()=>e.data,()=>{w()}),K(async()=>{await w()}),t({refresh:H}),(r,o)=>{const W=T("base-content-placeholders-text"),q=T("base-content-placeholders"),G=T("BaseIcon");return i(),s("div",we,[c("div",Se,[c("div",Te,[c("div",Ne,[L(r.$slots,"header"),c("table",{class:u(a.tableClass)},[c("thead",{class:u(a.theadClass)},[c("tr",null,[(i(!0),s(C,null,P(y(l),f=>(i(),s("th",{key:f.key,class:u([I(f),{"text-bold text-black":y(g).fieldName===f.key}]),onClick:v=>R(f)},[_(h(f.label)+" ",1),y(g).fieldName===f.key&&y(g).order==="asc"?(i(),s("span",Fe," \u2191 ")):m("",!0),y(g).fieldName===f.key&&y(g).order==="desc"?(i(),s("span",Ae," \u2193 ")):m("",!0)],10,Be))),128))])],2),a.loadingType==="placeholder"&&(a.loading||y(b))?(i(),s("tbody",Le,[(i(!0),s(C,null,P(a.placeholderCount,f=>(i(),s("tr",{key:f,class:u(f%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,v=>(i(),s("td",{key:v.key,class:u(["",B(v)])},[k(q,{class:u(M(v)),rounded:!0},{default:Q(()=>[k(W,{class:"w-full h-6",lines:1})]),_:2},1032,["class"])],2))),128))],2))),128))])):(i(),s("tbody",Ve,[(i(!0),s(C,null,P(y(x),(f,v)=>(i(),s("tr",{key:v,class:u(v%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,S=>(i(),s("td",{key:S.key,class:u(["",B(S)])},[L(r.$slots,"cell-"+S.key,{row:f},()=>[_(h(Y(f.data,S.key)),1)])],2))),128))],2))),128))]))],2),a.loadingType==="spinner"&&(a.loading||y(b))?(i(),s("div",De,[k($,{class:"w-10 h-10 text-primary-500"})])):!a.loading&&!y(b)&&y(x)&&y(x).length===0?(i(),s("div",Ie,[k(G,{name:"ExclamationCircleIcon",class:"w-6 h-6 text-gray-400"}),c("span",Me,h(a.noResultsMessage),1)])):m("",!0),y(d)?(i(),X(_e,{key:2,pagination:y(d),onPageChange:j},null,8,["pagination"])):m("",!0)])])])])}}};export{Re as default}; +import{h as O,r as T,o as i,c as s,t as c,z as u,x as h,A as m,b as k,F as C,H as P,v as _,j as N,i as F,k as A,D as J,M as K,W as L,y,w as Q,l as U,s as X}from"./vendor.e9042f2c.js";import{_ as Z,S as $}from"./main.366b2ac6.js";function V(a,t){if(!t||a===null||typeof a!="object")return a;const[e,n]=t.split(/\.(.+)/);return V(a[e],n)}function ee(a,t){return t.reduce((e,n)=>(e[n]=a[n],e),{})}class te{constructor(t,e){this.data=t,this.columns=e}getValue(t){return V(this.data,t)}getColumn(t){return this.columns.find(e=>e.key===t)}getSortableValue(t){const e=this.getColumn(t).dataType;let n=this.getValue(t);if(n==null)return"";if(n instanceof String&&(n=n.toLowerCase()),e.startsWith("date")){const b=e.replace("date:","");return O(n,b).format("YYYYMMDDHHmmss")}return e==="numeric"?n:n.toString()}}class ae{constructor(t){const e=ee(t,["key","label","thClass","tdClass","sortBy","sortable","hidden","dataType"]);for(const n in e)this[n]=t[n];e.dataType||(this.dataType="string"),e.sortable===void 0&&(this.sortable=!0)}getFilterFieldName(){return this.filterOn||this.key}isSortable(){return this.sortable}getSortPredicate(t,e){const n=this.getSortFieldName(),l=e.find(g=>g.key===n).dataType;return l.startsWith("date")||l==="numeric"?(g,d)=>{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x
{const p=g.getSortableValue(n),x=d.getSortableValue(n);return t==="desc"?x.localeCompare(p):p.localeCompare(x)}}getSortFieldName(){return this.sortBy||this.key}}const ne={props:{pagination:{type:Object,default:()=>({})}},computed:{pages(){return this.pagination.totalPages===void 0?[]:this.pageLinks()},hasFirst(){return this.pagination.currentPage>=4||this.pagination.totalPages<10},hasLast(){return this.pagination.currentPage<=this.pagination.totalPages-3||this.pagination.totalPages<10},hasFirstEllipsis(){return this.pagination.currentPage>=4&&this.pagination.totalPages>=10},hasLastEllipsis(){return this.pagination.currentPage<=this.pagination.totalPages-3&&this.pagination.totalPages>=10},shouldShowPagination(){return this.pagination.totalPages===void 0||this.pagination.count===0?!1:this.pagination.totalPages>1}},methods:{isActive(a){return(this.pagination.currentPage||1)===a},pageClicked(a){a==="..."||a===this.pagination.currentPage||a>this.pagination.totalPages||a<1||this.$emit("pageChange",a)},pageLinks(){const a=[];let t=2,e=this.pagination.totalPages-1;this.pagination.totalPages>=10&&(t=Math.max(1,this.pagination.currentPage-2),e=Math.min(this.pagination.currentPage+2,this.pagination.totalPages));for(let n=t;n<=e;n++)a.push(n);return a}}},re={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-t border-gray-200 sm:px-6"},ie={class:"flex justify-between flex-1 sm:hidden"},se={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},le={class:"text-sm text-gray-700"},oe=_(" Showing "+h(" ")+" "),de={key:0,class:"font-medium"},ge=_(" "+h(" ")+" to "+h(" ")+" "),ce={key:1,class:"font-medium"},ue={key:0},he={key:1},ye=_(" "+h(" ")+" of "+h(" ")+" "),fe={key:2,class:"font-medium"},me=_(" "+h(" ")+" results "),pe={class:"relative z-0 inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination"},be=c("span",{class:"sr-only"},"Previous",-1),xe={key:1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},ve=["onClick"],ke={key:2,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"},Ce=c("span",{class:"sr-only"},"Next",-1);function Pe(a,t,e,n,b,l){const g=T("BaseIcon");return l.shouldShowPagination?(i(),s("div",re,[c("div",ie,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[0]||(t[0]=d=>l.pageClicked(e.pagination.currentPage-1))}," Previous ",2),c("a",{href:"#",class:u([{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages},"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"]),onClick:t[1]||(t[1]=d=>l.pageClicked(e.pagination.currentPage+1))}," Next ",2)]),c("div",se,[c("div",null,[c("p",le,[oe,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",de,h(e.pagination.currentPage*e.pagination.limit-(e.pagination.limit-1)),1)):m("",!0),ge,e.pagination.limit&&e.pagination.currentPage?(i(),s("span",ce,[e.pagination.currentPage*e.pagination.limit<=e.pagination.totalCount?(i(),s("span",ue,h(e.pagination.currentPage*e.pagination.limit),1)):(i(),s("span",he,h(e.pagination.totalCount),1))])):m("",!0),ye,e.pagination.totalCount?(i(),s("span",fe,h(e.pagination.totalCount),1)):m("",!0),me])]),c("div",null,[c("nav",pe,[c("a",{href:"#",class:u([{"disabled cursor-normal pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===1},"relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"]),onClick:t[2]||(t[2]=d=>l.pageClicked(e.pagination.currentPage-1))},[be,k(g,{name:"ChevronLeftIcon"})],2),l.hasFirst?(i(),s("a",{key:0,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(1),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(1)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[3]||(t[3]=d=>l.pageClicked(1))}," 1 ",2)):m("",!0),l.hasFirstEllipsis?(i(),s("span",xe," ... ")):m("",!0),(i(!0),s(C,null,P(l.pages,d=>(i(),s("a",{key:d,href:"#",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(d),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(d),disabled:d==="..."},"relative items-center hidden px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 hover:bg-gray-50 md:inline-flex"]),onClick:p=>l.pageClicked(d)},h(d),11,ve))),128)),l.hasLastEllipsis?(i(),s("span",ke," ... ")):m("",!0),l.hasLast?(i(),s("a",{key:3,href:"#","aria-current":"page",class:u([{"z-10 bg-primary-50 border-primary-500 text-primary-600":l.isActive(e.pagination.totalPages),"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":!l.isActive(e.pagination.totalPages)},"relative inline-flex items-center px-4 py-2 text-sm font-medium border"]),onClick:t[4]||(t[4]=d=>l.pageClicked(e.pagination.totalPages))},h(e.pagination.totalPages),3)):m("",!0),c("a",{href:"#",class:u(["relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50",{"disabled cursor-default pointer-events-none !bg-gray-100 !text-gray-400":e.pagination.currentPage===e.pagination.totalPages}]),onClick:t[5]||(t[5]=d=>l.pageClicked(e.pagination.currentPage+1))},[Ce,k(g,{name:"ChevronRightIcon"})],2)])])])])):m("",!0)}var _e=Z(ne,[["render",Pe]]);const we={class:"flex flex-col"},Se={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 pb-4 lg:pb-0"},Te={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},Ne={class:"relative overflow-hidden bg-white border-b border-gray-200 shadow sm:rounded-lg"},Be=["onClick"],Fe={key:0,class:"asc-direction"},Ae={key:1,class:"desc-direction"},Le={key:0},Ve={key:1},De={key:0,class:"absolute top-0 left-0 z-10 flex items-center justify-center w-full h-full bg-white bg-opacity-60"},Ie={key:1,class:"text-center text-gray-500 pb-2 flex h-[160px] justify-center items-center flex-col"},Me={class:"block mt-1"},Re={props:{columns:{type:Array,required:!0},data:{type:[Array,Function],required:!0},sortBy:{type:String,default:""},sortOrder:{type:String,default:""},tableClass:{type:String,default:"min-w-full divide-y divide-gray-200"},theadClass:{type:String,default:"bg-gray-50"},tbodyClass:{type:String,default:""},noResultsMessage:{type:String,default:"No Results Found"},loading:{type:Boolean,default:!1},loadingType:{type:String,default:"placeholder",validator:function(a){return["placeholder","spinner"].indexOf(a)!==-1}},placeholderCount:{type:Number,default:3}},setup(a,{expose:t}){const e=a;let n=N([]),b=F(!1),l=N(e.columns.map(r=>new ae(r))),g=N({fieldName:"",order:""}),d=F("");const p=A(()=>Array.isArray(e.data)),x=A(()=>{if(!p.value||g.fieldName===""||l.length===0)return n.value;const r=D(g.fieldName);return r?[...n.value].sort(r.getSortPredicate(g.order,l)):n.value});function D(r){return l.find(o=>o.key===r)}function I(r){let o="whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";return r.defaultThClass&&(o=r.defaultThClass),r.sortable?o=`${o} cursor-pointer`:o=`${o} pointer-events-none`,r.thClass&&(o=`${o} ${r.thClass}`),o}function B(r){let o="px-6 py-4 text-sm text-gray-500 whitespace-nowrap";return r.defaultTdClass&&(o=r.defaultTdClass),r.tdClass&&(o=`${o} ${r.tdClass}`),o}function M(r){let o="w-full";return r.placeholderClass&&(o=`${o} ${r.placeholderClass}`),o}function z(){return d.value=null,e.data}async function E(){const r=d.value&&d.value.currentPage||1;b.value=!0;const o=await e.data({sort:g,page:r});return b.value=!1,d.value=o.pagination,o.data}function R(r){g.fieldName!==r.key?(g.fieldName=r.key,g.order="asc"):g.order=g.order==="asc"?"desc":"asc",p.value||w()}async function w(){const r=p.value?z():await E();n.value=r.map(o=>new te(o,l))}async function j(r){d.value.currentPage=r,await w()}async function H(){await w()}function Y(r,o){return U.exports.get(r,o)}return p.value&&J(()=>e.data,()=>{w()}),K(async()=>{await w()}),t({refresh:H}),(r,o)=>{const W=T("base-content-placeholders-text"),q=T("base-content-placeholders"),G=T("BaseIcon");return i(),s("div",we,[c("div",Se,[c("div",Te,[c("div",Ne,[L(r.$slots,"header"),c("table",{class:u(a.tableClass)},[c("thead",{class:u(a.theadClass)},[c("tr",null,[(i(!0),s(C,null,P(y(l),f=>(i(),s("th",{key:f.key,class:u([I(f),{"text-bold text-black":y(g).fieldName===f.key}]),onClick:v=>R(f)},[_(h(f.label)+" ",1),y(g).fieldName===f.key&&y(g).order==="asc"?(i(),s("span",Fe," \u2191 ")):m("",!0),y(g).fieldName===f.key&&y(g).order==="desc"?(i(),s("span",Ae," \u2193 ")):m("",!0)],10,Be))),128))])],2),a.loadingType==="placeholder"&&(a.loading||y(b))?(i(),s("tbody",Le,[(i(!0),s(C,null,P(a.placeholderCount,f=>(i(),s("tr",{key:f,class:u(f%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,v=>(i(),s("td",{key:v.key,class:u(["",B(v)])},[k(q,{class:u(M(v)),rounded:!0},{default:Q(()=>[k(W,{class:"w-full h-6",lines:1})]),_:2},1032,["class"])],2))),128))],2))),128))])):(i(),s("tbody",Ve,[(i(!0),s(C,null,P(y(x),(f,v)=>(i(),s("tr",{key:v,class:u(v%2==0?"bg-white":"bg-gray-50")},[(i(!0),s(C,null,P(a.columns,S=>(i(),s("td",{key:S.key,class:u(["",B(S)])},[L(r.$slots,"cell-"+S.key,{row:f},()=>[_(h(Y(f.data,S.key)),1)])],2))),128))],2))),128))]))],2),a.loadingType==="spinner"&&(a.loading||y(b))?(i(),s("div",De,[k($,{class:"w-10 h-10 text-primary-500"})])):!a.loading&&!y(b)&&y(x)&&y(x).length===0?(i(),s("div",Ie,[k(G,{name:"ExclamationCircleIcon",class:"w-6 h-6 text-gray-400"}),c("span",Me,h(a.noResultsMessage),1)])):m("",!0),y(d)?(i(),X(_e,{key:2,pagination:y(d),onPageChange:j},null,8,["pagination"])):m("",!0)])])])])}}};export{Re as default};
diff --git a/public/build/assets/CategoryModal.5ab2db2b.js b/public/build/assets/CategoryModal.5546afa0.js
similarity index 97%
rename from public/build/assets/CategoryModal.5ab2db2b.js
rename to public/build/assets/CategoryModal.5546afa0.js
index 1843e04e0..8d405bdc4 100644
--- a/public/build/assets/CategoryModal.5ab2db2b.js
+++ b/public/build/assets/CategoryModal.5546afa0.js
@@ -1 +1 @@
-import{g as k,i as q,k as g,m as y,n as N,p as j,a4 as D,q as G,r as i,o as B,s as b,w as r,t as m,v,x as C,y as e,b as n,z as L,A as T,B as z}from"./vendor.e9042f2c.js";import{s as A,g as E}from"./main.109918ee.js";const U={class:"flex justify-between w-full"},X=["onSubmit"],F={class:"p-8 sm:p-6"},H={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},P={setup(J){const t=A(),u=E(),{t:p}=k();let c=q(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),N),minLength:y.withMessage(p("validation.name_min_length",{count:3}),j(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),D(255))}}})),a=G(h,g(()=>t)),w=g(()=>u.active&&u.componentName==="CategoryModal");async function I(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const f=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),V=i("BaseTextarea"),M=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(w),onClose:d},{header:r(()=>[m("div",U,[v(C(e(u).title)+" ",1),n(f,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:z(I,["prevent"])},[m("div",F,[n(M,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(V,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",H,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[v(C(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?T("",!0):(B(),b(f,{key:0,name:"SaveIcon",class:L(l.class)},null,8,["class"]))]),default:r(()=>[v(" "+C(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,X)]),_:1},8,["show"])}}};export{P as _};
+import{g as k,i as q,k as g,m as y,n as N,p as j,a4 as D,q as G,r as i,o as B,s as b,w as r,t as m,v,x as C,y as e,b as n,z as L,A as T,B as z}from"./vendor.e9042f2c.js";import{s as A,g as E}from"./main.366b2ac6.js";const U={class:"flex justify-between w-full"},X=["onSubmit"],F={class:"p-8 sm:p-6"},H={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},P={setup(J){const t=A(),u=E(),{t:p}=k();let c=q(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),N),minLength:y.withMessage(p("validation.name_min_length",{count:3}),j(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),D(255))}}})),a=G(h,g(()=>t)),w=g(()=>u.active&&u.componentName==="CategoryModal");async function I(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const f=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),V=i("BaseTextarea"),M=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(w),onClose:d},{header:r(()=>[m("div",U,[v(C(e(u).title)+" ",1),n(f,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:z(I,["prevent"])},[m("div",F,[n(M,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(V,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",H,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[v(C(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?T("",!0):(B(),b(f,{key:0,name:"SaveIcon",class:L(l.class)},null,8,["class"]))]),default:r(()=>[v(" "+C(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,X)]),_:1},8,["show"])}}};export{P as _};
diff --git a/public/build/assets/CompanyInfoSettings.a7f406ea.js b/public/build/assets/CompanyInfoSettings.4704f827.js
similarity index 99%
rename from public/build/assets/CompanyInfoSettings.a7f406ea.js
rename to public/build/assets/CompanyInfoSettings.4704f827.js
index 18294927e..23c614086 100644
--- a/public/build/assets/CompanyInfoSettings.a7f406ea.js
+++ b/public/build/assets/CompanyInfoSettings.4704f827.js
@@ -1 +1 @@
-var te=Object.defineProperty;var A=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var L=(f,s,d)=>s in f?te(f,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[s]=d,T=(f,s)=>{for(var d in s||(s={}))oe.call(s,d)&&L(f,d,s[d]);if(A)for(var d of A(s))se.call(s,d)&&L(f,d,s[d]);return f};import{C as ne,g as R,i as h,j as E,k as F,m as I,n as N,aQ as le,q as J,r as i,o as S,s as k,w as r,t as m,x as v,y as e,b as o,v as z,z as O,A as j,B as Q,am as de,p as re,c as H,a0 as ie,F as me}from"./vendor.e9042f2c.js";import{c as K,g as P,m as W}from"./main.109918ee.js";const ue={class:"flex justify-between w-full"},ce={class:"px-6 pt-6"},pe={class:"font-medium text-lg text-left"},_e={class:"mt-2 text-sm leading-snug text-gray-500",style:{"max-width":"680px"}},fe=["onSubmit"],ye={class:"p-4 sm:p-6 space-y-4"},ge={class:"z-0 flex justify-end p-4 bg-gray-50 border-modal-bg"},ve={setup(f){const s=K(),d=P(),D=W(),B=ne(),{t:M}=R();let u=h(!1);const a=E({id:s.selectedCompany.id,name:null}),b=F(()=>d.active&&d.componentName==="DeleteCompanyModal"),V={formData:{name:{required:I.withMessage(M("validation.required"),N),sameAsName:I.withMessage(M("validation.company_name_not_same"),le(s.selectedCompany.name))}}},p=J(V,{formData:a},{$scope:!1});async function U(){if(p.value.$touch(),p.value.$invalid)return!0;const g=s.companies[0];u.value=!0;try{const y=await s.deleteCompany(a);console.log(y.data.success),y.data.success&&(C(),await s.setSelectedCompany(g),B.push("/admin/dashboard"),await D.setIsAppLoaded(!1),await D.bootstrap()),u.value=!1}catch{u.value=!1}}function _(){a.id=null,a.name="",p.value.$reset()}function C(){d.closeModal(),setTimeout(()=>{_(),p.value.$reset()},300)}return(g,y)=>{const q=i("BaseInput"),l=i("BaseInputGroup"),t=i("BaseButton"),x=i("BaseIcon"),c=i("BaseModal");return S(),k(c,{show:e(b),onClose:C},{default:r(()=>[m("div",ue,[m("div",ce,[m("h6",pe,v(e(d).title),1),m("p",_e,v(g.$t("settings.company_info.delete_company_modal_desc",{company:e(s).selectedCompany.name})),1)])]),m("form",{action:"",onSubmit:Q(U,["prevent"])},[m("div",ye,[o(l,{label:g.$t("settings.company_info.delete_company_modal_label",{company:e(s).selectedCompany.name}),error:e(p).formData.name.$error&&e(p).formData.name.$errors[0].$message,required:""},{default:r(()=>[o(q,{modelValue:e(a).name,"onUpdate:modelValue":y[0]||(y[0]=$=>e(a).name=$),invalid:e(p).formData.name.$error,onInput:y[1]||(y[1]=$=>e(p).formData.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),m("div",ge,[o(t,{class:"mr-3 text-sm",variant:"primary-outline",outline:"",type:"button",onClick:C},{default:r(()=>[z(v(g.$t("general.cancel")),1)]),_:1}),o(t,{loading:e(u),disabled:e(u),variant:"danger",type:"submit"},{left:r($=>[e(u)?j("",!0):(S(),k(x,{key:0,name:"TrashIcon",class:O($.class)},null,8,["class"]))]),default:r(()=>[z(" "+v(g.$t("general.delete")),1)]),_:1},8,["loading","disabled"])])],40,fe)]),_:1},8,["show"])}}},be=["onSubmit"],$e={key:0,class:"py-5"},Be={class:"text-lg leading-6 font-medium text-gray-900"},Ve={class:"mt-2 max-w-xl text-sm text-gray-500"},Ce={class:"mt-5"},Se={setup(f){const s=K(),d=W(),D=P(),{t:B}=R(),M=de("utils");let u=h(!1);const a=E({name:null,logo:null,address:{address_street_1:"",address_street_2:"",website:"",country_id:null,state:"",city:"",phone:"",zip:""}});M.mergeSettings(a,T({},s.selectedCompany));let b=h([]),V=h(null),p=h(null);a.logo&&b.value.push({image:a.logo});const U=F(()=>({name:{required:I.withMessage(B("validation.required"),N),minLength:I.withMessage(B("validation.name_min_length"),re(3))},address:{country_id:{required:I.withMessage(B("validation.required"),N)}}})),_=J(U,F(()=>a));d.fetchCountries();function C(l,t,x,c){p.value=c.name,V.value=t}function g(){V.value=null}async function y(){if(_.value.$touch(),_.value.$invalid)return!0;if(u.value=!0,(await s.updateCompany(a)).data.data){if(V.value){let t=new FormData;t.append("company_logo",JSON.stringify({name:p.value,data:V.value})),await s.updateCompanyLogo(t)}u.value=!1}u.value=!1}function q(l){D.openModal({title:B("settings.company_info.are_you_absolutely_sure"),componentName:"DeleteCompanyModal",size:"sm"})}return(l,t)=>{const x=i("BaseFileUploader"),c=i("BaseInputGroup"),$=i("BaseInputGrid"),w=i("BaseInput"),X=i("BaseMultiselect"),G=i("BaseTextarea"),Y=i("BaseIcon"),Z=i("BaseButton"),ee=i("BaseDivider"),ae=i("BaseSettingCard");return S(),H(me,null,[m("form",{onSubmit:Q(y,["prevent"])},[o(ae,{title:l.$t("settings.company_info.company_info"),description:l.$t("settings.company_info.section_description")},{default:r(()=>[o($,{class:"mt-5"},{default:r(()=>[o(c,{label:l.$tc("settings.company_info.company_logo")},{default:r(()=>[o(x,{modelValue:e(b),"onUpdate:modelValue":t[0]||(t[0]=n=>ie(b)?b.value=n:b=n),base64:"",onChange:C,onRemove:g},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o($,{class:"mt-5"},{default:r(()=>[o(c,{label:l.$tc("settings.company_info.company_name"),error:e(_).name.$error&&e(_).name.$errors[0].$message,required:""},{default:r(()=>[o(w,{modelValue:e(a).name,"onUpdate:modelValue":t[1]||(t[1]=n=>e(a).name=n),invalid:e(_).name.$error,onBlur:t[2]||(t[2]=n=>e(_).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(c,{label:l.$tc("settings.company_info.phone")},{default:r(()=>[o(w,{modelValue:e(a).address.phone,"onUpdate:modelValue":t[3]||(t[3]=n=>e(a).address.phone=n)},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.country"),error:e(_).address.country_id.$error&&e(_).address.country_id.$errors[0].$message,required:""},{default:r(()=>[o(X,{modelValue:e(a).address.country_id,"onUpdate:modelValue":t[4]||(t[4]=n=>e(a).address.country_id=n),label:"name",invalid:e(_).address.country_id.$error,options:e(d).countries,"value-prop":"id","can-deselect":!0,"can-clear":!1,searchable:"","track-by":"name"},null,8,["modelValue","invalid","options"])]),_:1},8,["label","error"]),o(c,{label:l.$tc("settings.company_info.state")},{default:r(()=>[o(w,{modelValue:e(a).address.state,"onUpdate:modelValue":t[5]||(t[5]=n=>e(a).address.state=n),name:"state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.city")},{default:r(()=>[o(w,{modelValue:e(a).address.city,"onUpdate:modelValue":t[6]||(t[6]=n=>e(a).address.city=n),type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.zip")},{default:r(()=>[o(w,{modelValue:e(a).address.zip,"onUpdate:modelValue":t[7]||(t[7]=n=>e(a).address.zip=n)},null,8,["modelValue"])]),_:1},8,["label"]),m("div",null,[o(c,{label:l.$tc("settings.company_info.address")},{default:r(()=>[o(G,{modelValue:e(a).address.address_street_1,"onUpdate:modelValue":t[8]||(t[8]=n=>e(a).address.address_street_1=n),rows:"2"},null,8,["modelValue"])]),_:1},8,["label"]),o(G,{modelValue:e(a).address.address_street_2,"onUpdate:modelValue":t[9]||(t[9]=n=>e(a).address.address_street_2=n),rows:"2",row:2,class:"mt-2"},null,8,["modelValue"])])]),_:1}),o(Z,{loading:e(u),disabled:e(u),type:"submit",class:"mt-6"},{left:r(n=>[e(u)?j("",!0):(S(),k(Y,{key:0,class:O(n.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[z(" "+v(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"]),e(s).companies.length!==1?(S(),H("div",$e,[o(ee,{class:"my-4"}),m("h3",Be,v(l.$tc("settings.company_info.delete_company")),1),m("div",Ve,[m("p",null,v(l.$tc("settings.company_info.delete_company_description")),1)]),m("div",Ce,[m("button",{type:"button",class:"inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm",onClick:q},v(l.$tc("general.delete")),1)])])):j("",!0)]),_:1},8,["title","description"])],40,be),o(ve)],64)}}};export{Se as default};
+var te=Object.defineProperty;var A=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var L=(f,s,d)=>s in f?te(f,s,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[s]=d,T=(f,s)=>{for(var d in s||(s={}))oe.call(s,d)&&L(f,d,s[d]);if(A)for(var d of A(s))se.call(s,d)&&L(f,d,s[d]);return f};import{C as ne,g as R,i as h,j as E,k as F,m as I,n as N,aQ as le,q as J,r as i,o as S,s as k,w as r,t as m,x as v,y as e,b as o,v as z,z as O,A as j,B as Q,am as de,p as re,c as H,a0 as ie,F as me}from"./vendor.e9042f2c.js";import{c as K,g as P,m as W}from"./main.366b2ac6.js";const ue={class:"flex justify-between w-full"},ce={class:"px-6 pt-6"},pe={class:"font-medium text-lg text-left"},_e={class:"mt-2 text-sm leading-snug text-gray-500",style:{"max-width":"680px"}},fe=["onSubmit"],ye={class:"p-4 sm:p-6 space-y-4"},ge={class:"z-0 flex justify-end p-4 bg-gray-50 border-modal-bg"},ve={setup(f){const s=K(),d=P(),D=W(),B=ne(),{t:M}=R();let u=h(!1);const a=E({id:s.selectedCompany.id,name:null}),b=F(()=>d.active&&d.componentName==="DeleteCompanyModal"),V={formData:{name:{required:I.withMessage(M("validation.required"),N),sameAsName:I.withMessage(M("validation.company_name_not_same"),le(s.selectedCompany.name))}}},p=J(V,{formData:a},{$scope:!1});async function U(){if(p.value.$touch(),p.value.$invalid)return!0;const g=s.companies[0];u.value=!0;try{const y=await s.deleteCompany(a);console.log(y.data.success),y.data.success&&(C(),await s.setSelectedCompany(g),B.push("/admin/dashboard"),await D.setIsAppLoaded(!1),await D.bootstrap()),u.value=!1}catch{u.value=!1}}function _(){a.id=null,a.name="",p.value.$reset()}function C(){d.closeModal(),setTimeout(()=>{_(),p.value.$reset()},300)}return(g,y)=>{const q=i("BaseInput"),l=i("BaseInputGroup"),t=i("BaseButton"),x=i("BaseIcon"),c=i("BaseModal");return S(),k(c,{show:e(b),onClose:C},{default:r(()=>[m("div",ue,[m("div",ce,[m("h6",pe,v(e(d).title),1),m("p",_e,v(g.$t("settings.company_info.delete_company_modal_desc",{company:e(s).selectedCompany.name})),1)])]),m("form",{action:"",onSubmit:Q(U,["prevent"])},[m("div",ye,[o(l,{label:g.$t("settings.company_info.delete_company_modal_label",{company:e(s).selectedCompany.name}),error:e(p).formData.name.$error&&e(p).formData.name.$errors[0].$message,required:""},{default:r(()=>[o(q,{modelValue:e(a).name,"onUpdate:modelValue":y[0]||(y[0]=$=>e(a).name=$),invalid:e(p).formData.name.$error,onInput:y[1]||(y[1]=$=>e(p).formData.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),m("div",ge,[o(t,{class:"mr-3 text-sm",variant:"primary-outline",outline:"",type:"button",onClick:C},{default:r(()=>[z(v(g.$t("general.cancel")),1)]),_:1}),o(t,{loading:e(u),disabled:e(u),variant:"danger",type:"submit"},{left:r($=>[e(u)?j("",!0):(S(),k(x,{key:0,name:"TrashIcon",class:O($.class)},null,8,["class"]))]),default:r(()=>[z(" "+v(g.$t("general.delete")),1)]),_:1},8,["loading","disabled"])])],40,fe)]),_:1},8,["show"])}}},be=["onSubmit"],$e={key:0,class:"py-5"},Be={class:"text-lg leading-6 font-medium text-gray-900"},Ve={class:"mt-2 max-w-xl text-sm text-gray-500"},Ce={class:"mt-5"},Se={setup(f){const s=K(),d=W(),D=P(),{t:B}=R(),M=de("utils");let u=h(!1);const a=E({name:null,logo:null,address:{address_street_1:"",address_street_2:"",website:"",country_id:null,state:"",city:"",phone:"",zip:""}});M.mergeSettings(a,T({},s.selectedCompany));let b=h([]),V=h(null),p=h(null);a.logo&&b.value.push({image:a.logo});const U=F(()=>({name:{required:I.withMessage(B("validation.required"),N),minLength:I.withMessage(B("validation.name_min_length"),re(3))},address:{country_id:{required:I.withMessage(B("validation.required"),N)}}})),_=J(U,F(()=>a));d.fetchCountries();function C(l,t,x,c){p.value=c.name,V.value=t}function g(){V.value=null}async function y(){if(_.value.$touch(),_.value.$invalid)return!0;if(u.value=!0,(await s.updateCompany(a)).data.data){if(V.value){let t=new FormData;t.append("company_logo",JSON.stringify({name:p.value,data:V.value})),await s.updateCompanyLogo(t)}u.value=!1}u.value=!1}function q(l){D.openModal({title:B("settings.company_info.are_you_absolutely_sure"),componentName:"DeleteCompanyModal",size:"sm"})}return(l,t)=>{const x=i("BaseFileUploader"),c=i("BaseInputGroup"),$=i("BaseInputGrid"),w=i("BaseInput"),X=i("BaseMultiselect"),G=i("BaseTextarea"),Y=i("BaseIcon"),Z=i("BaseButton"),ee=i("BaseDivider"),ae=i("BaseSettingCard");return S(),H(me,null,[m("form",{onSubmit:Q(y,["prevent"])},[o(ae,{title:l.$t("settings.company_info.company_info"),description:l.$t("settings.company_info.section_description")},{default:r(()=>[o($,{class:"mt-5"},{default:r(()=>[o(c,{label:l.$tc("settings.company_info.company_logo")},{default:r(()=>[o(x,{modelValue:e(b),"onUpdate:modelValue":t[0]||(t[0]=n=>ie(b)?b.value=n:b=n),base64:"",onChange:C,onRemove:g},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o($,{class:"mt-5"},{default:r(()=>[o(c,{label:l.$tc("settings.company_info.company_name"),error:e(_).name.$error&&e(_).name.$errors[0].$message,required:""},{default:r(()=>[o(w,{modelValue:e(a).name,"onUpdate:modelValue":t[1]||(t[1]=n=>e(a).name=n),invalid:e(_).name.$error,onBlur:t[2]||(t[2]=n=>e(_).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),o(c,{label:l.$tc("settings.company_info.phone")},{default:r(()=>[o(w,{modelValue:e(a).address.phone,"onUpdate:modelValue":t[3]||(t[3]=n=>e(a).address.phone=n)},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.country"),error:e(_).address.country_id.$error&&e(_).address.country_id.$errors[0].$message,required:""},{default:r(()=>[o(X,{modelValue:e(a).address.country_id,"onUpdate:modelValue":t[4]||(t[4]=n=>e(a).address.country_id=n),label:"name",invalid:e(_).address.country_id.$error,options:e(d).countries,"value-prop":"id","can-deselect":!0,"can-clear":!1,searchable:"","track-by":"name"},null,8,["modelValue","invalid","options"])]),_:1},8,["label","error"]),o(c,{label:l.$tc("settings.company_info.state")},{default:r(()=>[o(w,{modelValue:e(a).address.state,"onUpdate:modelValue":t[5]||(t[5]=n=>e(a).address.state=n),name:"state",type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.city")},{default:r(()=>[o(w,{modelValue:e(a).address.city,"onUpdate:modelValue":t[6]||(t[6]=n=>e(a).address.city=n),type:"text"},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:l.$tc("settings.company_info.zip")},{default:r(()=>[o(w,{modelValue:e(a).address.zip,"onUpdate:modelValue":t[7]||(t[7]=n=>e(a).address.zip=n)},null,8,["modelValue"])]),_:1},8,["label"]),m("div",null,[o(c,{label:l.$tc("settings.company_info.address")},{default:r(()=>[o(G,{modelValue:e(a).address.address_street_1,"onUpdate:modelValue":t[8]||(t[8]=n=>e(a).address.address_street_1=n),rows:"2"},null,8,["modelValue"])]),_:1},8,["label"]),o(G,{modelValue:e(a).address.address_street_2,"onUpdate:modelValue":t[9]||(t[9]=n=>e(a).address.address_street_2=n),rows:"2",row:2,class:"mt-2"},null,8,["modelValue"])])]),_:1}),o(Z,{loading:e(u),disabled:e(u),type:"submit",class:"mt-6"},{left:r(n=>[e(u)?j("",!0):(S(),k(Y,{key:0,class:O(n.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[z(" "+v(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"]),e(s).companies.length!==1?(S(),H("div",$e,[o(ee,{class:"my-4"}),m("h3",Be,v(l.$tc("settings.company_info.delete_company")),1),m("div",Ve,[m("p",null,v(l.$tc("settings.company_info.delete_company_description")),1)]),m("div",Ce,[m("button",{type:"button",class:"inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm",onClick:q},v(l.$tc("general.delete")),1)])])):j("",!0)]),_:1},8,["title","description"])],40,be),o(ve)],64)}}};export{Se as default};
diff --git a/public/build/assets/Create.cd281a15.js b/public/build/assets/Create.543da6ca.js
similarity index 97%
rename from public/build/assets/Create.cd281a15.js
rename to public/build/assets/Create.543da6ca.js
index bbbe92cb7..dc5149713 100644
--- a/public/build/assets/Create.cd281a15.js
+++ b/public/build/assets/Create.543da6ca.js
@@ -1 +1 @@
-import{u as le,C as ie,g as ue,i as U,k as _,m as p,n as y,b4 as ce,a4 as D,aU as de,O as pe,q as me,r as u,o as E,c as xe,b as r,w as o,t as V,y as e,s as w,z as S,v as b,x as $,A as M,a0 as ge,B as _e,F as ye}from"./vendor.e9042f2c.js";import{k as fe,c as ve,z as Ee,s as be,l as $e,g as he,m as Be}from"./main.109918ee.js";import{_ as Ce}from"./CreateCustomFields.e1e82659.js";import{_ as Ve}from"./CategoryModal.5ab2db2b.js";import{_ as we}from"./ExchangeRateConverter.bd27e496.js";const Se=["onSubmit"],Me={class:"hidden md:block"},Ie={class:"block md:hidden"},Re={setup(qe){const P=fe(),I=ve(),n=Ee(),R=be(),j=$e(),N=he(),g=le(),G=ie(),{t:c}=ue(),q=Be();let m=U(!1),i=U(!1);const k="newExpense",z=_(()=>({currentExpense:{expense_category_id:{required:p.withMessage(c("validation.required"),y)},expense_date:{required:p.withMessage(c("validation.required"),y)},amount:{required:p.withMessage(c("validation.required"),y),minValue:p.withMessage(c("validation.price_minvalue"),ce(.1)),maxLength:p.withMessage(c("validation.price_maxlength"),D(20))},notes:{maxLength:p.withMessage(c("validation.description_maxlength"),D(65e3))},currency_id:{required:p.withMessage(c("validation.required"),y)},exchange_rate:{required:de(function(){return p.withMessage(c("validation.required"),y),n.showExchangeRate}),decimal:p.withMessage(c("validation.valid_exchange_rate"),pe)}}})),l=me(z,n,{$scope:k}),h=_({get:()=>n.currentExpense.amount/100,set:t=>{n.currentExpense.amount=Math.round(t*100)}}),d=_(()=>g.name==="expenses.edit"),F=_(()=>d.value?c("expenses.edit_expense"):c("expenses.new_expense")),T=_(()=>d.value?`/expenses/${g.params.id}/download-receipt`:"");n.resetCurrentExpenseData(),j.resetCustomFields(),Q();function A(t,a){n.currentExpense.attachment_receipt=a}function L(){n.currentExpense.attachment_receipt=null}function H(){N.openModal({title:c("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm"})}function O(t){n.currentExpense.selectedCurrency=q.currencies.find(a=>a.id===t)}async function J(t){return(await R.fetchCategories({search:t})).data.data}async function K(t){return(await P.fetchCustomers({search:t})).data.data}async function Q(){d.value||(n.currentExpense.currency_id=I.selectedCompanyCurrency.id,n.currentExpense.selectedCurrency=I.selectedCompanyCurrency),i.value=!0,await n.fetchPaymentModes({limit:"all"}),d.value?(await n.fetchExpense(g.params.id),n.currentExpense.currency_id=n.currentExpense.selectedCurrency.id):g.query.customer&&(n.currentExpense.customer_id=g.query.customer),i.value=!1}async function W(){if(l.value.$touch(),l.value.$invalid)return;m.value=!0;let t=n.currentExpense;try{d.value?await n.updateExpense({id:g.params.id,data:t}):await n.addExpense(t),m.value=!1,G.push("/admin/expenses")}catch(a){console.error(a),m.value=!1;return}}return(t,a)=>{const B=u("BaseBreadcrumbItem"),X=u("BaseBreadcrumb"),f=u("BaseIcon"),C=u("BaseButton"),Y=u("BasePageHeader"),Z=u("BaseSelectAction"),v=u("BaseMultiselect"),x=u("BaseInputGroup"),ee=u("BaseDatePicker"),ne=u("BaseMoney"),te=u("BaseTextarea"),ae=u("BaseFileUploader"),re=u("BaseInputGrid"),se=u("BaseCard"),oe=u("BasePage");return E(),xe(ye,null,[r(Ve),r(oe,{class:"relative"},{default:o(()=>[V("form",{action:"",onSubmit:_e(W,["prevent"])},[r(Y,{title:e(F),class:"mb-5"},{actions:o(()=>[e(d)&&e(n).currentExpense.attachment_receipt?(E(),w(C,{key:0,href:e(T),tag:"a",variant:"primary-outline",type:"button",class:"mr-2"},{left:o(s=>[r(f,{name:"DownloadIcon",class:S(s.class)},null,8,["class"])]),default:o(()=>[b(" "+$(t.$t("expenses.download_receipt")),1)]),_:1},8,["href"])):M("",!0),V("div",Me,[r(C,{loading:e(m),"content-loading":e(i),disabled:e(m),variant:"primary",type:"submit"},{left:o(s=>[e(m)?M("",!0):(E(),w(f,{key:0,name:"SaveIcon",class:S(s.class)},null,8,["class"]))]),default:o(()=>[b(" "+$(e(d)?t.$t("expenses.update_expense"):t.$t("expenses.save_expense")),1)]),_:1},8,["loading","content-loading","disabled"])])]),default:o(()=>[r(X,null,{default:o(()=>[r(B,{title:t.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(B,{title:t.$tc("expenses.expense",2),to:"/admin/expenses"},null,8,["title"]),r(B,{title:e(F),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(se,null,{default:o(()=>[r(re,null,{default:o(()=>[r(x,{label:t.$t("expenses.category"),error:e(l).currentExpense.expense_category_id.$error&&e(l).currentExpense.expense_category_id.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.expense_category_id,"onUpdate:modelValue":a[0]||(a[0]=s=>e(n).currentExpense.expense_category_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:J,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",invalid:e(l).currentExpense.expense_category_id.$error,placeholder:t.$t("expenses.categories.select_a_category"),onInput:a[1]||(a[1]=s=>e(l).currentExpense.expense_category_id.$touch())},{action:o(()=>[r(Z,{onClick:H},{default:o(()=>[r(f,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),b(" "+$(t.$t("settings.expense_category.add_new_category")),1)]),_:1})]),_:1},8,["modelValue","content-loading","invalid","placeholder"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.expense_date"),error:e(l).currentExpense.expense_date.$error&&e(l).currentExpense.expense_date.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ee,{modelValue:e(n).currentExpense.expense_date,"onUpdate:modelValue":a[2]||(a[2]=s=>e(n).currentExpense.expense_date=s),"content-loading":e(i),"calendar-button":!0,invalid:e(l).currentExpense.expense_date.$error,onInput:a[3]||(a[3]=s=>e(l).currentExpense.expense_date.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.amount"),error:e(l).currentExpense.amount.$error&&e(l).currentExpense.amount.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ne,{key:e(n).currentExpense.selectedCurrency,modelValue:e(h),"onUpdate:modelValue":a[4]||(a[4]=s=>ge(h)?h.value=s:null),class:"focus:border focus:border-solid focus:border-primary-500",invalid:e(l).currentExpense.amount.$error,currency:e(n).currentExpense.selectedCurrency,onInput:a[5]||(a[5]=s=>e(l).currentExpense.amount.$touch())},null,8,["modelValue","invalid","currency"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.currency"),"content-loading":e(i),error:e(l).currentExpense.currency_id.$error&&e(l).currentExpense.currency_id.$errors[0].$message,required:""},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.currency_id,"onUpdate:modelValue":[a[6]||(a[6]=s=>e(n).currentExpense.currency_id=s),O],"value-prop":"id",label:"name","track-by":"name","content-loading":e(i),options:e(q).currencies,searchable:"","can-deselect":!1,placeholder:t.$t("customers.select_currency"),invalid:e(l).currentExpense.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(we,{store:e(n),"store-prop":"currentExpense",v:e(l).currentExpense,"is-loading":e(i),"is-edit":e(d),"customer-currency":e(n).currentExpense.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"]),r(x,{"content-loading":e(i),label:t.$t("expenses.customer")},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.customer_id,"onUpdate:modelValue":a[7]||(a[7]=s=>e(n).currentExpense.customer_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:K,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",placeholder:t.$t("customers.select_a_customer")},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:t.$t("payments.payment_mode")},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.payment_method_id,"onUpdate:modelValue":a[8]||(a[8]=s=>e(n).currentExpense.payment_method_id=s),"content-loading":e(i),label:"name","value-prop":"id","track-by":"name",options:e(n).paymentModes,placeholder:t.$t("payments.select_payment_mode"),searchable:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:t.$t("expenses.note"),error:e(l).currentExpense.notes.$error&&e(l).currentExpense.notes.$errors[0].$message},{default:o(()=>[r(te,{modelValue:e(n).currentExpense.notes,"onUpdate:modelValue":a[9]||(a[9]=s=>e(n).currentExpense.notes=s),"content-loading":e(i),row:4,rows:"4",onInput:a[10]||(a[10]=s=>e(l).currentExpense.notes.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label","error"]),r(x,{label:t.$t("expenses.receipt")},{default:o(()=>[r(ae,{modelValue:e(n).currentExpense.receiptFiles,"onUpdate:modelValue":a[11]||(a[11]=s=>e(n).currentExpense.receiptFiles=s),accept:"image/*,.doc,.docx,.pdf,.csv,.xlsx,.xls",onChange:A,onRemove:L},null,8,["modelValue"])]),_:1},8,["label"]),r(Ce,{"is-edit":e(d),class:"col-span-2","is-loading":e(i),type:"Expense",store:e(n),"store-prop":"currentExpense","custom-field-scope":k},null,8,["is-edit","is-loading","store"]),V("div",Ie,[r(C,{loading:e(m),tabindex:6,variant:"primary",type:"submit",class:"flex justify-center w-full"},{left:o(s=>[e(m)?M("",!0):(E(),w(f,{key:0,name:"SaveIcon",class:S(s.class)},null,8,["class"]))]),default:o(()=>[b(" "+$(e(d)?t.$t("expenses.update_expense"):t.$t("expenses.save_expense")),1)]),_:1},8,["loading"])])]),_:1})]),_:1})],40,Se)]),_:1})],64)}}};export{Re as default};
+import{u as le,C as ie,g as ue,i as U,k as _,m as p,n as y,b4 as ce,a4 as D,aU as de,O as pe,q as me,r as u,o as E,c as xe,b as r,w as o,t as V,y as e,s as w,z as S,v as b,x as $,A as M,a0 as ge,B as _e,F as ye}from"./vendor.e9042f2c.js";import{k as fe,c as ve,z as Ee,s as be,l as $e,g as he,m as Be}from"./main.366b2ac6.js";import{_ as Ce}from"./CreateCustomFields.2a9ca04b.js";import{_ as Ve}from"./CategoryModal.5546afa0.js";import{_ as we}from"./ExchangeRateConverter.42d55dc1.js";const Se=["onSubmit"],Me={class:"hidden md:block"},Ie={class:"block md:hidden"},Re={setup(qe){const P=fe(),I=ve(),n=Ee(),R=be(),j=$e(),N=he(),g=le(),G=ie(),{t:c}=ue(),q=Be();let m=U(!1),i=U(!1);const k="newExpense",z=_(()=>({currentExpense:{expense_category_id:{required:p.withMessage(c("validation.required"),y)},expense_date:{required:p.withMessage(c("validation.required"),y)},amount:{required:p.withMessage(c("validation.required"),y),minValue:p.withMessage(c("validation.price_minvalue"),ce(.1)),maxLength:p.withMessage(c("validation.price_maxlength"),D(20))},notes:{maxLength:p.withMessage(c("validation.description_maxlength"),D(65e3))},currency_id:{required:p.withMessage(c("validation.required"),y)},exchange_rate:{required:de(function(){return p.withMessage(c("validation.required"),y),n.showExchangeRate}),decimal:p.withMessage(c("validation.valid_exchange_rate"),pe)}}})),l=me(z,n,{$scope:k}),h=_({get:()=>n.currentExpense.amount/100,set:t=>{n.currentExpense.amount=Math.round(t*100)}}),d=_(()=>g.name==="expenses.edit"),F=_(()=>d.value?c("expenses.edit_expense"):c("expenses.new_expense")),T=_(()=>d.value?`/expenses/${g.params.id}/download-receipt`:"");n.resetCurrentExpenseData(),j.resetCustomFields(),Q();function A(t,a){n.currentExpense.attachment_receipt=a}function L(){n.currentExpense.attachment_receipt=null}function H(){N.openModal({title:c("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm"})}function O(t){n.currentExpense.selectedCurrency=q.currencies.find(a=>a.id===t)}async function J(t){return(await R.fetchCategories({search:t})).data.data}async function K(t){return(await P.fetchCustomers({search:t})).data.data}async function Q(){d.value||(n.currentExpense.currency_id=I.selectedCompanyCurrency.id,n.currentExpense.selectedCurrency=I.selectedCompanyCurrency),i.value=!0,await n.fetchPaymentModes({limit:"all"}),d.value?(await n.fetchExpense(g.params.id),n.currentExpense.currency_id=n.currentExpense.selectedCurrency.id):g.query.customer&&(n.currentExpense.customer_id=g.query.customer),i.value=!1}async function W(){if(l.value.$touch(),l.value.$invalid)return;m.value=!0;let t=n.currentExpense;try{d.value?await n.updateExpense({id:g.params.id,data:t}):await n.addExpense(t),m.value=!1,G.push("/admin/expenses")}catch(a){console.error(a),m.value=!1;return}}return(t,a)=>{const B=u("BaseBreadcrumbItem"),X=u("BaseBreadcrumb"),f=u("BaseIcon"),C=u("BaseButton"),Y=u("BasePageHeader"),Z=u("BaseSelectAction"),v=u("BaseMultiselect"),x=u("BaseInputGroup"),ee=u("BaseDatePicker"),ne=u("BaseMoney"),te=u("BaseTextarea"),ae=u("BaseFileUploader"),re=u("BaseInputGrid"),se=u("BaseCard"),oe=u("BasePage");return E(),xe(ye,null,[r(Ve),r(oe,{class:"relative"},{default:o(()=>[V("form",{action:"",onSubmit:_e(W,["prevent"])},[r(Y,{title:e(F),class:"mb-5"},{actions:o(()=>[e(d)&&e(n).currentExpense.attachment_receipt?(E(),w(C,{key:0,href:e(T),tag:"a",variant:"primary-outline",type:"button",class:"mr-2"},{left:o(s=>[r(f,{name:"DownloadIcon",class:S(s.class)},null,8,["class"])]),default:o(()=>[b(" "+$(t.$t("expenses.download_receipt")),1)]),_:1},8,["href"])):M("",!0),V("div",Me,[r(C,{loading:e(m),"content-loading":e(i),disabled:e(m),variant:"primary",type:"submit"},{left:o(s=>[e(m)?M("",!0):(E(),w(f,{key:0,name:"SaveIcon",class:S(s.class)},null,8,["class"]))]),default:o(()=>[b(" "+$(e(d)?t.$t("expenses.update_expense"):t.$t("expenses.save_expense")),1)]),_:1},8,["loading","content-loading","disabled"])])]),default:o(()=>[r(X,null,{default:o(()=>[r(B,{title:t.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),r(B,{title:t.$tc("expenses.expense",2),to:"/admin/expenses"},null,8,["title"]),r(B,{title:e(F),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),r(se,null,{default:o(()=>[r(re,null,{default:o(()=>[r(x,{label:t.$t("expenses.category"),error:e(l).currentExpense.expense_category_id.$error&&e(l).currentExpense.expense_category_id.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.expense_category_id,"onUpdate:modelValue":a[0]||(a[0]=s=>e(n).currentExpense.expense_category_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:J,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",invalid:e(l).currentExpense.expense_category_id.$error,placeholder:t.$t("expenses.categories.select_a_category"),onInput:a[1]||(a[1]=s=>e(l).currentExpense.expense_category_id.$touch())},{action:o(()=>[r(Z,{onClick:H},{default:o(()=>[r(f,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),b(" "+$(t.$t("settings.expense_category.add_new_category")),1)]),_:1})]),_:1},8,["modelValue","content-loading","invalid","placeholder"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.expense_date"),error:e(l).currentExpense.expense_date.$error&&e(l).currentExpense.expense_date.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ee,{modelValue:e(n).currentExpense.expense_date,"onUpdate:modelValue":a[2]||(a[2]=s=>e(n).currentExpense.expense_date=s),"content-loading":e(i),"calendar-button":!0,invalid:e(l).currentExpense.expense_date.$error,onInput:a[3]||(a[3]=s=>e(l).currentExpense.expense_date.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.amount"),error:e(l).currentExpense.amount.$error&&e(l).currentExpense.amount.$errors[0].$message,"content-loading":e(i),required:""},{default:o(()=>[r(ne,{key:e(n).currentExpense.selectedCurrency,modelValue:e(h),"onUpdate:modelValue":a[4]||(a[4]=s=>ge(h)?h.value=s:null),class:"focus:border focus:border-solid focus:border-primary-500",invalid:e(l).currentExpense.amount.$error,currency:e(n).currentExpense.selectedCurrency,onInput:a[5]||(a[5]=s=>e(l).currentExpense.amount.$touch())},null,8,["modelValue","invalid","currency"])]),_:1},8,["label","error","content-loading"]),r(x,{label:t.$t("expenses.currency"),"content-loading":e(i),error:e(l).currentExpense.currency_id.$error&&e(l).currentExpense.currency_id.$errors[0].$message,required:""},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.currency_id,"onUpdate:modelValue":[a[6]||(a[6]=s=>e(n).currentExpense.currency_id=s),O],"value-prop":"id",label:"name","track-by":"name","content-loading":e(i),options:e(q).currencies,searchable:"","can-deselect":!1,placeholder:t.$t("customers.select_currency"),invalid:e(l).currentExpense.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),r(we,{store:e(n),"store-prop":"currentExpense",v:e(l).currentExpense,"is-loading":e(i),"is-edit":e(d),"customer-currency":e(n).currentExpense.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"]),r(x,{"content-loading":e(i),label:t.$t("expenses.customer")},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.customer_id,"onUpdate:modelValue":a[7]||(a[7]=s=>e(n).currentExpense.customer_id=s),"content-loading":e(i),"value-prop":"id",label:"name","track-by":"id",options:K,"filter-results":!1,"resolve-on-load":"",delay:500,searchable:"",placeholder:t.$t("customers.select_a_customer")},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:t.$t("payments.payment_mode")},{default:o(()=>[r(v,{modelValue:e(n).currentExpense.payment_method_id,"onUpdate:modelValue":a[8]||(a[8]=s=>e(n).currentExpense.payment_method_id=s),"content-loading":e(i),label:"name","value-prop":"id","track-by":"name",options:e(n).paymentModes,placeholder:t.$t("payments.select_payment_mode"),searchable:""},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),r(x,{"content-loading":e(i),label:t.$t("expenses.note"),error:e(l).currentExpense.notes.$error&&e(l).currentExpense.notes.$errors[0].$message},{default:o(()=>[r(te,{modelValue:e(n).currentExpense.notes,"onUpdate:modelValue":a[9]||(a[9]=s=>e(n).currentExpense.notes=s),"content-loading":e(i),row:4,rows:"4",onInput:a[10]||(a[10]=s=>e(l).currentExpense.notes.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label","error"]),r(x,{label:t.$t("expenses.receipt")},{default:o(()=>[r(ae,{modelValue:e(n).currentExpense.receiptFiles,"onUpdate:modelValue":a[11]||(a[11]=s=>e(n).currentExpense.receiptFiles=s),accept:"image/*,.doc,.docx,.pdf,.csv,.xlsx,.xls",onChange:A,onRemove:L},null,8,["modelValue"])]),_:1},8,["label"]),r(Ce,{"is-edit":e(d),class:"col-span-2","is-loading":e(i),type:"Expense",store:e(n),"store-prop":"currentExpense","custom-field-scope":k},null,8,["is-edit","is-loading","store"]),V("div",Ie,[r(C,{loading:e(m),tabindex:6,variant:"primary",type:"submit",class:"flex justify-center w-full"},{left:o(s=>[e(m)?M("",!0):(E(),w(f,{key:0,name:"SaveIcon",class:S(s.class)},null,8,["class"]))]),default:o(()=>[b(" "+$(e(d)?t.$t("expenses.update_expense"):t.$t("expenses.save_expense")),1)]),_:1},8,["loading"])])]),_:1})]),_:1})],40,Se)]),_:1})],64)}}};export{Re as default};
diff --git a/public/build/assets/Create.5c2c19c7.js b/public/build/assets/Create.5c2c19c7.js
new file mode 100644
index 000000000..c91af4726
--- /dev/null
+++ b/public/build/assets/Create.5c2c19c7.js
@@ -0,0 +1 @@
+var ce=Object.defineProperty;var E=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var F=(_,s,c)=>s in _?ce(_,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):_[s]=c,G=(_,s)=>{for(var c in s||(s={}))de.call(s,c)&&F(_,c,s[c]);if(E)for(var c of E(s))ye.call(s,c)&&F(_,c,s[c]);return _};import{u as pe,C as _e,am as ve,g as fe,i as M,j as Pe,k as C,m as h,n as w,aZ as ge,aU as be,O as Be,q as $e,ac as he,b3 as Ie,r as m,o as k,c as Ce,b as o,w as l,t as I,y as e,s as R,z,A as L,v as q,x as f,a0 as Se,B as Ve,F as Me}from"./vendor.e9042f2c.js";import{_ as we}from"./ExchangeRateConverter.42d55dc1.js";import{o as qe,u as ke,k as Ne,l as Ue,c as je,g as Ae,f as De,m as xe}from"./main.366b2ac6.js";import{_ as Ee}from"./SelectNotePopup.2b294885.js";import{_ as Fe}from"./CreateCustomFields.2a9ca04b.js";import{_ as Ge}from"./PaymentModeModal.078a5c68.js";import"./NoteModal.bd9e1253.js";const Re=["onSubmit"],ze={class:"absolute left-3.5"},Le={class:"relative w-full"},He={class:"relative mt-6"},Te={class:"z-20 float-right text-sm font-semibold leading-5 text-primary-400"},Oe={class:"mb-4 text-sm font-medium text-primary-800"},tt={setup(_){const s=pe(),c=_e(),t=qe();ke();const H=Ne();Ue(),je();const T=Ae(),N=De();xe();const U=ve("utils"),{t:p}=fe();let P=M(!1),S=M(!1),g=M([]);const B=M(null),j="newEstimate",O=Pe(["customer","company","customerCustom","payment","paymentCustom"]),V=C({get:()=>t.currentPayment.amount/100,set:n=>{t.currentPayment.amount=Math.round(n*100)}}),u=C(()=>t.isFetchingInitialData),d=C(()=>s.name==="payments.edit"),A=C(()=>d.value?p("payments.edit_payment"):p("payments.new_payment")),Z=C(()=>({currentPayment:{customer_id:{required:h.withMessage(p("validation.required"),w)},payment_date:{required:h.withMessage(p("validation.required"),w)},amount:{required:h.withMessage(p("validation.required"),w),between:h.withMessage(p("validation.payment_greater_than_due_amount"),ge(1,t.currentPayment.maxPayableAmount))},exchange_rate:{required:be(function(){return h.withMessage(p("validation.required"),w),t.showExchangeRate}),decimal:h.withMessage(p("validation.valid_exchange_rate"),Be)}}})),i=$e(Z,t,{$scope:j});he(()=>{t.currentPayment.customer_id&&X(t.currentPayment.customer_id),s.query.customer&&(t.currentPayment.customer_id=s.query.customer)}),t.resetCurrentPayment(),s.query.customer&&(t.currentPayment.customer_id=s.query.customer),t.fetchPaymentInitialData(d.value),s.params.id&&!d.value&&Q();async function J(){T.openModal({title:p("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal"})}function K(n){t.currentPayment.notes=""+n.notes}async function Q(){var a;let n=await N.fetchInvoice((a=s==null?void 0:s.params)==null?void 0:a.id);t.currentPayment.customer_id=n.data.data.customer.id,t.currentPayment.invoice_id=n.data.data.id}async function W(n){n&&(B.value=g.value.find(a=>a.id===n),V.value=B.value.due_amount/100,t.currentPayment.maxPayableAmount=B.value.due_amount)}function X(n){if(n){let a={customer_id:n,status:"DUE",limit:"all"};d.value&&(a.status=""),S.value=!0,Promise.all([N.fetchInvoices(a),H.fetchCustomer(n)]).then(async([y,b])=>{y&&(g.value=[...y.data.data]),b&&b.data&&(t.currentPayment.selectedCustomer=b.data.data,t.currentPayment.customer=b.data.data,t.currentPayment.currency=b.data.data.currency),d.value&&t.currentPayment.invoice_id&&(B.value=g.value.find(v=>v.id===t.currentPayment.invoice_id),t.currentPayment.maxPayableAmount=B.value.due_amount+t.currentPayment.amount),d.value&&(g.value=g.value.filter(v=>v.due_amount>0||v.id==t.currentPayment.invoice_id)),S.value=!1}).catch(y=>{S.value=!1,console.error(y,"error")})}}Ie(()=>{t.resetCurrentPayment(),g.value=[]});async function Y(){if(i.value.$touch(),i.value.$invalid)return!1;P.value=!0;let n=G({},t.currentPayment),a=null;try{a=await(d.value?t.updatePayment:t.addPayment)(n),c.push(`/admin/payments/${a.data.data.id}/view`)}catch{P.value=!1}}function ee(n){let a={userId:n};s.params.id&&(a.model_id=s.params.id),t.currentPayment.invoice_id=null,t.getNextNumber(a,!0)}return(n,a)=>{const y=m("BaseBreadcrumbItem"),b=m("BaseBreadcrumb"),v=m("BaseIcon"),D=m("BaseButton"),te=m("BasePageHeader"),ne=m("BaseDatePicker"),$=m("BaseInputGroup"),ae=m("BaseInput"),oe=m("BaseCustomerSelectInput"),x=m("BaseMultiselect"),re=m("BaseMoney"),se=m("BaseSelectAction"),le=m("BaseInputGrid"),ue=m("BaseCustomInput"),me=m("BaseCard"),ie=m("BasePage");return k(),Ce(Me,null,[o(Ge),o(ie,{class:"relative payment-create"},{default:l(()=>[I("form",{action:"",onSubmit:Ve(Y,["prevent"])},[o(te,{title:e(A),class:"mb-5"},{actions:l(()=>[o(D,{loading:e(P),disabled:e(P),variant:"primary",type:"submit",class:"hidden sm:flex"},{left:l(r=>[e(P)?L("",!0):(k(),R(v,{key:0,name:"SaveIcon",class:z(r.class)},null,8,["class"]))]),default:l(()=>[q(" "+f(e(d)?n.$t("payments.update_payment"):n.$t("payments.save_payment")),1)]),_:1},8,["loading","disabled"])]),default:l(()=>[o(b,null,{default:l(()=>[o(y,{title:n.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),o(y,{title:n.$tc("payments.payment",2),to:"/admin/payments"},null,8,["title"]),o(y,{title:e(A),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(me,null,{default:l(()=>[o(le,null,{default:l(()=>[o($,{label:n.$t("payments.date"),"content-loading":e(u),required:"",error:e(i).currentPayment.payment_date.$error&&e(i).currentPayment.payment_date.$errors[0].$message},{default:l(()=>[o(ne,{modelValue:e(t).currentPayment.payment_date,"onUpdate:modelValue":[a[0]||(a[0]=r=>e(t).currentPayment.payment_date=r),a[1]||(a[1]=r=>e(i).currentPayment.payment_date.$touch())],"content-loading":e(u),"calendar-button":!0,"calendar-button-icon":"calendar",invalid:e(i).currentPayment.payment_date.$error},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o($,{label:n.$t("payments.payment_number"),"content-loading":e(u),required:""},{default:l(()=>[o(ae,{modelValue:e(t).currentPayment.payment_number,"onUpdate:modelValue":a[2]||(a[2]=r=>e(t).currentPayment.payment_number=r),"content-loading":e(u)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o($,{label:n.$t("payments.customer"),error:e(i).currentPayment.customer_id.$error&&e(i).currentPayment.customer_id.$errors[0].$message,"content-loading":e(u),required:""},{default:l(()=>[o(oe,{modelValue:e(t).currentPayment.customer_id,"onUpdate:modelValue":[a[3]||(a[3]=r=>e(t).currentPayment.customer_id=r),a[4]||(a[4]=r=>ee(e(t).currentPayment.customer_id))],"content-loading":e(u),invalid:e(i).currentPayment.customer_id.$error,placeholder:n.$t("customers.select_a_customer"),"fetch-all":e(d),"show-action":""},null,8,["modelValue","content-loading","invalid","placeholder","fetch-all"])]),_:1},8,["label","error","content-loading"]),o($,{"content-loading":e(u),label:n.$t("payments.invoice"),"help-text":B.value?`Due Amount: ${e(t).currentPayment.maxPayableAmount/100}`:""},{default:l(()=>[o(x,{modelValue:e(t).currentPayment.invoice_id,"onUpdate:modelValue":a[5]||(a[5]=r=>e(t).currentPayment.invoice_id=r),"content-loading":e(u),"value-prop":"id","track-by":"invoice_number",label:"invoice_number",options:e(g),loading:e(S),placeholder:n.$t("invoices.select_invoice"),onSelect:W},{singlelabel:l(({value:r})=>[I("div",ze,f(r.invoice_number)+" ("+f(e(U).formatMoney(r.total,r.customer.currency))+") ",1)]),option:l(({option:r})=>[q(f(r.invoice_number)+" ("+f(e(U).formatMoney(r.total,r.customer.currency))+") ",1)]),_:1},8,["modelValue","content-loading","options","loading","placeholder"])]),_:1},8,["content-loading","label","help-text"]),o($,{label:n.$t("payments.amount"),"content-loading":e(u),error:e(i).currentPayment.amount.$error&&e(i).currentPayment.amount.$errors[0].$message,required:""},{default:l(()=>[I("div",Le,[o(re,{key:e(t).currentPayment.currency,modelValue:e(V),"onUpdate:modelValue":[a[6]||(a[6]=r=>Se(V)?V.value=r:null),a[7]||(a[7]=r=>e(i).currentPayment.amount.$touch())],currency:e(t).currentPayment.currency,"content-loading":e(u),invalid:e(i).currentPayment.amount.$error},null,8,["modelValue","currency","content-loading","invalid"])])]),_:1},8,["label","content-loading","error"]),o($,{"content-loading":e(u),label:n.$t("payments.payment_mode")},{default:l(()=>[o(x,{modelValue:e(t).currentPayment.payment_method_id,"onUpdate:modelValue":a[8]||(a[8]=r=>e(t).currentPayment.payment_method_id=r),"content-loading":e(u),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:n.$t("payments.select_payment_mode"),searchable:""},{action:l(()=>[o(se,{onClick:J},{default:l(()=>[o(v,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),q(" "+f(n.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),o(we,{store:e(t),"store-prop":"currentPayment",v:e(i).currentPayment,"is-loading":e(u),"is-edit":e(d),"customer-currency":e(t).currentPayment.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"])]),_:1}),o(Fe,{type:"Payment","is-edit":e(d),"is-loading":e(u),store:e(t),"store-prop":"currentPayment","custom-field-scope":j,class:"mt-6"},null,8,["is-edit","is-loading","store"]),I("div",He,[I("div",Te,[o(Ee,{type:"Payment",onSelect:K})]),I("label",Oe,f(n.$t("estimates.notes")),1),o(ue,{modelValue:e(t).currentPayment.notes,"onUpdate:modelValue":a[9]||(a[9]=r=>e(t).currentPayment.notes=r),"content-loading":e(u),fields:e(O),class:"mt-1"},null,8,["modelValue","content-loading","fields"])]),o(D,{loading:e(P),"content-loading":e(u),variant:"primary",type:"submit",class:"flex justify-center w-full mt-4 sm:hidden md:hidden"},{left:l(r=>[e(P)?L("",!0):(k(),R(v,{key:0,name:"SaveIcon",class:z(r.class)},null,8,["class"]))]),default:l(()=>[q(" "+f(e(d)?n.$t("payments.update_payment"):n.$t("payments.save_payment")),1)]),_:1},8,["loading","content-loading"])]),_:1})],40,Re)]),_:1})],64)}}};export{tt as default};
diff --git a/public/build/assets/Create.83ba28b5.js b/public/build/assets/Create.83ba28b5.js
deleted file mode 100644
index 4bb79ff1d..000000000
--- a/public/build/assets/Create.83ba28b5.js
+++ /dev/null
@@ -1 +0,0 @@
-var ce=Object.defineProperty;var E=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var F=(_,s,c)=>s in _?ce(_,s,{enumerable:!0,configurable:!0,writable:!0,value:c}):_[s]=c,G=(_,s)=>{for(var c in s||(s={}))de.call(s,c)&&F(_,c,s[c]);if(E)for(var c of E(s))ye.call(s,c)&&F(_,c,s[c]);return _};import{u as pe,C as _e,am as ve,g as fe,i as M,j as Pe,k as C,m as h,n as w,aZ as ge,aU as be,O as Be,q as $e,ac as he,b3 as Ie,r as m,o as k,c as Ce,b as o,w as l,t as I,y as e,s as R,z,A as L,v as q,x as f,a0 as Se,B as Ve,F as Me}from"./vendor.e9042f2c.js";import{_ as we}from"./ExchangeRateConverter.bd27e496.js";import{o as qe,u as ke,k as Ne,l as Ue,c as je,g as Ae,f as De,m as xe}from"./main.109918ee.js";import{_ as Ee}from"./SelectNotePopup.28113001.js";import{_ as Fe}from"./CreateCustomFields.e1e82659.js";import{_ as Ge}from"./PaymentModeModal.00ba2d18.js";import"./NoteModal.81974d7d.js";const Re=["onSubmit"],ze={class:"absolute left-3.5"},Le={class:"relative w-full"},He={class:"relative mt-6"},Te={class:"z-20 float-right text-sm font-semibold leading-5 text-primary-400"},Oe={class:"mb-4 text-sm font-medium text-primary-800"},tt={setup(_){const s=pe(),c=_e(),t=qe();ke();const H=Ne();Ue(),je();const T=Ae(),N=De();xe();const U=ve("utils"),{t:p}=fe();let P=M(!1),S=M(!1),g=M([]);const B=M(null),j="newEstimate",O=Pe(["customer","company","customerCustom","payment","paymentCustom"]),V=C({get:()=>t.currentPayment.amount/100,set:n=>{t.currentPayment.amount=Math.round(n*100)}}),u=C(()=>t.isFetchingInitialData),d=C(()=>s.name==="payments.edit"),A=C(()=>d.value?p("payments.edit_payment"):p("payments.new_payment")),Z=C(()=>({currentPayment:{customer_id:{required:h.withMessage(p("validation.required"),w)},payment_date:{required:h.withMessage(p("validation.required"),w)},amount:{required:h.withMessage(p("validation.required"),w),between:h.withMessage(p("validation.payment_greater_than_due_amount"),ge(1,t.currentPayment.maxPayableAmount))},exchange_rate:{required:be(function(){return h.withMessage(p("validation.required"),w),t.showExchangeRate}),decimal:h.withMessage(p("validation.valid_exchange_rate"),Be)}}})),i=$e(Z,t,{$scope:j});he(()=>{t.currentPayment.customer_id&&X(t.currentPayment.customer_id),s.query.customer&&(t.currentPayment.customer_id=s.query.customer)}),t.resetCurrentPayment(),s.query.customer&&(t.currentPayment.customer_id=s.query.customer),t.fetchPaymentInitialData(d.value),s.params.id&&!d.value&&Q();async function J(){T.openModal({title:p("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal"})}function K(n){t.currentPayment.notes=""+n.notes}async function Q(){var a;let n=await N.fetchInvoice((a=s==null?void 0:s.params)==null?void 0:a.id);t.currentPayment.customer_id=n.data.data.customer.id,t.currentPayment.invoice_id=n.data.data.id}async function W(n){n&&(B.value=g.value.find(a=>a.id===n),V.value=B.value.due_amount/100,t.currentPayment.maxPayableAmount=B.value.due_amount)}function X(n){if(n){let a={customer_id:n,status:"DUE"};d.value&&(a.status=""),S.value=!0,Promise.all([N.fetchInvoices(a),H.fetchCustomer(n)]).then(async([y,b])=>{y&&(g.value=[...y.data.data]),b&&b.data&&(t.currentPayment.selectedCustomer=b.data.data,t.currentPayment.customer=b.data.data,t.currentPayment.currency=b.data.data.currency),d.value&&t.currentPayment.invoice_id&&(B.value=g.value.find(v=>v.id===t.currentPayment.invoice_id),t.currentPayment.maxPayableAmount=B.value.due_amount+t.currentPayment.amount),d.value&&(g.value=g.value.filter(v=>v.due_amount>0||v.id==t.currentPayment.invoice_id)),S.value=!1}).catch(y=>{S.value=!1,console.error(y,"error")})}}Ie(()=>{t.resetCurrentPayment(),g.value=[]});async function Y(){if(i.value.$touch(),i.value.$invalid)return!1;P.value=!0;let n=G({},t.currentPayment),a=null;try{a=await(d.value?t.updatePayment:t.addPayment)(n),c.push(`/admin/payments/${a.data.data.id}/view`)}catch{P.value=!1}}function ee(n){let a={userId:n};s.params.id&&(a.model_id=s.params.id),t.getNextNumber(a,!0)}return(n,a)=>{const y=m("BaseBreadcrumbItem"),b=m("BaseBreadcrumb"),v=m("BaseIcon"),D=m("BaseButton"),te=m("BasePageHeader"),ne=m("BaseDatePicker"),$=m("BaseInputGroup"),ae=m("BaseInput"),oe=m("BaseCustomerSelectInput"),x=m("BaseMultiselect"),re=m("BaseMoney"),se=m("BaseSelectAction"),le=m("BaseInputGrid"),ue=m("BaseCustomInput"),me=m("BaseCard"),ie=m("BasePage");return k(),Ce(Me,null,[o(Ge),o(ie,{class:"relative payment-create"},{default:l(()=>[I("form",{action:"",onSubmit:Ve(Y,["prevent"])},[o(te,{title:e(A),class:"mb-5"},{actions:l(()=>[o(D,{loading:e(P),disabled:e(P),variant:"primary",type:"submit",class:"hidden sm:flex"},{left:l(r=>[e(P)?L("",!0):(k(),R(v,{key:0,name:"SaveIcon",class:z(r.class)},null,8,["class"]))]),default:l(()=>[q(" "+f(e(d)?n.$t("payments.update_payment"):n.$t("payments.save_payment")),1)]),_:1},8,["loading","disabled"])]),default:l(()=>[o(b,null,{default:l(()=>[o(y,{title:n.$t("general.home"),to:"/admin/dashboard"},null,8,["title"]),o(y,{title:n.$tc("payments.payment",2),to:"/admin/payments"},null,8,["title"]),o(y,{title:e(A),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(me,null,{default:l(()=>[o(le,null,{default:l(()=>[o($,{label:n.$t("payments.date"),"content-loading":e(u),required:"",error:e(i).currentPayment.payment_date.$error&&e(i).currentPayment.payment_date.$errors[0].$message},{default:l(()=>[o(ne,{modelValue:e(t).currentPayment.payment_date,"onUpdate:modelValue":[a[0]||(a[0]=r=>e(t).currentPayment.payment_date=r),a[1]||(a[1]=r=>e(i).currentPayment.payment_date.$touch())],"content-loading":e(u),"calendar-button":!0,"calendar-button-icon":"calendar",invalid:e(i).currentPayment.payment_date.$error},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o($,{label:n.$t("payments.payment_number"),"content-loading":e(u),required:""},{default:l(()=>[o(ae,{modelValue:e(t).currentPayment.payment_number,"onUpdate:modelValue":a[2]||(a[2]=r=>e(t).currentPayment.payment_number=r),"content-loading":e(u)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o($,{label:n.$t("payments.customer"),error:e(i).currentPayment.customer_id.$error&&e(i).currentPayment.customer_id.$errors[0].$message,"content-loading":e(u),required:""},{default:l(()=>[o(oe,{modelValue:e(t).currentPayment.customer_id,"onUpdate:modelValue":[a[3]||(a[3]=r=>e(t).currentPayment.customer_id=r),a[4]||(a[4]=r=>ee(e(t).currentPayment.customer_id))],"content-loading":e(u),invalid:e(i).currentPayment.customer_id.$error,placeholder:n.$t("customers.select_a_customer"),"fetch-all":e(d),"show-action":""},null,8,["modelValue","content-loading","invalid","placeholder","fetch-all"])]),_:1},8,["label","error","content-loading"]),o($,{"content-loading":e(u),label:n.$t("payments.invoice"),"help-text":B.value?`Due Amount: ${e(t).currentPayment.maxPayableAmount/100}`:""},{default:l(()=>[o(x,{modelValue:e(t).currentPayment.invoice_id,"onUpdate:modelValue":a[5]||(a[5]=r=>e(t).currentPayment.invoice_id=r),"content-loading":e(u),"value-prop":"id","track-by":"invoice_number",label:"invoice_number",options:e(g),loading:e(S),placeholder:n.$t("invoices.select_invoice"),onSelect:W},{singlelabel:l(({value:r})=>[I("div",ze,f(r.invoice_number)+" ("+f(e(U).formatMoney(r.total,r.customer.currency))+") ",1)]),option:l(({option:r})=>[q(f(r.invoice_number)+" ("+f(e(U).formatMoney(r.total,r.customer.currency))+") ",1)]),_:1},8,["modelValue","content-loading","options","loading","placeholder"])]),_:1},8,["content-loading","label","help-text"]),o($,{label:n.$t("payments.amount"),"content-loading":e(u),error:e(i).currentPayment.amount.$error&&e(i).currentPayment.amount.$errors[0].$message,required:""},{default:l(()=>[I("div",Le,[o(re,{key:e(t).currentPayment.currency,modelValue:e(V),"onUpdate:modelValue":[a[6]||(a[6]=r=>Se(V)?V.value=r:null),a[7]||(a[7]=r=>e(i).currentPayment.amount.$touch())],currency:e(t).currentPayment.currency,"content-loading":e(u),invalid:e(i).currentPayment.amount.$error},null,8,["modelValue","currency","content-loading","invalid"])])]),_:1},8,["label","content-loading","error"]),o($,{"content-loading":e(u),label:n.$t("payments.payment_mode")},{default:l(()=>[o(x,{modelValue:e(t).currentPayment.payment_method_id,"onUpdate:modelValue":a[8]||(a[8]=r=>e(t).currentPayment.payment_method_id=r),"content-loading":e(u),label:"name","value-prop":"id","track-by":"name",options:e(t).paymentModes,placeholder:n.$t("payments.select_payment_mode"),searchable:""},{action:l(()=>[o(se,{onClick:J},{default:l(()=>[o(v,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),q(" "+f(n.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),o(we,{store:e(t),"store-prop":"currentPayment",v:e(i).currentPayment,"is-loading":e(u),"is-edit":e(d),"customer-currency":e(t).currentPayment.currency_id},null,8,["store","v","is-loading","is-edit","customer-currency"])]),_:1}),o(Fe,{type:"Payment","is-edit":e(d),"is-loading":e(u),store:e(t),"store-prop":"currentPayment","custom-field-scope":j,class:"mt-6"},null,8,["is-edit","is-loading","store"]),I("div",He,[I("div",Te,[o(Ee,{type:"Payment",onSelect:K})]),I("label",Oe,f(n.$t("estimates.notes")),1),o(ue,{modelValue:e(t).currentPayment.notes,"onUpdate:modelValue":a[9]||(a[9]=r=>e(t).currentPayment.notes=r),"content-loading":e(u),fields:e(O),class:"mt-1"},null,8,["modelValue","content-loading","fields"])]),o(D,{loading:e(P),"content-loading":e(u),variant:"primary",type:"submit",class:"flex justify-center w-full mt-4 sm:hidden md:hidden"},{left:l(r=>[e(P)?L("",!0):(k(),R(v,{key:0,name:"SaveIcon",class:z(r.class)},null,8,["class"]))]),default:l(()=>[q(" "+f(e(d)?n.$t("payments.update_payment"):n.$t("payments.save_payment")),1)]),_:1},8,["loading","content-loading"])]),_:1})],40,Re)]),_:1})],64)}}};export{tt as default};
diff --git a/public/build/assets/Create.abb63c0f.js b/public/build/assets/Create.9801dad3.js
similarity index 97%
rename from public/build/assets/Create.abb63c0f.js
rename to public/build/assets/Create.9801dad3.js
index d0cd0a002..60fa47960 100644
--- a/public/build/assets/Create.abb63c0f.js
+++ b/public/build/assets/Create.9801dad3.js
@@ -1 +1 @@
-var oe=Object.defineProperty,se=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var q=(u,e,r)=>e in u?oe(u,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[e]=r,b=(u,e)=>{for(var r in e||(e={}))re.call(e,r)&&q(u,r,e[r]);if(P)for(var r of P(e))ie.call(e,r)&&q(u,r,e[r]);return u},h=(u,e)=>se(u,le(e));import{g as me,u as ue,C as ce,i as x,k as p,m as T,n as de,p as pe,a4 as _e,q as ge,r as s,o as w,s as M,w as l,b as o,y as t,t as N,a0 as z,v as A,x as E,A as j,z as Ie,B as fe}from"./vendor.e9042f2c.js";import{p as ve,q as Be,g as be,c as $e,d as ye,e as Ve}from"./main.109918ee.js";import{_ as Se}from"./ItemUnitModal.fc91b43e.js";const he=["onSubmit"],Ce={setup(u){const e=ve(),r=Be(),$=be(),G=$e(),{t:_}=me(),y=ue(),L=ce(),D=ye(),I=x(!1),V=x(G.selectedCompanySettings.tax_per_item);let i=x(!1);e.$reset(),O();const v=p({get:()=>e.currentItem.price/100,set:n=>{e.currentItem.price=Math.round(n*100)}}),S=p({get:()=>{var n,a;return(a=(n=e==null?void 0:e.currentItem)==null?void 0:n.taxes)==null?void 0:a.map(d=>{if(d)return h(b({},d),{tax_type_id:d.id,tax_name:d.name+" ("+d.percent+"%)"})})},set:n=>{e.currentItem.taxes=n}}),B=p(()=>y.name==="items.edit"),C=p(()=>B.value?_("items.edit_item"):_("items.new_item")),R=p(()=>r.taxTypes.map(n=>h(b({},n),{tax_type_id:n.id,tax_name:n.name+" ("+n.percent+"%)"}))),Y=p(()=>V.value==="YES"),H=p(()=>({currentItem:{name:{required:T.withMessage(_("validation.required"),de),minLength:T.withMessage(_("validation.name_min_length",{count:3}),pe(3))},description:{maxLength:T.withMessage(_("validation.description_maxlength"),_e(65e3))}}})),c=ge(H,e);async function F(){$.openModal({title:_("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",size:"sm"})}async function O(){if(i.value=!0,await e.fetchItemUnits({limit:"all"}),D.hasAbilities(Ve.VIEW_TAX_TYPE)&&await r.fetchTaxTypes({limit:"all"}),B.value){let n=y.params.id;await e.fetchItem(n),e.currentItem.tax_per_item===1?V.value="YES":V.value="NO"}i.value=!1}async function W(){if(c.value.currentItem.$touch(),c.value.currentItem.$invalid)return!1;I.value=!0;try{let a=b({id:y.params.id},e.currentItem);e.currentItem&&e.currentItem.taxes&&(a.taxes=e.currentItem.taxes.map(g=>({tax_type_id:g.tax_type_id,amount:v.value*g.percent,percent:g.percent,name:g.name,collective_tax:0}))),await(B.value?e.updateItem:e.addItem)(a),I.value=!1,L.push("/admin/items"),n()}catch{I.value=!1;return}function n(){$.closeModal(),setTimeout(()=>{e.resetCurrentItem(),$.$reset(),c.value.$reset()},300)}}return(n,a)=>{const d=s("BaseBreadcrumbItem"),g=s("BaseBreadcrumb"),X=s("BasePageHeader"),J=s("BaseInput"),f=s("BaseInputGroup"),K=s("BaseMoney"),U=s("BaseIcon"),Q=s("BaseSelectAction"),k=s("BaseMultiselect"),Z=s("BaseTextarea"),ee=s("BaseButton"),te=s("BaseInputGrid"),ne=s("BaseCard"),ae=s("BasePage");return w(),M(ae,null,{default:l(()=>[o(X,{title:t(C)},{default:l(()=>[o(g,null,{default:l(()=>[o(d,{title:n.$t("general.home"),to:"dashboard"},null,8,["title"]),o(d,{title:n.$tc("items.item",2),to:"/admin/items"},null,8,["title"]),o(d,{title:t(C),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(Se),N("form",{class:"grid lg:grid-cols-2 mt-6",action:"submit",onSubmit:fe(W,["prevent"])},[o(ne,{class:"w-full"},{default:l(()=>[o(te,{layout:"one-column"},{default:l(()=>[o(f,{label:n.$t("items.name"),"content-loading":t(i),required:"",error:t(c).currentItem.name.$error&&t(c).currentItem.name.$errors[0].$message},{default:l(()=>[o(J,{modelValue:t(e).currentItem.name,"onUpdate:modelValue":a[0]||(a[0]=m=>t(e).currentItem.name=m),"content-loading":t(i),invalid:t(c).currentItem.name.$error,onInput:a[1]||(a[1]=m=>t(c).currentItem.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o(f,{label:n.$t("items.price"),"content-loading":t(i)},{default:l(()=>[o(K,{modelValue:t(v),"onUpdate:modelValue":a[2]||(a[2]=m=>z(v)?v.value=m:null),"content-loading":t(i)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(f,{"content-loading":t(i),label:n.$t("items.unit")},{default:l(()=>[o(k,{modelValue:t(e).currentItem.unit_id,"onUpdate:modelValue":a[3]||(a[3]=m=>t(e).currentItem.unit_id=m),"content-loading":t(i),label:"name",options:t(e).itemUnits,"value-prop":"id","can-deselect":!1,"can-clear":!1,placeholder:n.$t("items.select_a_unit"),searchable:"","track-by":"name"},{action:l(()=>[o(Q,{onClick:F},{default:l(()=>[o(U,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),A(" "+E(n.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),t(Y)?(w(),M(f,{key:0,label:n.$t("items.taxes"),"content-loading":t(i)},{default:l(()=>[o(k,{modelValue:t(S),"onUpdate:modelValue":a[4]||(a[4]=m=>z(S)?S.value=m:null),"content-loading":t(i),options:t(R),mode:"tags",label:"tax_name",class:"w-full","value-prop":"id","can-deselect":!1,"can-clear":!1,searchable:"","track-by":"tax_name",object:""},null,8,["modelValue","content-loading","options"])]),_:1},8,["label","content-loading"])):j("",!0),o(f,{label:n.$t("items.description"),"content-loading":t(i),error:t(c).currentItem.description.$error&&t(c).currentItem.description.$errors[0].$message},{default:l(()=>[o(Z,{modelValue:t(e).currentItem.description,"onUpdate:modelValue":a[5]||(a[5]=m=>t(e).currentItem.description=m),"content-loading":t(i),name:"description",row:2,rows:"2",onInput:a[6]||(a[6]=m=>t(c).currentItem.description.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading","error"]),N("div",null,[o(ee,{"content-loading":t(i),type:"submit",loading:I.value},{left:l(m=>[I.value?j("",!0):(w(),M(U,{key:0,name:"SaveIcon",class:Ie(m.class)},null,8,["class"]))]),default:l(()=>[A(" "+E(t(B)?n.$t("items.update_item"):n.$t("items.save_item")),1)]),_:1},8,["content-loading","loading"])])]),_:1})]),_:1})],40,he)]),_:1})}}};export{Ce as default};
+var oe=Object.defineProperty,se=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var q=(u,e,r)=>e in u?oe(u,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[e]=r,b=(u,e)=>{for(var r in e||(e={}))re.call(e,r)&&q(u,r,e[r]);if(P)for(var r of P(e))ie.call(e,r)&&q(u,r,e[r]);return u},h=(u,e)=>se(u,le(e));import{g as me,u as ue,C as ce,i as x,k as p,m as T,n as de,p as pe,a4 as _e,q as ge,r as s,o as w,s as M,w as l,b as o,y as t,t as N,a0 as z,v as A,x as E,A as j,z as Ie,B as fe}from"./vendor.e9042f2c.js";import{p as ve,q as Be,g as be,c as $e,d as ye,e as Ve}from"./main.366b2ac6.js";import{_ as Se}from"./ItemUnitModal.890b7b40.js";const he=["onSubmit"],Ce={setup(u){const e=ve(),r=Be(),$=be(),G=$e(),{t:_}=me(),y=ue(),L=ce(),D=ye(),I=x(!1),V=x(G.selectedCompanySettings.tax_per_item);let i=x(!1);e.$reset(),O();const v=p({get:()=>e.currentItem.price/100,set:n=>{e.currentItem.price=Math.round(n*100)}}),S=p({get:()=>{var n,a;return(a=(n=e==null?void 0:e.currentItem)==null?void 0:n.taxes)==null?void 0:a.map(d=>{if(d)return h(b({},d),{tax_type_id:d.id,tax_name:d.name+" ("+d.percent+"%)"})})},set:n=>{e.currentItem.taxes=n}}),B=p(()=>y.name==="items.edit"),C=p(()=>B.value?_("items.edit_item"):_("items.new_item")),R=p(()=>r.taxTypes.map(n=>h(b({},n),{tax_type_id:n.id,tax_name:n.name+" ("+n.percent+"%)"}))),Y=p(()=>V.value==="YES"),H=p(()=>({currentItem:{name:{required:T.withMessage(_("validation.required"),de),minLength:T.withMessage(_("validation.name_min_length",{count:3}),pe(3))},description:{maxLength:T.withMessage(_("validation.description_maxlength"),_e(65e3))}}})),c=ge(H,e);async function F(){$.openModal({title:_("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",size:"sm"})}async function O(){if(i.value=!0,await e.fetchItemUnits({limit:"all"}),D.hasAbilities(Ve.VIEW_TAX_TYPE)&&await r.fetchTaxTypes({limit:"all"}),B.value){let n=y.params.id;await e.fetchItem(n),e.currentItem.tax_per_item===1?V.value="YES":V.value="NO"}i.value=!1}async function W(){if(c.value.currentItem.$touch(),c.value.currentItem.$invalid)return!1;I.value=!0;try{let a=b({id:y.params.id},e.currentItem);e.currentItem&&e.currentItem.taxes&&(a.taxes=e.currentItem.taxes.map(g=>({tax_type_id:g.tax_type_id,amount:v.value*g.percent,percent:g.percent,name:g.name,collective_tax:0}))),await(B.value?e.updateItem:e.addItem)(a),I.value=!1,L.push("/admin/items"),n()}catch{I.value=!1;return}function n(){$.closeModal(),setTimeout(()=>{e.resetCurrentItem(),$.$reset(),c.value.$reset()},300)}}return(n,a)=>{const d=s("BaseBreadcrumbItem"),g=s("BaseBreadcrumb"),X=s("BasePageHeader"),J=s("BaseInput"),f=s("BaseInputGroup"),K=s("BaseMoney"),U=s("BaseIcon"),Q=s("BaseSelectAction"),k=s("BaseMultiselect"),Z=s("BaseTextarea"),ee=s("BaseButton"),te=s("BaseInputGrid"),ne=s("BaseCard"),ae=s("BasePage");return w(),M(ae,null,{default:l(()=>[o(X,{title:t(C)},{default:l(()=>[o(g,null,{default:l(()=>[o(d,{title:n.$t("general.home"),to:"dashboard"},null,8,["title"]),o(d,{title:n.$tc("items.item",2),to:"/admin/items"},null,8,["title"]),o(d,{title:t(C),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(Se),N("form",{class:"grid lg:grid-cols-2 mt-6",action:"submit",onSubmit:fe(W,["prevent"])},[o(ne,{class:"w-full"},{default:l(()=>[o(te,{layout:"one-column"},{default:l(()=>[o(f,{label:n.$t("items.name"),"content-loading":t(i),required:"",error:t(c).currentItem.name.$error&&t(c).currentItem.name.$errors[0].$message},{default:l(()=>[o(J,{modelValue:t(e).currentItem.name,"onUpdate:modelValue":a[0]||(a[0]=m=>t(e).currentItem.name=m),"content-loading":t(i),invalid:t(c).currentItem.name.$error,onInput:a[1]||(a[1]=m=>t(c).currentItem.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","content-loading","error"]),o(f,{label:n.$t("items.price"),"content-loading":t(i)},{default:l(()=>[o(K,{modelValue:t(v),"onUpdate:modelValue":a[2]||(a[2]=m=>z(v)?v.value=m:null),"content-loading":t(i)},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(f,{"content-loading":t(i),label:n.$t("items.unit")},{default:l(()=>[o(k,{modelValue:t(e).currentItem.unit_id,"onUpdate:modelValue":a[3]||(a[3]=m=>t(e).currentItem.unit_id=m),"content-loading":t(i),label:"name",options:t(e).itemUnits,"value-prop":"id","can-deselect":!1,"can-clear":!1,placeholder:n.$t("items.select_a_unit"),searchable:"","track-by":"name"},{action:l(()=>[o(Q,{onClick:F},{default:l(()=>[o(U,{name:"PlusIcon",class:"h-4 mr-2 -ml-2 text-center text-primary-400"}),A(" "+E(n.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),_:1},8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["content-loading","label"]),t(Y)?(w(),M(f,{key:0,label:n.$t("items.taxes"),"content-loading":t(i)},{default:l(()=>[o(k,{modelValue:t(S),"onUpdate:modelValue":a[4]||(a[4]=m=>z(S)?S.value=m:null),"content-loading":t(i),options:t(R),mode:"tags",label:"tax_name",class:"w-full","value-prop":"id","can-deselect":!1,"can-clear":!1,searchable:"","track-by":"tax_name",object:""},null,8,["modelValue","content-loading","options"])]),_:1},8,["label","content-loading"])):j("",!0),o(f,{label:n.$t("items.description"),"content-loading":t(i),error:t(c).currentItem.description.$error&&t(c).currentItem.description.$errors[0].$message},{default:l(()=>[o(Z,{modelValue:t(e).currentItem.description,"onUpdate:modelValue":a[5]||(a[5]=m=>t(e).currentItem.description=m),"content-loading":t(i),name:"description",row:2,rows:"2",onInput:a[6]||(a[6]=m=>t(c).currentItem.description.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading","error"]),N("div",null,[o(ee,{"content-loading":t(i),type:"submit",loading:I.value},{left:l(m=>[I.value?j("",!0):(w(),M(U,{key:0,name:"SaveIcon",class:Ie(m.class)},null,8,["class"]))]),default:l(()=>[A(" "+E(t(B)?n.$t("items.update_item"):n.$t("items.save_item")),1)]),_:1},8,["content-loading","loading"])])]),_:1})]),_:1})],40,he)]),_:1})}}};export{Ce as default};
diff --git a/public/build/assets/Create.7bc79e72.js b/public/build/assets/Create.af49a38d.js
similarity index 99%
rename from public/build/assets/Create.7bc79e72.js
rename to public/build/assets/Create.af49a38d.js
index 192850d2b..2e1b4d2a5 100644
--- a/public/build/assets/Create.7bc79e72.js
+++ b/public/build/assets/Create.af49a38d.js
@@ -1 +1 @@
-var ee=Object.defineProperty;var q=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var D=(C,t,c)=>t in C?ee(C,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):C[t]=c,j=(C,t)=>{for(var c in t||(t={}))te.call(t,c)&&D(C,c,t[c]);if(q)for(var c of q(t))ne.call(t,c)&&D(C,c,t[c]);return C};import{g as oe,C as le,u as re,i as G,k as h,m as b,n as N,p as P,a2 as se,a3 as ae,a4 as B,q as ie,r as m,o as $,s as S,w as a,t as p,b as o,z as T,v as A,x as _,y as e,A as w,c as E,B as ue}from"./vendor.e9042f2c.js";import{k as de,l as me,m as ce}from"./main.109918ee.js";import{_ as pe}from"./CreateCustomFields.e1e82659.js";const ge=["onSubmit"],be={class:"flex items-center justify-end"},Ce={class:"grid grid-cols-5 gap-4 mb-8"},_e={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},fe={class:"grid grid-cols-5 gap-4 mb-8"},$e={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ve={class:"space-y-6"},ye={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},ve={class:"p-1"},he={key:0,class:"grid grid-cols-5 gap-4 mb-8"},Be={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},we={class:"space-y-6"},Me={class:"grid grid-cols-5 gap-2 mb-8"},Ie={key:0,class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ue={class:"col-span-5 lg:col-span-4"},Fe={setup(C){const t=de(),c=me(),M=ce(),k="customFields",{t:g}=oe(),H=le(),R=re();let r=G(!1);const V=G(!1),f=h(()=>R.name==="customers.edit");let J=h(()=>t.isFetchingInitialSettings);const z=h(()=>f.value?g("customers.edit_customer"):g("customers.new_customer")),K=h(()=>({currentCustomer:{name:{required:b.withMessage(g("validation.required"),N),minLength:b.withMessage(g("validation.name_min_length",{count:3}),P(3))},prefix:{minLength:b.withMessage(g("validation.name_min_length",{count:3}),P(3))},currency_id:{required:b.withMessage(g("validation.required"),N)},email:{email:b.withMessage(g("validation.email_incorrect"),se)},website:{url:b.withMessage(g("validation.invalid_url"),ae)},billing:{address_street_1:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))},address_street_2:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))}},shipping:{address_street_1:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))},address_street_2:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))}}}})),i=ie(K,t,{$scope:k});t.resetCurrentCustomer(),t.fetchCustomerInitialSettings(f.value);async function O(){if(i.value.$touch(),i.value.$invalid)return!0;V.value=!0;let s=j({},t.currentCustomer),n=null;try{n=await(f.value?t.updateCustomer:t.addCustomer)(s)}catch{V.value=!1;return}H.push(`/admin/customers/${n.data.data.id}/view`)}return(s,n)=>{const y=m("BaseBreadcrumbItem"),Q=m("BaseBreadcrumb-item"),W=m("BaseBreadcrumb"),F=m("BaseIcon"),L=m("BaseButton"),X=m("BasePageHeader"),d=m("BaseInput"),u=m("BaseInputGroup"),I=m("BaseMultiselect"),U=m("BaseInputGrid"),x=m("BaseDivider"),v=m("BaseTextarea"),Y=m("BaseCard"),Z=m("BasePage");return $(),S(Z,null,{default:a(()=>[p("form",{onSubmit:ue(O,["prevent"])},[o(X,{title:e(z)},{actions:a(()=>[p("div",be,[o(L,{type:"submit",loading:V.value,disabled:V.value},{left:a(l=>[o(F,{name:"SaveIcon",class:T(l.class)},null,8,["class"])]),default:a(()=>[A(" "+_(e(f)?s.$t("customers.update_customer"):s.$t("customers.save_customer")),1)]),_:1},8,["loading","disabled"])])]),default:a(()=>[o(W,null,{default:a(()=>[o(y,{title:s.$t("general.home"),to:"dashboard"},null,8,["title"]),o(y,{title:s.$tc("customers.customer",2),to:"/admin/customers"},null,8,["title"]),o(Q,{title:e(z),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(Y,{class:"mt-5"},{default:a(()=>[p("div",Ce,[p("h6",_e,_(s.$t("customers.basic_info")),1),o(U,{class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{label:s.$t("customers.display_name"),required:"",error:e(i).currentCustomer.name.$error&&e(i).currentCustomer.name.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.name,"onUpdate:modelValue":n[0]||(n[0]=l=>e(t).currentCustomer.name=l),"content-loading":e(r),type:"text",name:"name",class:"",invalid:e(i).currentCustomer.name.$error,onInput:n[1]||(n[1]=l=>e(i).currentCustomer.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),o(u,{label:s.$t("customers.primary_contact_name"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.contact_name,"onUpdate:modelValue":n[2]||(n[2]=l=>e(t).currentCustomer.contact_name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{error:e(i).currentCustomer.email.$error&&e(i).currentCustomer.email.$errors[0].$message,"content-loading":e(r),label:s.$t("customers.email")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.email,"onUpdate:modelValue":n[3]||(n[3]=l=>e(t).currentCustomer.email=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"email",invalid:e(i).currentCustomer.email.$error,onInput:n[4]||(n[4]=l=>e(i).currentCustomer.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["error","content-loading","label"]),o(u,{label:s.$t("customers.phone"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.phone,"onUpdate:modelValue":n[5]||(n[5]=l=>e(t).currentCustomer.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.primary_currency"),"content-loading":e(r),error:e(i).currentCustomer.currency_id.$error&&e(i).currentCustomer.currency_id.$errors[0].$message,required:""},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.currency_id,"onUpdate:modelValue":n[6]||(n[6]=l=>e(t).currentCustomer.currency_id=l),"value-prop":"id",label:"name","track-by":"name","content-loading":e(r),options:e(M).currencies,searchable:"","can-deselect":!1,placeholder:s.$t("customers.select_currency"),invalid:e(i).currentCustomer.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),o(u,{error:e(i).currentCustomer.website.$error&&e(i).currentCustomer.website.$errors[0].$message,label:s.$t("customers.website"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.website,"onUpdate:modelValue":n[7]||(n[7]=l=>e(t).currentCustomer.website=l),"content-loading":e(r),type:"url",onInput:n[8]||(n[8]=l=>e(i).currentCustomer.website.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["error","label","content-loading"]),o(u,{label:s.$t("customers.prefix"),error:e(i).currentCustomer.prefix.$error&&e(i).currentCustomer.prefix.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.prefix,"onUpdate:modelValue":n[9]||(n[9]=l=>e(t).currentCustomer.prefix=l),"content-loading":e(r),type:"text",name:"name",class:"",invalid:e(i).currentCustomer.prefix.$error,onInput:n[10]||(n[10]=l=>e(i).currentCustomer.prefix.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"])]),_:1})]),o(x,{class:"mb-5 md:mb-8"}),p("div",fe,[p("h6",$e,_(s.$t("customers.billing_address")),1),e(t).currentCustomer.billing?($(),S(U,{key:0,class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{label:s.$t("customers.name"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.name,"onUpdate:modelValue":n[11]||(n[11]=l=>e(t).currentCustomer.billing.name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",class:"w-full",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.country"),"content-loading":e(r)},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.billing.country_id,"onUpdate:modelValue":n[12]||(n[12]=l=>e(t).currentCustomer.billing.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(r),options:e(M).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.state"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.state,"onUpdate:modelValue":n[13]||(n[13]=l=>e(t).currentCustomer.billing.state=l),"content-loading":e(r),name:"billing.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{"content-loading":e(r),label:s.$t("customers.city")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.city,"onUpdate:modelValue":n[14]||(n[14]=l=>e(t).currentCustomer.billing.city=l),"content-loading":e(r),name:"billing.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.address"),error:e(i).currentCustomer.billing.address_street_1.$error&&e(i).currentCustomer.billing.address_street_1.$errors[0].$message||e(i).currentCustomer.billing.address_street_2.$error&&e(i).currentCustomer.billing.address_street_2.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(v,{modelValue:e(t).currentCustomer.billing.address_street_1,"onUpdate:modelValue":n[15]||(n[15]=l=>e(t).currentCustomer.billing.address_street_1=l),modelModifiers:{trim:!0},"content-loading":e(r),placeholder:s.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3",onInput:n[16]||(n[16]=l=>e(i).currentCustomer.billing.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),o(v,{modelValue:e(t).currentCustomer.billing.address_street_2,"onUpdate:modelValue":n[17]||(n[17]=l=>e(t).currentCustomer.billing.address_street_2=l),modelModifiers:{trim:!0},"content-loading":e(r),placeholder:s.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3",onInput:n[18]||(n[18]=l=>e(i).currentCustomer.billing.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","error","content-loading"]),p("div",Ve,[o(u,{"content-loading":e(r),label:s.$t("customers.phone"),class:"text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.phone,"onUpdate:modelValue":n[19]||(n[19]=l=>e(t).currentCustomer.billing.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.zip_code"),"content-loading":e(r),class:"mt-2 text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.zip,"onUpdate:modelValue":n[20]||(n[20]=l=>e(t).currentCustomer.billing.zip=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})):w("",!0)]),o(x,{class:"mb-5 md:mb-8"}),p("div",ye,[p("div",ve,[o(L,{type:"button","content-loading":e(r),size:"sm",variant:"primary-outline",onClick:n[21]||(n[21]=l=>e(t).copyAddress(!0))},{left:a(l=>[o(F,{name:"DocumentDuplicateIcon",class:T(l.class)},null,8,["class"])]),default:a(()=>[A(" "+_(s.$t("customers.copy_billing_address")),1)]),_:1},8,["content-loading"])])]),e(t).currentCustomer.shipping?($(),E("div",he,[p("h6",Be,_(s.$t("customers.shipping_address")),1),o(U,{class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{"content-loading":e(r),label:s.$t("customers.name")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.name,"onUpdate:modelValue":n[22]||(n[22]=l=>e(t).currentCustomer.shipping.name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.country"),"content-loading":e(r)},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.shipping.country_id,"onUpdate:modelValue":n[23]||(n[23]=l=>e(t).currentCustomer.shipping.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(r),options:e(M).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.state"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.state,"onUpdate:modelValue":n[24]||(n[24]=l=>e(t).currentCustomer.shipping.state=l),"content-loading":e(r),name:"shipping.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{"content-loading":e(r),label:s.$t("customers.city")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.city,"onUpdate:modelValue":n[25]||(n[25]=l=>e(t).currentCustomer.shipping.city=l),"content-loading":e(r),name:"shipping.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.address"),"content-loading":e(r),error:e(i).currentCustomer.shipping.address_street_1.$error&&e(i).currentCustomer.shipping.address_street_1.$errors[0].$message||e(i).currentCustomer.shipping.address_street_2.$error&&e(i).currentCustomer.shipping.address_street_2.$errors[0].$message},{default:a(()=>[o(v,{modelValue:e(t).currentCustomer.shipping.address_street_1,"onUpdate:modelValue":n[26]||(n[26]=l=>e(t).currentCustomer.shipping.address_street_1=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",placeholder:s.$t("general.street_1"),name:"shipping_street1",onInput:n[27]||(n[27]=l=>e(i).currentCustomer.shipping.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),o(v,{modelValue:e(t).currentCustomer.shipping.address_street_2,"onUpdate:modelValue":n[28]||(n[28]=l=>e(t).currentCustomer.shipping.address_street_2=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",placeholder:s.$t("general.street_2"),name:"shipping_street2",class:"mt-3","container-class":"mt-3",onInput:n[29]||(n[29]=l=>e(i).currentCustomer.shipping.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","content-loading","error"]),p("div",we,[o(u,{"content-loading":e(r),label:s.$t("customers.phone"),class:"text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.phone,"onUpdate:modelValue":n[30]||(n[30]=l=>e(t).currentCustomer.shipping.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.zip_code"),"content-loading":e(r),class:"mt-2 text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.zip,"onUpdate:modelValue":n[31]||(n[31]=l=>e(t).currentCustomer.shipping.zip=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})])):w("",!0),e(c).customFields.length>0?($(),S(x,{key:1,class:"mb-5 md:mb-8"})):w("",!0),p("div",Me,[e(c).customFields.length>0?($(),E("h6",Ie,_(s.$t("settings.custom_fields.title")),1)):w("",!0),p("div",Ue,[o(pe,{type:"Customer",store:e(t),"store-prop":"currentCustomer","is-edit":e(f),"is-loading":e(J),"custom-field-scope":k},null,8,["store","is-edit","is-loading"])])])]),_:1})],40,ge)]),_:1})}}};export{Fe as default};
+var ee=Object.defineProperty;var q=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var D=(C,t,c)=>t in C?ee(C,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):C[t]=c,j=(C,t)=>{for(var c in t||(t={}))te.call(t,c)&&D(C,c,t[c]);if(q)for(var c of q(t))ne.call(t,c)&&D(C,c,t[c]);return C};import{g as oe,C as le,u as re,i as G,k as h,m as b,n as N,p as P,a2 as se,a3 as ae,a4 as B,q as ie,r as m,o as $,s as S,w as a,t as p,b as o,z as T,v as A,x as _,y as e,A as w,c as E,B as ue}from"./vendor.e9042f2c.js";import{k as de,l as me,m as ce}from"./main.366b2ac6.js";import{_ as pe}from"./CreateCustomFields.2a9ca04b.js";const ge=["onSubmit"],be={class:"flex items-center justify-end"},Ce={class:"grid grid-cols-5 gap-4 mb-8"},_e={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},fe={class:"grid grid-cols-5 gap-4 mb-8"},$e={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ve={class:"space-y-6"},ye={class:"flex items-center justify-start mb-6 md:justify-end md:mb-0"},ve={class:"p-1"},he={key:0,class:"grid grid-cols-5 gap-4 mb-8"},Be={class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},we={class:"space-y-6"},Me={class:"grid grid-cols-5 gap-2 mb-8"},Ie={key:0,class:"col-span-5 text-lg font-semibold text-left lg:col-span-1"},Ue={class:"col-span-5 lg:col-span-4"},Fe={setup(C){const t=de(),c=me(),M=ce(),k="customFields",{t:g}=oe(),H=le(),R=re();let r=G(!1);const V=G(!1),f=h(()=>R.name==="customers.edit");let J=h(()=>t.isFetchingInitialSettings);const z=h(()=>f.value?g("customers.edit_customer"):g("customers.new_customer")),K=h(()=>({currentCustomer:{name:{required:b.withMessage(g("validation.required"),N),minLength:b.withMessage(g("validation.name_min_length",{count:3}),P(3))},prefix:{minLength:b.withMessage(g("validation.name_min_length",{count:3}),P(3))},currency_id:{required:b.withMessage(g("validation.required"),N)},email:{email:b.withMessage(g("validation.email_incorrect"),se)},website:{url:b.withMessage(g("validation.invalid_url"),ae)},billing:{address_street_1:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))},address_street_2:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))}},shipping:{address_street_1:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))},address_street_2:{maxLength:b.withMessage(g("validation.address_maxlength",{count:255}),B(255))}}}})),i=ie(K,t,{$scope:k});t.resetCurrentCustomer(),t.fetchCustomerInitialSettings(f.value);async function O(){if(i.value.$touch(),i.value.$invalid)return!0;V.value=!0;let s=j({},t.currentCustomer),n=null;try{n=await(f.value?t.updateCustomer:t.addCustomer)(s)}catch{V.value=!1;return}H.push(`/admin/customers/${n.data.data.id}/view`)}return(s,n)=>{const y=m("BaseBreadcrumbItem"),Q=m("BaseBreadcrumb-item"),W=m("BaseBreadcrumb"),F=m("BaseIcon"),L=m("BaseButton"),X=m("BasePageHeader"),d=m("BaseInput"),u=m("BaseInputGroup"),I=m("BaseMultiselect"),U=m("BaseInputGrid"),x=m("BaseDivider"),v=m("BaseTextarea"),Y=m("BaseCard"),Z=m("BasePage");return $(),S(Z,null,{default:a(()=>[p("form",{onSubmit:ue(O,["prevent"])},[o(X,{title:e(z)},{actions:a(()=>[p("div",be,[o(L,{type:"submit",loading:V.value,disabled:V.value},{left:a(l=>[o(F,{name:"SaveIcon",class:T(l.class)},null,8,["class"])]),default:a(()=>[A(" "+_(e(f)?s.$t("customers.update_customer"):s.$t("customers.save_customer")),1)]),_:1},8,["loading","disabled"])])]),default:a(()=>[o(W,null,{default:a(()=>[o(y,{title:s.$t("general.home"),to:"dashboard"},null,8,["title"]),o(y,{title:s.$tc("customers.customer",2),to:"/admin/customers"},null,8,["title"]),o(Q,{title:e(z),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),o(Y,{class:"mt-5"},{default:a(()=>[p("div",Ce,[p("h6",_e,_(s.$t("customers.basic_info")),1),o(U,{class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{label:s.$t("customers.display_name"),required:"",error:e(i).currentCustomer.name.$error&&e(i).currentCustomer.name.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.name,"onUpdate:modelValue":n[0]||(n[0]=l=>e(t).currentCustomer.name=l),"content-loading":e(r),type:"text",name:"name",class:"",invalid:e(i).currentCustomer.name.$error,onInput:n[1]||(n[1]=l=>e(i).currentCustomer.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"]),o(u,{label:s.$t("customers.primary_contact_name"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.contact_name,"onUpdate:modelValue":n[2]||(n[2]=l=>e(t).currentCustomer.contact_name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{error:e(i).currentCustomer.email.$error&&e(i).currentCustomer.email.$errors[0].$message,"content-loading":e(r),label:s.$t("customers.email")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.email,"onUpdate:modelValue":n[3]||(n[3]=l=>e(t).currentCustomer.email=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"email",invalid:e(i).currentCustomer.email.$error,onInput:n[4]||(n[4]=l=>e(i).currentCustomer.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["error","content-loading","label"]),o(u,{label:s.$t("customers.phone"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.phone,"onUpdate:modelValue":n[5]||(n[5]=l=>e(t).currentCustomer.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.primary_currency"),"content-loading":e(r),error:e(i).currentCustomer.currency_id.$error&&e(i).currentCustomer.currency_id.$errors[0].$message,required:""},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.currency_id,"onUpdate:modelValue":n[6]||(n[6]=l=>e(t).currentCustomer.currency_id=l),"value-prop":"id",label:"name","track-by":"name","content-loading":e(r),options:e(M).currencies,searchable:"","can-deselect":!1,placeholder:s.$t("customers.select_currency"),invalid:e(i).currentCustomer.currency_id.$error,class:"w-full"},null,8,["modelValue","content-loading","options","placeholder","invalid"])]),_:1},8,["label","content-loading","error"]),o(u,{error:e(i).currentCustomer.website.$error&&e(i).currentCustomer.website.$errors[0].$message,label:s.$t("customers.website"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.website,"onUpdate:modelValue":n[7]||(n[7]=l=>e(t).currentCustomer.website=l),"content-loading":e(r),type:"url",onInput:n[8]||(n[8]=l=>e(i).currentCustomer.website.$touch())},null,8,["modelValue","content-loading"])]),_:1},8,["error","label","content-loading"]),o(u,{label:s.$t("customers.prefix"),error:e(i).currentCustomer.prefix.$error&&e(i).currentCustomer.prefix.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.prefix,"onUpdate:modelValue":n[9]||(n[9]=l=>e(t).currentCustomer.prefix=l),"content-loading":e(r),type:"text",name:"name",class:"",invalid:e(i).currentCustomer.prefix.$error,onInput:n[10]||(n[10]=l=>e(i).currentCustomer.prefix.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["label","error","content-loading"])]),_:1})]),o(x,{class:"mb-5 md:mb-8"}),p("div",fe,[p("h6",$e,_(s.$t("customers.billing_address")),1),e(t).currentCustomer.billing?($(),S(U,{key:0,class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{label:s.$t("customers.name"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.name,"onUpdate:modelValue":n[11]||(n[11]=l=>e(t).currentCustomer.billing.name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",class:"w-full",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.country"),"content-loading":e(r)},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.billing.country_id,"onUpdate:modelValue":n[12]||(n[12]=l=>e(t).currentCustomer.billing.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(r),options:e(M).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.state"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.state,"onUpdate:modelValue":n[13]||(n[13]=l=>e(t).currentCustomer.billing.state=l),"content-loading":e(r),name:"billing.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{"content-loading":e(r),label:s.$t("customers.city")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.city,"onUpdate:modelValue":n[14]||(n[14]=l=>e(t).currentCustomer.billing.city=l),"content-loading":e(r),name:"billing.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.address"),error:e(i).currentCustomer.billing.address_street_1.$error&&e(i).currentCustomer.billing.address_street_1.$errors[0].$message||e(i).currentCustomer.billing.address_street_2.$error&&e(i).currentCustomer.billing.address_street_2.$errors[0].$message,"content-loading":e(r)},{default:a(()=>[o(v,{modelValue:e(t).currentCustomer.billing.address_street_1,"onUpdate:modelValue":n[15]||(n[15]=l=>e(t).currentCustomer.billing.address_street_1=l),modelModifiers:{trim:!0},"content-loading":e(r),placeholder:s.$t("general.street_1"),type:"text",name:"billing_street1","container-class":"mt-3",onInput:n[16]||(n[16]=l=>e(i).currentCustomer.billing.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),o(v,{modelValue:e(t).currentCustomer.billing.address_street_2,"onUpdate:modelValue":n[17]||(n[17]=l=>e(t).currentCustomer.billing.address_street_2=l),modelModifiers:{trim:!0},"content-loading":e(r),placeholder:s.$t("general.street_2"),type:"text",class:"mt-3",name:"billing_street2","container-class":"mt-3",onInput:n[18]||(n[18]=l=>e(i).currentCustomer.billing.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","error","content-loading"]),p("div",Ve,[o(u,{"content-loading":e(r),label:s.$t("customers.phone"),class:"text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.phone,"onUpdate:modelValue":n[19]||(n[19]=l=>e(t).currentCustomer.billing.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.zip_code"),"content-loading":e(r),class:"mt-2 text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.billing.zip,"onUpdate:modelValue":n[20]||(n[20]=l=>e(t).currentCustomer.billing.zip=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})):w("",!0)]),o(x,{class:"mb-5 md:mb-8"}),p("div",ye,[p("div",ve,[o(L,{type:"button","content-loading":e(r),size:"sm",variant:"primary-outline",onClick:n[21]||(n[21]=l=>e(t).copyAddress(!0))},{left:a(l=>[o(F,{name:"DocumentDuplicateIcon",class:T(l.class)},null,8,["class"])]),default:a(()=>[A(" "+_(s.$t("customers.copy_billing_address")),1)]),_:1},8,["content-loading"])])]),e(t).currentCustomer.shipping?($(),E("div",he,[p("h6",Be,_(s.$t("customers.shipping_address")),1),o(U,{class:"col-span-5 lg:col-span-4"},{default:a(()=>[o(u,{"content-loading":e(r),label:s.$t("customers.name")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.name,"onUpdate:modelValue":n[22]||(n[22]=l=>e(t).currentCustomer.shipping.name=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"address_name"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.country"),"content-loading":e(r)},{default:a(()=>[o(I,{modelValue:e(t).currentCustomer.shipping.country_id,"onUpdate:modelValue":n[23]||(n[23]=l=>e(t).currentCustomer.shipping.country_id=l),"value-prop":"id",label:"name","track-by":"name","resolve-on-load":"",searchable:"","content-loading":e(r),options:e(M).countries,placeholder:s.$t("general.select_country"),class:"w-full"},null,8,["modelValue","content-loading","options","placeholder"])]),_:1},8,["label","content-loading"]),o(u,{label:s.$t("customers.state"),"content-loading":e(r)},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.state,"onUpdate:modelValue":n[24]||(n[24]=l=>e(t).currentCustomer.shipping.state=l),"content-loading":e(r),name:"shipping.state",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"]),o(u,{"content-loading":e(r),label:s.$t("customers.city")},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.city,"onUpdate:modelValue":n[25]||(n[25]=l=>e(t).currentCustomer.shipping.city=l),"content-loading":e(r),name:"shipping.city",type:"text"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.address"),"content-loading":e(r),error:e(i).currentCustomer.shipping.address_street_1.$error&&e(i).currentCustomer.shipping.address_street_1.$errors[0].$message||e(i).currentCustomer.shipping.address_street_2.$error&&e(i).currentCustomer.shipping.address_street_2.$errors[0].$message},{default:a(()=>[o(v,{modelValue:e(t).currentCustomer.shipping.address_street_1,"onUpdate:modelValue":n[26]||(n[26]=l=>e(t).currentCustomer.shipping.address_street_1=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",placeholder:s.$t("general.street_1"),name:"shipping_street1",onInput:n[27]||(n[27]=l=>e(i).currentCustomer.shipping.address_street_1.$touch())},null,8,["modelValue","content-loading","placeholder"]),o(v,{modelValue:e(t).currentCustomer.shipping.address_street_2,"onUpdate:modelValue":n[28]||(n[28]=l=>e(t).currentCustomer.shipping.address_street_2=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",placeholder:s.$t("general.street_2"),name:"shipping_street2",class:"mt-3","container-class":"mt-3",onInput:n[29]||(n[29]=l=>e(i).currentCustomer.shipping.address_street_2.$touch())},null,8,["modelValue","content-loading","placeholder"])]),_:1},8,["label","content-loading","error"]),p("div",we,[o(u,{"content-loading":e(r),label:s.$t("customers.phone"),class:"text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.phone,"onUpdate:modelValue":n[30]||(n[30]=l=>e(t).currentCustomer.shipping.phone=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"phone"},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"]),o(u,{label:s.$t("customers.zip_code"),"content-loading":e(r),class:"mt-2 text-left"},{default:a(()=>[o(d,{modelValue:e(t).currentCustomer.shipping.zip,"onUpdate:modelValue":n[31]||(n[31]=l=>e(t).currentCustomer.shipping.zip=l),modelModifiers:{trim:!0},"content-loading":e(r),type:"text",name:"zip"},null,8,["modelValue","content-loading"])]),_:1},8,["label","content-loading"])])]),_:1})])):w("",!0),e(c).customFields.length>0?($(),S(x,{key:1,class:"mb-5 md:mb-8"})):w("",!0),p("div",Me,[e(c).customFields.length>0?($(),E("h6",Ie,_(s.$t("settings.custom_fields.title")),1)):w("",!0),p("div",Ue,[o(pe,{type:"Customer",store:e(t),"store-prop":"currentCustomer","is-edit":e(f),"is-loading":e(J),"custom-field-scope":k},null,8,["store","is-edit","is-loading"])])])]),_:1})],40,ge)]),_:1})}}};export{Fe as default};
diff --git a/public/build/assets/Create.58d81074.js b/public/build/assets/Create.cae44ec2.js
similarity index 98%
rename from public/build/assets/Create.58d81074.js
rename to public/build/assets/Create.cae44ec2.js
index 93241e8bd..3bab06709 100644
--- a/public/build/assets/Create.58d81074.js
+++ b/public/build/assets/Create.cae44ec2.js
@@ -1 +1 @@
-var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var k=(m,a,o)=>a in m?W(m,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):m[a]=o,G=(m,a)=>{for(var o in a||(a={}))Z.call(a,o)&&k(m,o,a[o]);if(S)for(var o of S(a))x.call(a,o)&&k(m,o,a[o]);return m},L=(m,a)=>X(m,Y(a));import{g as ee,u as ae,C as te,i as w,k as V,m as p,n as $,p as N,a2 as oe,aU as se,q as ne,r as d,o as b,s as h,w as i,b as s,y as e,t as q,c as re,H as le,V as ue,F as ie,z as de,A as me,v as ce,x as pe,B as ge}from"./vendor.e9042f2c.js";import{A as fe,c as ve}from"./main.109918ee.js";const $e=["onSubmit"],De={class:"grid grid-cols-12"},Be={class:"space-y-6"},Ve={setup(m){const a=fe(),{t:o}=ee(),y=ae(),P=te(),j=ve();let g=w(!1),l=w(!1);w([]);let I=w([]);const f=V(()=>y.name==="users.edit"),U=V(()=>f.value?o("users.edit_user"):o("users.new_user")),A=V(()=>({userData:{name:{required:p.withMessage(o("validation.required"),$),minLength:p.withMessage(o("validation.name_min_length",{count:3}),N(3))},email:{required:p.withMessage(o("validation.required"),$),email:p.withMessage(o("validation.email_incorrect"),oe)},password:{required:se(function(){return p.withMessage(o("validation.required"),$),!f.value}),minLength:p.withMessage(o("validation.password_min_length",{count:8}),N(8))},companies:{required:p.withMessage(o("validation.required"),$)}}})),E={role:{required:p.withMessage(o("validation.required"),$)}},n=ne(A,a,{$scope:!0});F(),a.resetUserData();async function F(){var u;l.value=!0;try{f.value&&await a.fetchUser(y.params.id);let t=await j.fetchUserCompanies();((u=t==null?void 0:t.data)==null?void 0:u.data)&&(I.value=t.data.data.map(c=>(c.role=null,c)))}catch{l.value=!1}l.value=!1}async function H(){if(n.value.$touch(),n.value.$invalid)return!0;try{g.value=!0;let u=L(G({},a.userData),{companies:a.userData.companies.map(c=>({role:c.role,id:c.id}))});await(f.value?a.updateUser:a.addUser)(u),P.push("/admin/users"),g.value=!1}catch{g.value=!1}}return(u,t)=>{const c=d("BaseBreadcrumbItem"),R=d("BaseBreadcrumb"),z=d("BasePageHeader"),D=d("BaseInput"),v=d("BaseInputGroup"),M=d("BaseMultiselect"),T=d("BaseInputGrid"),J=d("BaseIcon"),K=d("BaseButton"),O=d("BaseCard"),Q=d("BasePage");return b(),h(Q,null,{default:i(()=>[s(z,{title:e(U)},{default:i(()=>[s(R,null,{default:i(()=>[s(c,{title:u.$t("general.home"),to:"dashboard"},null,8,["title"]),s(c,{title:u.$tc("users.user",2),to:"/admin/users"},null,8,["title"]),s(c,{title:e(U),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),q("form",{action:"",autocomplete:"off",onSubmit:ge(H,["prevent"])},[q("div",De,[s(O,{class:"mt-6 col-span-12 md:col-span-8"},{default:i(()=>[s(T,{layout:"one-column"},{default:i(()=>[s(v,{"content-loading":e(l),label:u.$t("users.name"),error:e(n).userData.name.$error&&e(n).userData.name.$errors[0].$message,required:""},{default:i(()=>[s(D,{modelValue:e(a).userData.name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(a).userData.name=r),modelModifiers:{trim:!0},"content-loading":e(l),invalid:e(n).userData.name.$error,onInput:t[1]||(t[1]=r=>e(n).userData.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:u.$t("users.email"),error:e(n).userData.email.$error&&e(n).userData.email.$errors[0].$message,required:""},{default:i(()=>[s(D,{modelValue:e(a).userData.email,"onUpdate:modelValue":t[2]||(t[2]=r=>e(a).userData.email=r),modelModifiers:{trim:!0},type:"email","content-loading":e(l),invalid:e(n).userData.email.$error,onInput:t[3]||(t[3]=r=>e(n).userData.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:u.$t("users.companies"),error:e(n).userData.companies.$error&&e(n).userData.companies.$errors[0].$message,required:""},{default:i(()=>[s(M,{modelValue:e(a).userData.companies,"onUpdate:modelValue":t[4]||(t[4]=r=>e(a).userData.companies=r),mode:"tags",object:!0,autocomplete:"new-password",label:"name",options:e(I),"value-prop":"id",invalid:e(n).userData.companies.$error,"content-loading":e(l),searchable:"","can-deselect":!1,class:"w-full"},null,8,["modelValue","options","invalid","content-loading"])]),_:1},8,["content-loading","label","error"]),(b(!0),re(ie,null,le(e(a).userData.companies,(r,B)=>(b(),h(e(ue),{key:B,state:r,rules:E},{default:i(({v:_})=>[q("div",Be,[s(v,{"content-loading":e(l),label:u.$t("users.select_company_role",{company:r.name}),error:_.role.$error&&_.role.$errors[0].$message,required:""},{default:i(()=>[s(M,{modelValue:e(a).userData.companies[B].role,"onUpdate:modelValue":C=>e(a).userData.companies[B].role=C,"value-prop":"name","track-by":"id",autocomplete:"off","content-loading":e(l),label:"name",options:e(a).userData.companies[B].roles,"can-deselect":!1,invalid:_.role.$invalid,onChange:C=>_.role.$touch()},null,8,["modelValue","onUpdate:modelValue","content-loading","options","invalid","onChange"])]),_:2},1032,["content-loading","label","error"])])]),_:2},1032,["state"]))),128)),s(v,{"content-loading":e(l),label:u.$tc("users.password"),error:e(n).userData.password.$error&&e(n).userData.password.$errors[0].$message,required:!e(f)},{default:i(()=>[s(D,{modelValue:e(a).userData.password,"onUpdate:modelValue":t[5]||(t[5]=r=>e(a).userData.password=r),name:"new-password",autocomplete:"new-password","content-loading":e(l),type:"password",invalid:e(n).userData.password.$error,onInput:t[6]||(t[6]=r=>e(n).userData.password.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error","required"]),s(v,{"content-loading":e(l),label:u.$t("users.phone")},{default:i(()=>[s(D,{modelValue:e(a).userData.phone,"onUpdate:modelValue":t[7]||(t[7]=r=>e(a).userData.phone=r),modelModifiers:{trim:!0},"content-loading":e(l)},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"])]),_:1}),s(K,{"content-loading":e(l),type:"submit",loading:e(g),disabled:e(g),class:"mt-6"},{left:i(r=>[e(g)?me("",!0):(b(),h(J,{key:0,name:"SaveIcon",class:de(r.class)},null,8,["class"]))]),default:i(()=>[ce(" "+pe(e(f)?u.$t("users.update_user"):u.$t("users.save_user")),1)]),_:1},8,["content-loading","loading","disabled"])]),_:1})])],40,$e)]),_:1})}}};export{Ve as default};
+var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var k=(m,a,o)=>a in m?W(m,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):m[a]=o,G=(m,a)=>{for(var o in a||(a={}))Z.call(a,o)&&k(m,o,a[o]);if(S)for(var o of S(a))x.call(a,o)&&k(m,o,a[o]);return m},L=(m,a)=>X(m,Y(a));import{g as ee,u as ae,C as te,i as w,k as V,m as p,n as $,p as N,a2 as oe,aU as se,q as ne,r as d,o as b,s as h,w as i,b as s,y as e,t as q,c as re,H as le,V as ue,F as ie,z as de,A as me,v as ce,x as pe,B as ge}from"./vendor.e9042f2c.js";import{A as fe,c as ve}from"./main.366b2ac6.js";const $e=["onSubmit"],De={class:"grid grid-cols-12"},Be={class:"space-y-6"},Ve={setup(m){const a=fe(),{t:o}=ee(),y=ae(),P=te(),j=ve();let g=w(!1),l=w(!1);w([]);let I=w([]);const f=V(()=>y.name==="users.edit"),U=V(()=>f.value?o("users.edit_user"):o("users.new_user")),A=V(()=>({userData:{name:{required:p.withMessage(o("validation.required"),$),minLength:p.withMessage(o("validation.name_min_length",{count:3}),N(3))},email:{required:p.withMessage(o("validation.required"),$),email:p.withMessage(o("validation.email_incorrect"),oe)},password:{required:se(function(){return p.withMessage(o("validation.required"),$),!f.value}),minLength:p.withMessage(o("validation.password_min_length",{count:8}),N(8))},companies:{required:p.withMessage(o("validation.required"),$)}}})),E={role:{required:p.withMessage(o("validation.required"),$)}},n=ne(A,a,{$scope:!0});F(),a.resetUserData();async function F(){var u;l.value=!0;try{f.value&&await a.fetchUser(y.params.id);let t=await j.fetchUserCompanies();((u=t==null?void 0:t.data)==null?void 0:u.data)&&(I.value=t.data.data.map(c=>(c.role=null,c)))}catch{l.value=!1}l.value=!1}async function H(){if(n.value.$touch(),n.value.$invalid)return!0;try{g.value=!0;let u=L(G({},a.userData),{companies:a.userData.companies.map(c=>({role:c.role,id:c.id}))});await(f.value?a.updateUser:a.addUser)(u),P.push("/admin/users"),g.value=!1}catch{g.value=!1}}return(u,t)=>{const c=d("BaseBreadcrumbItem"),R=d("BaseBreadcrumb"),z=d("BasePageHeader"),D=d("BaseInput"),v=d("BaseInputGroup"),M=d("BaseMultiselect"),T=d("BaseInputGrid"),J=d("BaseIcon"),K=d("BaseButton"),O=d("BaseCard"),Q=d("BasePage");return b(),h(Q,null,{default:i(()=>[s(z,{title:e(U)},{default:i(()=>[s(R,null,{default:i(()=>[s(c,{title:u.$t("general.home"),to:"dashboard"},null,8,["title"]),s(c,{title:u.$tc("users.user",2),to:"/admin/users"},null,8,["title"]),s(c,{title:e(U),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),q("form",{action:"",autocomplete:"off",onSubmit:ge(H,["prevent"])},[q("div",De,[s(O,{class:"mt-6 col-span-12 md:col-span-8"},{default:i(()=>[s(T,{layout:"one-column"},{default:i(()=>[s(v,{"content-loading":e(l),label:u.$t("users.name"),error:e(n).userData.name.$error&&e(n).userData.name.$errors[0].$message,required:""},{default:i(()=>[s(D,{modelValue:e(a).userData.name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(a).userData.name=r),modelModifiers:{trim:!0},"content-loading":e(l),invalid:e(n).userData.name.$error,onInput:t[1]||(t[1]=r=>e(n).userData.name.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:u.$t("users.email"),error:e(n).userData.email.$error&&e(n).userData.email.$errors[0].$message,required:""},{default:i(()=>[s(D,{modelValue:e(a).userData.email,"onUpdate:modelValue":t[2]||(t[2]=r=>e(a).userData.email=r),modelModifiers:{trim:!0},type:"email","content-loading":e(l),invalid:e(n).userData.email.$error,onInput:t[3]||(t[3]=r=>e(n).userData.email.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error"]),s(v,{"content-loading":e(l),label:u.$t("users.companies"),error:e(n).userData.companies.$error&&e(n).userData.companies.$errors[0].$message,required:""},{default:i(()=>[s(M,{modelValue:e(a).userData.companies,"onUpdate:modelValue":t[4]||(t[4]=r=>e(a).userData.companies=r),mode:"tags",object:!0,autocomplete:"new-password",label:"name",options:e(I),"value-prop":"id",invalid:e(n).userData.companies.$error,"content-loading":e(l),searchable:"","can-deselect":!1,class:"w-full"},null,8,["modelValue","options","invalid","content-loading"])]),_:1},8,["content-loading","label","error"]),(b(!0),re(ie,null,le(e(a).userData.companies,(r,B)=>(b(),h(e(ue),{key:B,state:r,rules:E},{default:i(({v:_})=>[q("div",Be,[s(v,{"content-loading":e(l),label:u.$t("users.select_company_role",{company:r.name}),error:_.role.$error&&_.role.$errors[0].$message,required:""},{default:i(()=>[s(M,{modelValue:e(a).userData.companies[B].role,"onUpdate:modelValue":C=>e(a).userData.companies[B].role=C,"value-prop":"name","track-by":"id",autocomplete:"off","content-loading":e(l),label:"name",options:e(a).userData.companies[B].roles,"can-deselect":!1,invalid:_.role.$invalid,onChange:C=>_.role.$touch()},null,8,["modelValue","onUpdate:modelValue","content-loading","options","invalid","onChange"])]),_:2},1032,["content-loading","label","error"])])]),_:2},1032,["state"]))),128)),s(v,{"content-loading":e(l),label:u.$tc("users.password"),error:e(n).userData.password.$error&&e(n).userData.password.$errors[0].$message,required:!e(f)},{default:i(()=>[s(D,{modelValue:e(a).userData.password,"onUpdate:modelValue":t[5]||(t[5]=r=>e(a).userData.password=r),name:"new-password",autocomplete:"new-password","content-loading":e(l),type:"password",invalid:e(n).userData.password.$error,onInput:t[6]||(t[6]=r=>e(n).userData.password.$touch())},null,8,["modelValue","content-loading","invalid"])]),_:1},8,["content-loading","label","error","required"]),s(v,{"content-loading":e(l),label:u.$t("users.phone")},{default:i(()=>[s(D,{modelValue:e(a).userData.phone,"onUpdate:modelValue":t[7]||(t[7]=r=>e(a).userData.phone=r),modelModifiers:{trim:!0},"content-loading":e(l)},null,8,["modelValue","content-loading"])]),_:1},8,["content-loading","label"])]),_:1}),s(K,{"content-loading":e(l),type:"submit",loading:e(g),disabled:e(g),class:"mt-6"},{left:i(r=>[e(g)?me("",!0):(b(),h(J,{key:0,name:"SaveIcon",class:de(r.class)},null,8,["class"]))]),default:i(()=>[ce(" "+pe(e(f)?u.$t("users.update_user"):u.$t("users.save_user")),1)]),_:1},8,["content-loading","loading","disabled"])]),_:1})])],40,$e)]),_:1})}}};export{Ve as default};
diff --git a/public/build/assets/CreateCustomFields.e1e82659.js b/public/build/assets/CreateCustomFields.2a9ca04b.js
similarity index 90%
rename from public/build/assets/CreateCustomFields.e1e82659.js
rename to public/build/assets/CreateCustomFields.2a9ca04b.js
index 5c8e083b1..9e00181f8 100644
--- a/public/build/assets/CreateCustomFields.e1e82659.js
+++ b/public/build/assets/CreateCustomFields.2a9ca04b.js
@@ -1 +1 @@
-var D=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&f(e,r,t[r]);if(y)for(var r of y(t))h.call(t,r)&&f(e,r,t[r]);return e},v=(e,t)=>I(e,g(t));import{g as w,m as V,aU as j,q as F,k as T,aJ as L,r as E,o as n,s as m,w as P,an as A,y as c,f as S,D as x,c as b,b as O,F as R,H as k,A as B,h as C}from"./vendor.e9042f2c.js";import{n as i,l as Y}from"./main.109918ee.js";function $(e){switch(e){case"./types/DateTimeType.vue":return i(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"./types/DateType.vue":return i(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"./types/DropdownType.vue":return i(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"./types/InputType.vue":return i(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"./types/NumberType.vue":return i(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"./types/PhoneType.vue":return i(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"./types/SwitchType.vue":return i(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"./types/TextAreaType.vue":return i(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"./types/TimeType.vue":return i(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"./types/UrlType.vue":return i(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(t,r){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}const M={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:r}=w(),l={value:{required:V.withMessage(r("validation.required"),j(t.field.is_required))}},a=F(l,T(()=>t.field),{$scope:t.customFieldScope}),o=T(()=>t.field.type?L(()=>$(`./types/${t.field.type}Type.vue`)):!1);return(u,s)=>{const d=E("BaseInputGroup");return n(),m(d,{label:e.field.label,required:!!e.field.is_required,error:c(a).value.$error&&c(a).value.$errors[0].$message},{default:P(()=>[(n(),m(A(c(o)),{modelValue:e.field.value,"onUpdate:modelValue":s[0]||(s[0]=p=>e.field.value=p),options:e.field.options,invalid:c(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},H={key:0},J={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,r=Y();a();function l(){t.isEdit&&t.store[t.storeProp].fields.forEach(o=>{const u=t.store[t.storeProp].customFields.findIndex(s=>s.id===o.custom_field_id);if(u>-1){let s=o.default_answer;s&&o.custom_field.type==="DateTime"&&(s=C(o.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[u]=v(_({},o),{id:o.custom_field_id,value:s,label:o.custom_field.label,options:o.custom_field.options,is_required:o.custom_field.is_required,placeholder:o.custom_field.placeholder,order:o.custom_field.order})}})}async function a(){let u=(await r.fetchCustomFields({type:t.type,limit:"all"})).data.data;u.map(s=>s.value=s.default_answer),t.store[t.storeProp].customFields=S.sortBy(u,s=>s.order),l()}return x(()=>t.store[t.storeProp].fields,o=>{l()}),(o,u)=>{const s=E("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(n(),b("div",H,[O(s,{layout:e.gridLayout},{default:P(()=>[(n(!0),b(R,null,k(e.store[e.storeProp].customFields,(d,p)=>(n(),m(M,{key:d.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:d},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):B("",!0)}}};export{J as _};
+var D=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&f(e,r,t[r]);if(y)for(var r of y(t))h.call(t,r)&&f(e,r,t[r]);return e},v=(e,t)=>I(e,g(t));import{g as w,m as V,aU as j,q as F,k as T,aJ as L,r as E,o as n,s as m,w as b,an as A,y as c,f as S,D as x,c as P,b as O,F as R,H as k,A as B,h as C}from"./vendor.e9042f2c.js";import{n as i,l as Y}from"./main.366b2ac6.js";function $(e){switch(e){case"./types/DateTimeType.vue":return i(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"./types/DateType.vue":return i(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"./types/DropdownType.vue":return i(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"./types/InputType.vue":return i(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"./types/NumberType.vue":return i(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"./types/PhoneType.vue":return i(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"./types/SwitchType.vue":return i(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"./types/TextAreaType.vue":return i(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"./types/TimeType.vue":return i(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"./types/UrlType.vue":return i(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(t,r){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}const M={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:r}=w(),l={value:{required:V.withMessage(r("validation.required"),j(t.field.is_required))}},a=F(l,T(()=>t.field),{$scope:t.customFieldScope}),o=T(()=>t.field.type?L(()=>$(`./types/${t.field.type}Type.vue`)):!1);return(u,s)=>{const d=E("BaseInputGroup");return n(),m(d,{label:e.field.label,required:!!e.field.is_required,error:c(a).value.$error&&c(a).value.$errors[0].$message},{default:b(()=>[(n(),m(A(c(o)),{modelValue:e.field.value,"onUpdate:modelValue":s[0]||(s[0]=p=>e.field.value=p),options:e.field.options,invalid:c(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},H={key:0},J={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,r=Y();a();function l(){t.isEdit&&t.store[t.storeProp].fields.forEach(o=>{const u=t.store[t.storeProp].customFields.findIndex(s=>s.id===o.custom_field_id);if(u>-1){let s=o.default_answer;s&&o.custom_field.type==="DateTime"&&(s=C(o.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[u]=v(_({},o),{id:o.custom_field_id,value:s,label:o.custom_field.label,options:o.custom_field.options,is_required:o.custom_field.is_required,placeholder:o.custom_field.placeholder,order:o.custom_field.order})}})}async function a(){let u=(await r.fetchCustomFields({type:t.type,limit:"all"})).data.data;u.map(s=>s.value=s.default_answer),t.store[t.storeProp].customFields=S.sortBy(u,s=>s.order),l()}return x(()=>t.store[t.storeProp].fields,o=>{l()}),(o,u)=>{const s=E("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(n(),P("div",H,[O(s,{layout:e.gridLayout},{default:b(()=>[(n(!0),P(R,null,k(e.store[e.storeProp].customFields,(d,p)=>(n(),m(M,{key:d.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:d},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):B("",!0)}}};export{J as _};
diff --git a/public/build/assets/CustomFieldsSetting.f01f4358.js b/public/build/assets/CustomFieldsSetting.44e4ec94.js
similarity index 99%
rename from public/build/assets/CustomFieldsSetting.f01f4358.js
rename to public/build/assets/CustomFieldsSetting.44e4ec94.js
index d351b0198..e27a3ab45 100644
--- a/public/build/assets/CustomFieldsSetting.f01f4358.js
+++ b/public/build/assets/CustomFieldsSetting.44e4ec94.js
@@ -1 +1 @@
-var ie=Object.defineProperty;var W=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var Z=(m,n,e)=>n in m?ie(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e,ee=(m,n)=>{for(var e in n||(n={}))de.call(n,e)&&Z(m,e,n[e]);if(W)for(var e of W(n))me.call(n,e)&&Z(m,e,n[e]);return m};import{g as H,u as ce,am as te,r as d,o as C,s as F,w as u,b as l,y as t,v as D,x as $,A as M,i as x,c as z,a_ as pe,B as se,j as le,k as h,aJ as _e,m as k,n as A,aV as fe,q as ye,t as O,a0 as oe,H as ve,z as G,F as Ce,an as be,a5 as ge}from"./vendor.e9042f2c.js";import{i as Fe,u as Te,l as K,d as ae,g as Y,e as P,n as T}from"./main.109918ee.js";const we={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(m){const n=m,e=Fe();Te();const{t:i}=H(),v=K();ce();const f=ae(),c=Y();te("utils");async function p(b){await v.fetchCustomField(b),c.openModal({title:i("settings.custom_fields.edit_custom_field"),componentName:"CustomFieldModal",size:"sm",data:b,refreshData:n.loadData})}async function V(b){e.openDialog({title:i("general.are_you_sure"),message:i("settings.custom_fields.custom_field_confirm_delete"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async g=>{g&&(await v.deleteCustomFields(b),n.loadData&&n.loadData())})}return(b,g)=>{const y=d("BaseIcon"),I=d("BaseDropdownItem"),B=d("BaseDropdown");return C(),F(B,null,{activator:u(()=>[l(y,{name:"DotsHorizontalIcon",class:"h-5 text-gray-500"})]),default:u(()=>[t(f).hasAbilities(t(P).EDIT_CUSTOM_FIELDS)?(C(),F(I,{key:0,onClick:g[0]||(g[0]=o=>p(m.row.id))},{default:u(()=>[l(y,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+$(b.$t("general.edit")),1)]),_:1})):M("",!0),t(f).hasAbilities(t(P).DELETE_CUSTOM_FIELDS)?(C(),F(I,{key:1,onClick:g[1]||(g[1]=o=>V(m.row.id))},{default:u(()=>[l(y,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+$(b.$t("general.delete")),1)]),_:1})):M("",!0)]),_:1})}}},$e={class:"flex items-center mt-1"},Ie={emits:["onAdd"],setup(m,{emit:n}){const e=x(null);function i(){if(e.value==null||e.value==""||e.value==null)return!0;n("onAdd",e.value),e.value=null}return(v,f)=>{const c=d("BaseInput"),p=d("BaseIcon");return C(),z("div",$e,[l(c,{modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=V=>e.value=V),type:"text",class:"w-full md:w-96",placeholder:v.$t("settings.custom_fields.press_enter_to_add"),onClick:i,onKeydown:pe(se(i,["prevent","stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),l(p,{name:"PlusCircleIcon",class:"ml-1 text-primary-500 cursor-pointer",onClick:i})])}}};function Be(m){switch(m){case"../../custom-fields/types/DateTimeType.vue":return T(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/DateType.vue":return T(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/DropdownType.vue":return T(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/InputType.vue":return T(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/NumberType.vue":return T(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/PhoneType.vue":return T(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/SwitchType.vue":return T(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/TextAreaType.vue":return T(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/TimeType.vue":return T(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/UrlType.vue":return T(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(n,e){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(e.bind(null,new Error("Unknown variable dynamic import: "+m)))})}}const De={class:"flex justify-between w-full"},he=["onSubmit"],Ve={class:"overflow-y-auto max-h-[550px]"},Se={class:"px-4 md:px-8 py-8 overflow-y-auto sm:p-6"},Ee={class:"z-0 flex justify-end p-4 border-t border-solid border-gray-light border-modal-bg"},qe={setup(m){const n=Y(),e=K(),{t:i}=H();let v=x(!1);const f=le(["Customer","Invoice","Estimate","Expense","Payment"]),c=le([{label:"Text",value:"Input"},{label:"Textarea",value:"TextArea"},{label:"Phone",value:"Phone"},{label:"URL",value:"Url"},{label:"Number",value:"Number"},{label:"Select Field",value:"Dropdown"},{label:"Switch Toggle",value:"Switch"},{label:"Date",value:"Date"},{label:"Time",value:"Time"},{label:"Date & Time",value:"DateTime"}]);let p=x(c[0]);const V=h(()=>n.active&&n.componentName==="CustomFieldModal"),b=h(()=>p.value&&p.value.label==="Switch Toggle"),g=h(()=>p.value&&p.value.label==="Select Field"),y=h(()=>e.currentCustomField.type?_e(()=>Be(`../../custom-fields/types/${e.currentCustomField.type}Type.vue`)):!1),I=h({get:()=>e.currentCustomField.is_required===1,set:s=>{const a=s?1:0;e.currentCustomField.is_required=a}}),B=h(()=>({currentCustomField:{type:{required:k.withMessage(i("validation.required"),A)},name:{required:k.withMessage(i("validation.required"),A)},label:{required:k.withMessage(i("validation.required"),A)},model_type:{required:k.withMessage(i("validation.required"),A)},order:{required:k.withMessage(i("validation.required"),A),numeric:k.withMessage(i("validation.numbers_only"),fe)},type:{required:k.withMessage(i("validation.required"),A)}}})),o=ye(B,h(()=>e));function S(){e.isEdit?p.value=c.find(s=>s.value==e.currentCustomField.type):(e.currentCustomField.model_type=f[0],e.currentCustomField.type=c[0].value)}async function L(){if(o.value.currentCustomField.$touch(),o.value.currentCustomField.$invalid)return!0;v.value=!0;let s=ee({},e.currentCustomField);if(e.currentCustomField.options&&(s.options=e.currentCustomField.options.map(E=>E.name)),s.type=="Time"&&typeof s.default_answer=="object"){let E=s&&s.default_answer&&s.default_answer.HH?s.default_answer.HH:null,q=s&&s.default_answer&&s.default_answer.mm?s.default_answer.mm:null;s&&s.default_answer&&s.default_answer.ss&&s.default_answer.ss,s.default_answer=`${E}:${q}`}await(e.isEdit?e.updateCustomField:e.addCustomField)(s),v.value=!1,n.refreshData&&n.refreshData(),R()}function j(s){e.currentCustomField.options=[{name:s},...e.currentCustomField.options]}function _(s){if(e.isEdit&&e.currentCustomField.in_use)return;e.currentCustomField.options[s].name===e.currentCustomField.default_answer&&(e.currentCustomField.default_answer=null),e.currentCustomField.options.splice(s,1)}function N(s){e.currentCustomField.type=s.value}function R(){n.closeModal(),setTimeout(()=>{e.resetCurrentCustomField(),o.value.$reset()},300)}return(s,a)=>{const E=d("BaseIcon"),q=d("BaseInput"),w=d("BaseInputGroup"),J=d("BaseMultiselect"),re=d("BaseSwitch"),ne=d("BaseInputGrid"),X=d("BaseButton"),ue=d("BaseModal");return C(),F(ue,{show:t(V),onOpen:S},{header:u(()=>[O("div",De,[D($(t(n).title)+" ",1),l(E,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:R})])]),default:u(()=>[O("form",{action:"",onSubmit:se(L,["prevent"])},[O("div",Ve,[O("div",Se,[l(ne,{layout:"one-column"},{default:u(()=>[l(w,{label:s.$t("settings.custom_fields.name"),required:"",error:t(o).currentCustomField.name.$error&&t(o).currentCustomField.name.$errors[0].$message},{default:u(()=>[l(q,{ref:(r,U)=>{U.name=r},modelValue:t(e).currentCustomField.name,"onUpdate:modelValue":a[0]||(a[0]=r=>t(e).currentCustomField.name=r),invalid:t(o).currentCustomField.name.$error,onInput:a[1]||(a[1]=r=>t(o).currentCustomField.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),l(w,{label:s.$t("settings.custom_fields.model"),error:t(o).currentCustomField.model_type.$error&&t(o).currentCustomField.model_type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.model_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(e).currentCustomField.model_type,"onUpdate:modelValue":a[2]||(a[2]=r=>t(e).currentCustomField.model_type=r),options:t(f),"can-deselect":!1,invalid:t(o).currentCustomField.model_type.$error,searchable:!0,disabled:t(e).currentCustomField.in_use,onInput:a[3]||(a[3]=r=>t(o).currentCustomField.model_type.$touch())},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{class:"flex items-center space-x-4",label:s.$t("settings.custom_fields.required")},{default:u(()=>[l(re,{modelValue:t(I),"onUpdate:modelValue":a[4]||(a[4]=r=>oe(I)?I.value=r:null)},null,8,["modelValue"])]),_:1},8,["label"]),l(w,{label:s.$t("settings.custom_fields.type"),error:t(o).currentCustomField.type.$error&&t(o).currentCustomField.type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.type_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(p),"onUpdate:modelValue":[a[5]||(a[5]=r=>oe(p)?p.value=r:p=r),N],options:t(c),invalid:t(o).currentCustomField.type.$error,disabled:t(e).currentCustomField.in_use,searchable:!0,"can-deselect":!1,object:""},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{label:s.$t("settings.custom_fields.label"),required:"",error:t(o).currentCustomField.label.$error&&t(o).currentCustomField.label.$errors[0].$message},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.label,"onUpdate:modelValue":a[6]||(a[6]=r=>t(e).currentCustomField.label=r),invalid:t(o).currentCustomField.label.$error,onInput:a[7]||(a[7]=r=>t(o).currentCustomField.label.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),t(g)?(C(),F(w,{key:0,label:s.$t("settings.custom_fields.options")},{default:u(()=>[l(Ie,{onOnAdd:j}),(C(!0),z(Ce,null,ve(t(e).currentCustomField.options,(r,U)=>(C(),z("div",{key:U,class:"flex items-center mt-5"},[l(q,{modelValue:r.name,"onUpdate:modelValue":Q=>r.name=Q,class:"w-64"},null,8,["modelValue","onUpdate:modelValue"]),l(E,{name:"MinusCircleIcon",class:G(["ml-1 cursor-pointer",t(e).currentCustomField.in_use?"text-gray-300":"text-red-300"]),onClick:Q=>_(U)},null,8,["class","onClick"])]))),128))]),_:1},8,["label"])):M("",!0),l(w,{label:s.$t("settings.custom_fields.default_value"),class:"relative"},{default:u(()=>[(C(),F(be(t(y)),{modelValue:t(e).currentCustomField.default_answer,"onUpdate:modelValue":a[8]||(a[8]=r=>t(e).currentCustomField.default_answer=r),options:t(e).currentCustomField.options,"default-date-time":t(e).currentCustomField.dateTimeValue},null,8,["modelValue","options","default-date-time"]))]),_:1},8,["label"]),t(b)?M("",!0):(C(),F(w,{key:1,label:s.$t("settings.custom_fields.placeholder")},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.placeholder,"onUpdate:modelValue":a[9]||(a[9]=r=>t(e).currentCustomField.placeholder=r)},null,8,["modelValue"])]),_:1},8,["label"])),l(w,{label:s.$t("settings.custom_fields.order"),error:t(o).currentCustomField.order.$error&&t(o).currentCustomField.order.$errors[0].$message,required:""},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.order,"onUpdate:modelValue":a[10]||(a[10]=r=>t(e).currentCustomField.order=r),type:"number",invalid:t(o).currentCustomField.order.$error,onInput:a[11]||(a[11]=r=>t(o).currentCustomField.order.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),_:1})])]),O("div",Ee,[l(X,{class:"mr-3",type:"button",variant:"primary-outline",onClick:R},{default:u(()=>[D($(s.$t("general.cancel")),1)]),_:1}),l(X,{variant:"primary",loading:t(v),disabled:t(v),type:"submit"},{left:u(r=>[t(v)?M("",!0):(C(),F(E,{key:0,class:G(r.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+$(t(e).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,he)]),_:1},8,["show"])}}},ke={class:"text-xs text-gray-500"},Pe={setup(m){const n=Y(),e=K(),i=ae(),v=te("utils"),{t:f}=H(),c=x(null),p=h(()=>[{key:"name",label:f("settings.custom_fields.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"model_type",label:f("settings.custom_fields.model")},{key:"type",label:f("settings.custom_fields.type")},{key:"is_required",label:f("settings.custom_fields.required")},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function V({page:y,filter:I,sort:B}){let o={orderByField:B.fieldName||"created_at",orderBy:B.order||"desc",page:y},S=await e.fetchCustomFields(o);return{data:S.data.data,pagination:{totalPages:S.data.meta.last_page,currentPage:y,limit:5,totalCount:S.data.meta.total}}}function b(){n.openModal({title:f("settings.custom_fields.add_custom_field"),componentName:"CustomFieldModal",size:"sm",refreshData:c.value&&c.value.refresh})}async function g(){c.value&&c.value.refresh()}return(y,I)=>{const B=d("BaseIcon"),o=d("BaseButton"),S=d("BaseBadge"),L=d("BaseTable"),j=d("BaseSettingCard");return C(),F(j,{title:y.$t("settings.menu_title.custom_fields"),description:y.$t("settings.custom_fields.section_description")},{action:u(()=>[t(i).hasAbilities(t(P).CREATE_CUSTOM_FIELDS)?(C(),F(o,{key:0,variant:"primary-outline",onClick:b},{left:u(_=>[l(B,{class:G(_.class),name:"PlusIcon"},null,8,["class"]),D(" "+$(y.$t("settings.custom_fields.add_custom_field")),1)]),_:1})):M("",!0)]),default:u(()=>[l(qe),l(L,{ref:(_,N)=>{N.table=_,c.value=_},data:V,columns:t(p),class:"mt-16"},ge({"cell-name":u(({row:_})=>[D($(_.data.name)+" ",1),O("span",ke," ("+$(_.data.slug)+")",1)]),"cell-is_required":u(({row:_})=>[l(S,{"bg-color":t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").bgColor,color:t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").color},{default:u(()=>[D($(_.data.is_required?y.$t("settings.custom_fields.yes"):y.$t("settings.custom_fields.no").replace("_"," ")),1)]),_:2},1032,["bg-color","color"])]),_:2},[t(i).hasAbilities([t(P).DELETE_CUSTOM_FIELDS,t(P).EDIT_CUSTOM_FIELDS])?{name:"cell-actions",fn:u(({row:_})=>[l(we,{row:_.data,table:c.value,"load-data":g},null,8,["row","table"])])}:void 0]),1032,["columns"])]),_:1},8,["title","description"])}}};export{Pe as default};
+var ie=Object.defineProperty;var W=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var Z=(m,n,e)=>n in m?ie(m,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[n]=e,ee=(m,n)=>{for(var e in n||(n={}))de.call(n,e)&&Z(m,e,n[e]);if(W)for(var e of W(n))me.call(n,e)&&Z(m,e,n[e]);return m};import{g as H,u as ce,am as te,r as d,o as C,s as F,w as u,b as l,y as t,v as D,x as $,A as M,i as x,c as z,a_ as pe,B as se,j as le,k as h,aJ as _e,m as k,n as A,aV as fe,q as ye,t as O,a0 as oe,H as ve,z as G,F as Ce,an as be,a5 as ge}from"./vendor.e9042f2c.js";import{i as Fe,u as Te,l as K,d as ae,g as Y,e as P,n as T}from"./main.366b2ac6.js";const we={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(m){const n=m,e=Fe();Te();const{t:i}=H(),v=K();ce();const f=ae(),c=Y();te("utils");async function p(b){await v.fetchCustomField(b),c.openModal({title:i("settings.custom_fields.edit_custom_field"),componentName:"CustomFieldModal",size:"sm",data:b,refreshData:n.loadData})}async function V(b){e.openDialog({title:i("general.are_you_sure"),message:i("settings.custom_fields.custom_field_confirm_delete"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async g=>{g&&(await v.deleteCustomFields(b),n.loadData&&n.loadData())})}return(b,g)=>{const y=d("BaseIcon"),I=d("BaseDropdownItem"),B=d("BaseDropdown");return C(),F(B,null,{activator:u(()=>[l(y,{name:"DotsHorizontalIcon",class:"h-5 text-gray-500"})]),default:u(()=>[t(f).hasAbilities(t(P).EDIT_CUSTOM_FIELDS)?(C(),F(I,{key:0,onClick:g[0]||(g[0]=o=>p(m.row.id))},{default:u(()=>[l(y,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+$(b.$t("general.edit")),1)]),_:1})):M("",!0),t(f).hasAbilities(t(P).DELETE_CUSTOM_FIELDS)?(C(),F(I,{key:1,onClick:g[1]||(g[1]=o=>V(m.row.id))},{default:u(()=>[l(y,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),D(" "+$(b.$t("general.delete")),1)]),_:1})):M("",!0)]),_:1})}}},$e={class:"flex items-center mt-1"},Ie={emits:["onAdd"],setup(m,{emit:n}){const e=x(null);function i(){if(e.value==null||e.value==""||e.value==null)return!0;n("onAdd",e.value),e.value=null}return(v,f)=>{const c=d("BaseInput"),p=d("BaseIcon");return C(),z("div",$e,[l(c,{modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=V=>e.value=V),type:"text",class:"w-full md:w-96",placeholder:v.$t("settings.custom_fields.press_enter_to_add"),onClick:i,onKeydown:pe(se(i,["prevent","stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),l(p,{name:"PlusCircleIcon",class:"ml-1 text-primary-500 cursor-pointer",onClick:i})])}}};function Be(m){switch(m){case"../../custom-fields/types/DateTimeType.vue":return T(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/DateType.vue":return T(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/DropdownType.vue":return T(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/InputType.vue":return T(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/NumberType.vue":return T(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/PhoneType.vue":return T(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/SwitchType.vue":return T(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/TextAreaType.vue":return T(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/TimeType.vue":return T(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"../../custom-fields/types/UrlType.vue":return T(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(n,e){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(e.bind(null,new Error("Unknown variable dynamic import: "+m)))})}}const De={class:"flex justify-between w-full"},he=["onSubmit"],Ve={class:"overflow-y-auto max-h-[550px]"},Se={class:"px-4 md:px-8 py-8 overflow-y-auto sm:p-6"},Ee={class:"z-0 flex justify-end p-4 border-t border-solid border-gray-light border-modal-bg"},qe={setup(m){const n=Y(),e=K(),{t:i}=H();let v=x(!1);const f=le(["Customer","Invoice","Estimate","Expense","Payment"]),c=le([{label:"Text",value:"Input"},{label:"Textarea",value:"TextArea"},{label:"Phone",value:"Phone"},{label:"URL",value:"Url"},{label:"Number",value:"Number"},{label:"Select Field",value:"Dropdown"},{label:"Switch Toggle",value:"Switch"},{label:"Date",value:"Date"},{label:"Time",value:"Time"},{label:"Date & Time",value:"DateTime"}]);let p=x(c[0]);const V=h(()=>n.active&&n.componentName==="CustomFieldModal"),b=h(()=>p.value&&p.value.label==="Switch Toggle"),g=h(()=>p.value&&p.value.label==="Select Field"),y=h(()=>e.currentCustomField.type?_e(()=>Be(`../../custom-fields/types/${e.currentCustomField.type}Type.vue`)):!1),I=h({get:()=>e.currentCustomField.is_required===1,set:s=>{const a=s?1:0;e.currentCustomField.is_required=a}}),B=h(()=>({currentCustomField:{type:{required:k.withMessage(i("validation.required"),A)},name:{required:k.withMessage(i("validation.required"),A)},label:{required:k.withMessage(i("validation.required"),A)},model_type:{required:k.withMessage(i("validation.required"),A)},order:{required:k.withMessage(i("validation.required"),A),numeric:k.withMessage(i("validation.numbers_only"),fe)},type:{required:k.withMessage(i("validation.required"),A)}}})),o=ye(B,h(()=>e));function S(){e.isEdit?p.value=c.find(s=>s.value==e.currentCustomField.type):(e.currentCustomField.model_type=f[0],e.currentCustomField.type=c[0].value)}async function L(){if(o.value.currentCustomField.$touch(),o.value.currentCustomField.$invalid)return!0;v.value=!0;let s=ee({},e.currentCustomField);if(e.currentCustomField.options&&(s.options=e.currentCustomField.options.map(E=>E.name)),s.type=="Time"&&typeof s.default_answer=="object"){let E=s&&s.default_answer&&s.default_answer.HH?s.default_answer.HH:null,q=s&&s.default_answer&&s.default_answer.mm?s.default_answer.mm:null;s&&s.default_answer&&s.default_answer.ss&&s.default_answer.ss,s.default_answer=`${E}:${q}`}await(e.isEdit?e.updateCustomField:e.addCustomField)(s),v.value=!1,n.refreshData&&n.refreshData(),R()}function j(s){e.currentCustomField.options=[{name:s},...e.currentCustomField.options]}function _(s){if(e.isEdit&&e.currentCustomField.in_use)return;e.currentCustomField.options[s].name===e.currentCustomField.default_answer&&(e.currentCustomField.default_answer=null),e.currentCustomField.options.splice(s,1)}function N(s){e.currentCustomField.type=s.value}function R(){n.closeModal(),setTimeout(()=>{e.resetCurrentCustomField(),o.value.$reset()},300)}return(s,a)=>{const E=d("BaseIcon"),q=d("BaseInput"),w=d("BaseInputGroup"),J=d("BaseMultiselect"),re=d("BaseSwitch"),ne=d("BaseInputGrid"),X=d("BaseButton"),ue=d("BaseModal");return C(),F(ue,{show:t(V),onOpen:S},{header:u(()=>[O("div",De,[D($(t(n).title)+" ",1),l(E,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:R})])]),default:u(()=>[O("form",{action:"",onSubmit:se(L,["prevent"])},[O("div",Ve,[O("div",Se,[l(ne,{layout:"one-column"},{default:u(()=>[l(w,{label:s.$t("settings.custom_fields.name"),required:"",error:t(o).currentCustomField.name.$error&&t(o).currentCustomField.name.$errors[0].$message},{default:u(()=>[l(q,{ref:(r,U)=>{U.name=r},modelValue:t(e).currentCustomField.name,"onUpdate:modelValue":a[0]||(a[0]=r=>t(e).currentCustomField.name=r),invalid:t(o).currentCustomField.name.$error,onInput:a[1]||(a[1]=r=>t(o).currentCustomField.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),l(w,{label:s.$t("settings.custom_fields.model"),error:t(o).currentCustomField.model_type.$error&&t(o).currentCustomField.model_type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.model_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(e).currentCustomField.model_type,"onUpdate:modelValue":a[2]||(a[2]=r=>t(e).currentCustomField.model_type=r),options:t(f),"can-deselect":!1,invalid:t(o).currentCustomField.model_type.$error,searchable:!0,disabled:t(e).currentCustomField.in_use,onInput:a[3]||(a[3]=r=>t(o).currentCustomField.model_type.$touch())},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{class:"flex items-center space-x-4",label:s.$t("settings.custom_fields.required")},{default:u(()=>[l(re,{modelValue:t(I),"onUpdate:modelValue":a[4]||(a[4]=r=>oe(I)?I.value=r:null)},null,8,["modelValue"])]),_:1},8,["label"]),l(w,{label:s.$t("settings.custom_fields.type"),error:t(o).currentCustomField.type.$error&&t(o).currentCustomField.type.$errors[0].$message,"help-text":t(e).currentCustomField.in_use?s.$t("settings.custom_fields.type_in_use"):"",required:""},{default:u(()=>[l(J,{modelValue:t(p),"onUpdate:modelValue":[a[5]||(a[5]=r=>oe(p)?p.value=r:p=r),N],options:t(c),invalid:t(o).currentCustomField.type.$error,disabled:t(e).currentCustomField.in_use,searchable:!0,"can-deselect":!1,object:""},null,8,["modelValue","options","invalid","disabled"])]),_:1},8,["label","error","help-text"]),l(w,{label:s.$t("settings.custom_fields.label"),required:"",error:t(o).currentCustomField.label.$error&&t(o).currentCustomField.label.$errors[0].$message},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.label,"onUpdate:modelValue":a[6]||(a[6]=r=>t(e).currentCustomField.label=r),invalid:t(o).currentCustomField.label.$error,onInput:a[7]||(a[7]=r=>t(o).currentCustomField.label.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),t(g)?(C(),F(w,{key:0,label:s.$t("settings.custom_fields.options")},{default:u(()=>[l(Ie,{onOnAdd:j}),(C(!0),z(Ce,null,ve(t(e).currentCustomField.options,(r,U)=>(C(),z("div",{key:U,class:"flex items-center mt-5"},[l(q,{modelValue:r.name,"onUpdate:modelValue":Q=>r.name=Q,class:"w-64"},null,8,["modelValue","onUpdate:modelValue"]),l(E,{name:"MinusCircleIcon",class:G(["ml-1 cursor-pointer",t(e).currentCustomField.in_use?"text-gray-300":"text-red-300"]),onClick:Q=>_(U)},null,8,["class","onClick"])]))),128))]),_:1},8,["label"])):M("",!0),l(w,{label:s.$t("settings.custom_fields.default_value"),class:"relative"},{default:u(()=>[(C(),F(be(t(y)),{modelValue:t(e).currentCustomField.default_answer,"onUpdate:modelValue":a[8]||(a[8]=r=>t(e).currentCustomField.default_answer=r),options:t(e).currentCustomField.options,"default-date-time":t(e).currentCustomField.dateTimeValue},null,8,["modelValue","options","default-date-time"]))]),_:1},8,["label"]),t(b)?M("",!0):(C(),F(w,{key:1,label:s.$t("settings.custom_fields.placeholder")},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.placeholder,"onUpdate:modelValue":a[9]||(a[9]=r=>t(e).currentCustomField.placeholder=r)},null,8,["modelValue"])]),_:1},8,["label"])),l(w,{label:s.$t("settings.custom_fields.order"),error:t(o).currentCustomField.order.$error&&t(o).currentCustomField.order.$errors[0].$message,required:""},{default:u(()=>[l(q,{modelValue:t(e).currentCustomField.order,"onUpdate:modelValue":a[10]||(a[10]=r=>t(e).currentCustomField.order=r),type:"number",invalid:t(o).currentCustomField.order.$error,onInput:a[11]||(a[11]=r=>t(o).currentCustomField.order.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),_:1})])]),O("div",Ee,[l(X,{class:"mr-3",type:"button",variant:"primary-outline",onClick:R},{default:u(()=>[D($(s.$t("general.cancel")),1)]),_:1}),l(X,{variant:"primary",loading:t(v),disabled:t(v),type:"submit"},{left:u(r=>[t(v)?M("",!0):(C(),F(E,{key:0,class:G(r.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[D(" "+$(t(e).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,he)]),_:1},8,["show"])}}},ke={class:"text-xs text-gray-500"},Pe={setup(m){const n=Y(),e=K(),i=ae(),v=te("utils"),{t:f}=H(),c=x(null),p=h(()=>[{key:"name",label:f("settings.custom_fields.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"model_type",label:f("settings.custom_fields.model")},{key:"type",label:f("settings.custom_fields.type")},{key:"is_required",label:f("settings.custom_fields.required")},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function V({page:y,filter:I,sort:B}){let o={orderByField:B.fieldName||"created_at",orderBy:B.order||"desc",page:y},S=await e.fetchCustomFields(o);return{data:S.data.data,pagination:{totalPages:S.data.meta.last_page,currentPage:y,limit:5,totalCount:S.data.meta.total}}}function b(){n.openModal({title:f("settings.custom_fields.add_custom_field"),componentName:"CustomFieldModal",size:"sm",refreshData:c.value&&c.value.refresh})}async function g(){c.value&&c.value.refresh()}return(y,I)=>{const B=d("BaseIcon"),o=d("BaseButton"),S=d("BaseBadge"),L=d("BaseTable"),j=d("BaseSettingCard");return C(),F(j,{title:y.$t("settings.menu_title.custom_fields"),description:y.$t("settings.custom_fields.section_description")},{action:u(()=>[t(i).hasAbilities(t(P).CREATE_CUSTOM_FIELDS)?(C(),F(o,{key:0,variant:"primary-outline",onClick:b},{left:u(_=>[l(B,{class:G(_.class),name:"PlusIcon"},null,8,["class"]),D(" "+$(y.$t("settings.custom_fields.add_custom_field")),1)]),_:1})):M("",!0)]),default:u(()=>[l(qe),l(L,{ref:(_,N)=>{N.table=_,c.value=_},data:V,columns:t(p),class:"mt-16"},ge({"cell-name":u(({row:_})=>[D($(_.data.name)+" ",1),O("span",ke," ("+$(_.data.slug)+")",1)]),"cell-is_required":u(({row:_})=>[l(S,{"bg-color":t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").bgColor,color:t(v).getBadgeStatusColor(_.data.is_required?"YES":"NO").color},{default:u(()=>[D($(_.data.is_required?y.$t("settings.custom_fields.yes"):y.$t("settings.custom_fields.no").replace("_"," ")),1)]),_:2},1032,["bg-color","color"])]),_:2},[t(i).hasAbilities([t(P).DELETE_CUSTOM_FIELDS,t(P).EDIT_CUSTOM_FIELDS])?{name:"cell-actions",fn:u(({row:_})=>[l(we,{row:_.data,table:c.value,"load-data":g},null,8,["row","table"])])}:void 0]),1032,["columns"])]),_:1},8,["title","description"])}}};export{Pe as default};
diff --git a/public/build/assets/CustomerIndexDropdown.793a8ea1.js b/public/build/assets/CustomerIndexDropdown.8b749912.js
similarity index 93%
rename from public/build/assets/CustomerIndexDropdown.793a8ea1.js
rename to public/build/assets/CustomerIndexDropdown.8b749912.js
index e565c53ac..80eecd33e 100644
--- a/public/build/assets/CustomerIndexDropdown.793a8ea1.js
+++ b/public/build/assets/CustomerIndexDropdown.8b749912.js
@@ -1 +1 @@
-import{k as C,u as S,i as b,d as x,e as g}from"./main.109918ee.js";import{g as E,u as T,C as $,am as j,r as i,o as a,s,w as t,y as e,b as n,v as p,x as f,A as y}from"./vendor.e9042f2c.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const w=l,_=C();S();const D=b(),m=x(),{t:u}=E(),h=T();$(),j("utils");function B(r){D.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=i("BaseIcon"),k=i("BaseButton"),d=i("BaseDropdownItem"),v=i("router-link"),I=i("BaseDropdown");return a(),s(I,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(k,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(v,{key:0,to:`/admin/customers/${l.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(v,{key:1,to:`customers/${l.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=N=>B(l.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _};
+import{k as b,u as C,i as S,d as x,e as g}from"./main.366b2ac6.js";import{g as E,u as T,C as $,am as j,r as i,o as a,s,w as t,y as e,b as n,v as p,x as f,A as y}from"./vendor.e9042f2c.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const w=l,_=b();C();const D=S(),m=x(),{t:u}=E(),h=T();$(),j("utils");function B(r){D.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=i("BaseIcon"),k=i("BaseButton"),d=i("BaseDropdownItem"),v=i("router-link"),I=i("BaseDropdown");return a(),s(I,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(k,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(v,{key:0,to:`/admin/customers/${l.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(v,{key:1,to:`customers/${l.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=N=>B(l.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _};
diff --git a/public/build/assets/CustomizationSetting.df030940.js b/public/build/assets/CustomizationSetting.80e95248.js
similarity index 99%
rename from public/build/assets/CustomizationSetting.df030940.js
rename to public/build/assets/CustomizationSetting.80e95248.js
index a9b123ca4..d10b90c7f 100644
--- a/public/build/assets/CustomizationSetting.df030940.js
+++ b/public/build/assets/CustomizationSetting.80e95248.js
@@ -1 +1 @@
-var ut=Object.defineProperty,rt=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var ct=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var st=(v,o,i)=>o in v?ut(v,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[o]=i,x=(v,o)=>{for(var i in o||(o={}))ct.call(o,i)&&st(v,i,o[i]);if(et)for(var i of et(o))_t.call(o,i)&&st(v,i,o[i]);return v},W=(v,o)=>rt(v,dt(o));import{c as N,m as Z,f as pt,j as gt,o as yt,p as ft,g as vt,i as bt}from"./main.109918ee.js";import{g as P,i as z,k as F,D as St,G as at,a9 as $t,r as d,o as $,c as D,t as c,x as b,b as t,w as r,B as Y,z as G,v as E,F as A,H as Bt,s as k,y as e,A as R,am as M,j as T,m as J,aU as nt,aV as it,q as ot,a0 as H}from"./vendor.e9042f2c.js";import{D as ht,d as zt}from"./DragIcon.e15154fb.js";import{_ as Vt}from"./ItemUnitModal.fc91b43e.js";const It={class:"text-gray-900 text-lg font-medium"},xt={class:"mt-1 text-sm text-gray-500"},wt={class:"overflow-x-auto"},Ct={class:"w-full mt-6 table-fixed"},Dt=c("colgroup",null,[c("col",{style:{width:"4%"}}),c("col",{style:{width:"45%"}}),c("col",{style:{width:"27%"}}),c("col",{style:{width:"24%"}})],-1),Ut=c("thead",null,[c("tr",null,[c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Component "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Parameter "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"})])],-1),Ft={class:"relative"},Et={class:"text-gray-300 cursor-move handle align-middle"},kt={class:"px-5 py-4"},Nt={class:"block text-sm not-italic font-medium text-primary-800 whitespace-nowrap mr-2 min-w-[200px]"},Mt={class:"text-xs text-gray-500 mt-1"},Tt={class:"px-5 py-4 text-left align-middle"},Gt={class:"px-5 py-4 text-right align-middle pt-10"},qt=E(" Remove "),At={colspan:"2",class:"px-5 py-4"},Rt={class:"px-5 py-4 text-right align-middle",colspan:"2"},tt={props:{type:{type:String,required:!0},typeStore:{type:Object,required:!0},defaultSeries:{type:String,default:"INV"}},setup(v){const o=v,{t:i}=P(),p=N(),g=Z(),u=z([]),a=z(!1),m=z([{label:i("settings.customization.series"),description:i("settings.customization.series_description"),name:"SERIES",paramLabel:i("settings.customization.series_param_label"),value:o.defaultSeries,inputDisabled:!1,inputType:"text",allowMultiple:!1},{label:i("settings.customization.sequence"),description:i("settings.customization.sequence_description"),name:"SEQUENCE",paramLabel:i("settings.customization.sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.delimiter"),description:i("settings.customization.delimiter_description"),name:"DELIMITER",paramLabel:i("settings.customization.delimiter_param_label"),value:"-",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.customer_series"),description:i("settings.customization.customer_series_description"),name:"CUSTOMER_SERIES",paramLabel:"",value:"",inputDisabled:!0,inputType:"text",allowMultiple:!1},{label:i("settings.customization.customer_sequence"),description:i("settings.customization.customer_sequence_description"),name:"CUSTOMER_SEQUENCE",paramLabel:i("settings.customization.customer_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.date_format"),description:i("settings.customization.date_format_description"),name:"DATE_FORMAT",paramLabel:i("settings.customization.date_format_param_label"),value:"Y",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.random_sequence"),description:i("settings.customization.random_sequence_description"),name:"RANDOM_SEQUENCE",paramLabel:i("settings.customization.random_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1}]),s=F(()=>m.value.filter(function(f){return!u.value.some(function(V){return f.allowMultiple?!1:f.name==V.name})})),_=z(""),n=z(!1),l=z(!1),y=F(()=>{let f="";return u.value.forEach(V=>{let q=`{{${V.name}`;V.value&&(q+=`:${V.value}`),f+=`${q}}}`}),f});St(u,f=>{U()}),B();async function B(){let f={format:p.selectedCompanySettings[`${o.type}_number_format`]};l.value=!0,(await g.fetchPlaceholders(f)).data.placeholders.forEach(q=>{var O;let X=m.value.find(K=>K.name===q.name);const Q=(O=q.value)!=null?O:"";u.value.push(W(x({},X),{value:Q,id:at.raw()}))}),l.value=!1,U()}function C(f){return u.value.find(V=>V.name===f.name)}function h(f){C(f)&&!f.allowMultiple||(u.value.push(W(x({},f),{id:at.raw()})),U())}function S(f){u.value=u.value.filter(function(V){return f.id!==V.id})}function w(f,V){switch(V.name){case"SERIES":f.length>=4&&(f=f.substring(0,4));break;case"DELIMITER":f.length>=1&&(f=f.substring(0,1));break}setTimeout(()=>{V.value=f,U()},100)}const U=$t(()=>{j()},500);async function j(){if(!y.value){_.value="";return}let f={key:o.type,format:y.value};n.value=!0;let V=await o.typeStore.getNextNumber(f);n.value=!1,V.data&&(_.value=V.data.nextNumber)}async function lt(){if(n.value||l.value)return;a.value=!0;let f={settings:{}};return f.settings[o.type+"_number_format"]=y.value,await p.updateCompanySettings({data:f,message:`settings.customization.${o.type}s.${o.type}_settings_updated`}),a.value=!1,!0}return(f,V)=>{const q=d("BaseInput"),X=d("BaseInputGroup"),Q=d("BaseIcon"),O=d("BaseButton"),K=d("BaseDropdownItem"),mt=d("BaseDropdown");return $(),D(A,null,[c("h6",It,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format`)),1),c("p",xt,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format_description`)),1),c("div",wt,[c("table",Ct,[Dt,Ut,t(e(zt),{modelValue:u.value,"onUpdate:modelValue":V[1]||(V[1]=I=>u.value=I),class:"divide-y divide-gray-200","item-key":"id",tag:"tbody",handle:".handle",filter:".ignore-element"},{item:r(({element:I})=>[c("tr",Ft,[c("td",Et,[t(ht)]),c("td",kt,[c("label",Nt,b(I.label),1),c("p",Mt,b(I.description),1)]),c("td",Tt,[t(X,{label:I.paramLabel,class:"lg:col-span-3",required:""},{default:r(()=>[t(q,{modelValue:I.value,"onUpdate:modelValue":[L=>I.value=L,L=>w(L,I)],disabled:I.inputDisabled,type:I.inputType},null,8,["modelValue","onUpdate:modelValue","disabled","type"])]),_:2},1032,["label"])]),c("td",Gt,[t(O,{variant:"white",onClick:Y(L=>S(I),["prevent"])},{left:r(L=>[t(Q,{name:"XIcon",class:G(["!sm:m-0",L.class])},null,8,["class"])]),default:r(()=>[qt]),_:2},1032,["onClick"])])])]),footer:r(()=>[c("tr",null,[c("td",At,[t(X,{label:f.$t(`settings.customization.${v.type}s.preview_${v.type}_number`)},{default:r(()=>[t(q,{modelValue:_.value,"onUpdate:modelValue":V[0]||(V[0]=I=>_.value=I),disabled:"",loading:n.value},null,8,["modelValue","loading"])]),_:1},8,["label"])]),c("td",Rt,[t(mt,{"wrapper-class":"flex items-center justify-end mt-5"},{activator:r(()=>[t(O,{variant:"primary-outline"},{left:r(I=>[t(Q,{class:G(I.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[E(" "+b(f.$t("settings.customization.add_new_component")),1)]),_:1})]),default:r(()=>[($(!0),D(A,null,Bt(e(s),I=>($(),k(K,{key:I.label,onClick:Y(L=>h(I),["prevent"])},{default:r(()=>[E(b(I.label),1)]),_:2},1032,["onClick"]))),128))]),_:1})])])]),_:1},8,["modelValue"])])]),t(O,{loading:a.value,disabled:a.value,variant:"primary",type:"submit",class:"mt-4",onClick:lt},{left:r(I=>[a.value?R("",!0):($(),k(Q,{key:0,class:G(I.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(f.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],64)}}},Lt={setup(v){const o=pt();return(i,p)=>($(),k(tt,{type:"invoice","type-store":e(o),"default-series":"INV"},null,8,["type-store"]))}},Yt={class:"text-gray-900 text-lg font-medium"},Ot={class:"mt-1 text-sm text-gray-500"},Pt={setup(v){const{t:o,tm:i}=P(),p=N(),g=Z(),u=M("utils"),a=T({retrospective_edits:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.retrospective_edits.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.invoices.invoice_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(A,null,[c("h6",Yt,b(s.$tc("settings.customization.invoices.retrospective_edits")),1),c("p",Ot,b(s.$t("settings.customization.invoices.retrospective_edits_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"allow",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.allow"),size:"sm",name:"filter",value:"allow",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_partial_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_partial_paid"),size:"sm",name:"filter",value:"disable_on_invoice_partial_paid",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_paid"),size:"sm",name:"filter",value:"disable_on_invoice_paid",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_sent",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[3]||(_[3]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_sent"),size:"sm",name:"filter",value:"disable_on_invoice_sent"},null,8,["modelValue","label"])]),_:1})],64)}}},jt=["onSubmit"],Qt={class:"text-gray-900 text-lg font-medium"},Ht={class:"mt-1 text-sm text-gray-500 mb-2"},Xt={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},Jt={setup(v){const{t:o}=P(),i=N(),p=M("utils");let g=z(!1);const u=T({invoice_set_due_date_automatically:null,invoice_due_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.invoice_set_due_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.invoice_set_due_date_automatically=l}}),m=F(()=>({dueDateSettings:{invoice_due_date_days:{required:J.withMessage(o("validation.required"),nt(a.value)),numeric:J.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{dueDateSettings:u});async function _(){if(s.value.dueDateSettings.$touch(),s.value.dueDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.invoice_due_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Qt,b(n.$t("settings.customization.invoices.due_date")),1),c("p",Ht,b(n.$t("settings.customization.invoices.due_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.invoices.set_due_date_automatically"),description:n.$t("settings.customization.invoices.set_due_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),k(C,{key:0,label:n.$t("settings.customization.invoices.due_date_days"),error:e(s).dueDateSettings.invoice_due_date_days.$error&&e(s).dueDateSettings.invoice_due_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",Xt,[t(B,{modelValue:e(u).invoice_due_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).invoice_due_date_days=w),invalid:e(s).dueDateSettings.invoice_due_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).dueDateSettings.invoice_due_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),k(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,jt)}}},Kt=["onSubmit"],Wt={class:"text-gray-900 text-lg font-medium"},Zt={class:"mt-1 text-sm text-gray-500 mb-2"},te={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","invoice","invoiceCustom","company"]),g=z(["billing","customer","customerCustom","invoiceCustom"]),u=z(["shipping","customer","customerCustom","invoiceCustom"]),a=z(["company","invoiceCustom"]);let m=z(!1);const s=T({invoice_mail_body:null,invoice_company_address_format:null,invoice_shipping_address_format:null,invoice_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Wt,b(n.$t("settings.customization.invoices.default_formats")),1),c("p",Zt,b(n.$t("settings.customization.invoices.default_formats_description")),1),t(B,{label:n.$t("settings.customization.invoices.default_invoice_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).invoice_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).invoice_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).invoice_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).invoice_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),k(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Kt)}}},ee={class:"divide-y divide-gray-200"},se={setup(v){const o=M("utils"),i=N(),p=T({invoice_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.invoice_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{invoice_email_attachment:a}};p.invoice_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(Lt),t(m,{class:"my-8"}),t(Jt),t(m,{class:"my-8"}),t(Pt),t(m,{class:"my-8"}),t(te),t(m,{class:"mt-6 mb-2"}),c("ul",ee,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.invoices.invoice_email_attachment"),description:u.$t("settings.customization.invoices.invoice_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ae={setup(v){const o=gt();return(i,p)=>($(),k(tt,{type:"estimate","type-store":e(o),"default-series":"EST"},null,8,["type-store"]))}},ne=["onSubmit"],ie={class:"text-gray-900 text-lg font-medium"},oe={class:"mt-1 text-sm text-gray-500 mb-2"},le={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},me={setup(v){const{t:o}=P(),i=N(),p=M("utils");let g=z(!1);const u=T({estimate_set_expiry_date_automatically:null,estimate_expiry_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.estimate_set_expiry_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.estimate_set_expiry_date_automatically=l}}),m=F(()=>({expiryDateSettings:{estimate_expiry_date_days:{required:J.withMessage(o("validation.required"),nt(a.value)),numeric:J.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{expiryDateSettings:u});async function _(){if(s.value.expiryDateSettings.$touch(),s.value.expiryDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.estimate_expiry_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",ie,b(n.$t("settings.customization.estimates.expiry_date")),1),c("p",oe,b(n.$t("settings.customization.estimates.expiry_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.estimates.set_expiry_date_automatically"),description:n.$t("settings.customization.estimates.set_expiry_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),k(C,{key:0,label:n.$t("settings.customization.estimates.expiry_date_days"),error:e(s).expiryDateSettings.estimate_expiry_date_days.$error&&e(s).expiryDateSettings.estimate_expiry_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",le,[t(B,{modelValue:e(u).estimate_expiry_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).estimate_expiry_date_days=w),invalid:e(s).expiryDateSettings.estimate_expiry_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).expiryDateSettings.estimate_expiry_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),k(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ne)}}},ue=["onSubmit"],re={class:"text-gray-900 text-lg font-medium"},de={class:"mt-1 text-sm text-gray-500 mb-2"},ce={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","estimate","estimateCustom","company"]),g=z(["billing","customer","customerCustom","estimateCustom"]),u=z(["shipping","customer","customerCustom","estimateCustom"]),a=z(["company","estimateCustom"]);let m=z(!1);const s=T({estimate_mail_body:null,estimate_company_address_format:null,estimate_shipping_address_format:null,estimate_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",re,b(n.$t("settings.customization.estimates.default_formats")),1),c("p",de,b(n.$t("settings.customization.estimates.default_formats_description")),1),t(B,{label:n.$t("settings.customization.estimates.default_estimate_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).estimate_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).estimate_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).estimate_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).estimate_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),k(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ue)}}},_e={class:"text-gray-900 text-lg font-medium"},pe={class:"mt-1 text-sm text-gray-500"},ge={setup(v){const{t:o,tm:i}=P(),p=N(),g=Z(),u=M("utils"),a=T({estimate_convert_action:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.estimate_convert_action.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.estimates.estimate_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(A,null,[c("h6",_e,b(s.$tc("settings.customization.estimates.convert_estimate_options")),1),c("p",pe,b(s.$t("settings.customization.estimates.convert_estimate_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"no_action",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.no_action"),size:"sm",name:"filter",value:"no_action",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"delete_estimate",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.delete_estimate"),size:"sm",name:"filter",value:"delete_estimate",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"mark_estimate_as_accepted",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.mark_estimate_as_accepted"),size:"sm",name:"filter",value:"mark_estimate_as_accepted"},null,8,["modelValue","label"])]),_:1})],64)}}},ye={class:"divide-y divide-gray-200"},fe={setup(v){const o=M("utils"),i=N(),p=T({estimate_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.estimate_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{estimate_email_attachment:a}};p.estimate_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(ae),t(m,{class:"my-8"}),t(me),t(m,{class:"my-8"}),t(ge),t(m,{class:"my-8"}),t(ce),t(m,{class:"mt-6 mb-2"}),c("ul",ye,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.estimates.estimate_email_attachment"),description:u.$t("settings.customization.estimates.estimate_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ve={setup(v){const o=yt();return(i,p)=>($(),k(tt,{type:"payment","type-store":e(o),"default-series":"PAY"},null,8,["type-store"]))}},be=["onSubmit"],Se={class:"text-gray-900 text-lg font-medium"},$e={class:"mt-1 text-sm text-gray-500 mb-2"},Be={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","company","payment","paymentCustom"]),g=z(["billing","customer","customerCustom","paymentCustom"]),u=z(["company","paymentCustom"]);let a=z(!1);const m=T({payment_mail_body:null,payment_company_address_format:null,payment_from_customer_address_format:null});i.mergeSettings(m,x({},o.selectedCompanySettings));async function s(){a.value=!0;let _={settings:x({},m)};return await o.updateCompanySettings({data:_,message:"settings.customization.payments.payment_settings_updated"}),a.value=!1,!0}return(_,n)=>{const l=d("BaseCustomInput"),y=d("BaseInputGroup"),B=d("BaseIcon"),C=d("BaseButton");return $(),D("form",{onSubmit:Y(s,["prevent"])},[c("h6",Se,b(_.$t("settings.customization.payments.default_formats")),1),c("p",$e,b(_.$t("settings.customization.payments.default_formats_description")),1),t(y,{label:_.$t("settings.customization.payments.default_payment_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_mail_body,"onUpdate:modelValue":n[0]||(n[0]=h=>e(m).payment_mail_body=h),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=h=>e(m).payment_company_address_format=h),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.from_customer_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_from_customer_address_format,"onUpdate:modelValue":n[2]||(n[2]=h=>e(m).payment_from_customer_address_format=h),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(C,{loading:e(a),disabled:e(a),variant:"primary",type:"submit",class:"mt-4"},{left:r(h=>[e(a)?R("",!0):($(),k(B,{key:0,class:G(h.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(_.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,be)}}},he={class:"divide-y divide-gray-200"},ze={setup(v){const o=M("utils"),i=N(),p=T({payment_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.payment_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{payment_email_attachment:a}};p.payment_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(ve),t(m,{class:"my-8"}),t(Be),t(m,{class:"mt-6 mb-2"}),c("ul",he,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.payments.payment_email_attachment"),description:u.$t("settings.customization.payments.payment_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},Ve={class:"flex flex-wrap justify-end mt-2 lg:flex-nowrap"},Ie={class:"inline-block"},xe={setup(v){const{t:o}=P(),i=z(null),p=ft(),g=vt(),u=bt(),a=F(()=>[{key:"name",label:o("settings.customization.items.unit_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function m({page:l,filter:y,sort:B}){let C={orderByField:B.fieldName||"created_at",orderBy:B.order||"desc",page:l},h=await p.fetchItemUnits(C);return{data:h.data.data,pagination:{totalPages:h.data.meta.last_page,currentPage:l,totalCount:h.data.meta.total,limit:5}}}async function s(){g.openModal({title:o("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",refreshData:i.value.refresh,size:"sm"})}async function _(l){p.fetchItemUnit(l.data.id),g.openModal({title:o("settings.customization.items.edit_item_unit"),componentName:"ItemUnitModal",id:l.data.id,data:l.data,refreshData:i.value&&i.value.refresh})}function n(l){u.openDialog({title:o("general.are_you_sure"),message:o("settings.customization.items.item_unit_confirm_delete"),yesLabel:o("general.yes"),noLabel:o("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async y=>{y&&(await p.deleteItemUnit(l.data.id),i.value&&i.value.refresh())})}return(l,y)=>{const B=d("BaseIcon"),C=d("BaseButton"),h=d("BaseDropdownItem"),S=d("BaseDropdown"),w=d("BaseTable");return $(),D(A,null,[t(Vt),c("div",Ve,[t(C,{variant:"primary-outline",onClick:s},{left:r(U=>[t(B,{class:G(U.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[E(" "+b(l.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),t(w,{ref:(U,j)=>{j.table=U,i.value=U},class:"mt-10",data:m,columns:e(a)},{"cell-actions":r(({row:U})=>[t(S,null,{activator:r(()=>[c("div",Ie,[t(B,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:r(()=>[t(h,{onClick:j=>_(U)},{default:r(()=>[t(B,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),E(" "+b(l.$t("general.edit")),1)]),_:2},1032,["onClick"]),t(h,{onClick:j=>n(U)},{default:r(()=>[t(B,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),E(" "+b(l.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])],64)}}},we={class:"relative"},ke={setup(v){return(o,i)=>{const p=d("BaseTab"),g=d("BaseTabGroup"),u=d("BaseCard");return $(),D("div",we,[t(u,{"container-class":"px-4 py-5 sm:px-8 sm:py-2"},{default:r(()=>[t(g,null,{default:r(()=>[t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.invoices.title")},{default:r(()=>[t(se)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.estimates.title")},{default:r(()=>[t(fe)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.payments.title")},{default:r(()=>[t(ze)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.items.title")},{default:r(()=>[t(xe)]),_:1},8,["title"])]),_:1})]),_:1})])}}};export{ke as default};
+var ut=Object.defineProperty,rt=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var ct=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var st=(v,o,i)=>o in v?ut(v,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[o]=i,x=(v,o)=>{for(var i in o||(o={}))ct.call(o,i)&&st(v,i,o[i]);if(et)for(var i of et(o))_t.call(o,i)&&st(v,i,o[i]);return v},W=(v,o)=>rt(v,dt(o));import{c as N,m as Z,f as pt,j as gt,o as yt,p as ft,g as vt,i as bt}from"./main.366b2ac6.js";import{g as P,i as z,k as F,D as St,G as at,a9 as $t,r as d,o as $,c as D,t as c,x as b,b as t,w as r,B as Y,z as G,v as E,F as A,H as Bt,s as k,y as e,A as R,am as M,j as T,m as J,aU as nt,aV as it,q as ot,a0 as H}from"./vendor.e9042f2c.js";import{D as ht,d as zt}from"./DragIcon.de94c9e3.js";import{_ as Vt}from"./ItemUnitModal.890b7b40.js";const It={class:"text-gray-900 text-lg font-medium"},xt={class:"mt-1 text-sm text-gray-500"},wt={class:"overflow-x-auto"},Ct={class:"w-full mt-6 table-fixed"},Dt=c("colgroup",null,[c("col",{style:{width:"4%"}}),c("col",{style:{width:"45%"}}),c("col",{style:{width:"27%"}}),c("col",{style:{width:"24%"}})],-1),Ut=c("thead",null,[c("tr",null,[c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Component "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"}," Parameter "),c("th",{class:"px-5 py-3 text-sm not-italic font-medium leading-5 text-left text-gray-700 border-t border-b border-gray-200 border-solid"})])],-1),Ft={class:"relative"},Et={class:"text-gray-300 cursor-move handle align-middle"},kt={class:"px-5 py-4"},Nt={class:"block text-sm not-italic font-medium text-primary-800 whitespace-nowrap mr-2 min-w-[200px]"},Mt={class:"text-xs text-gray-500 mt-1"},Tt={class:"px-5 py-4 text-left align-middle"},Gt={class:"px-5 py-4 text-right align-middle pt-10"},qt=E(" Remove "),At={colspan:"2",class:"px-5 py-4"},Rt={class:"px-5 py-4 text-right align-middle",colspan:"2"},tt={props:{type:{type:String,required:!0},typeStore:{type:Object,required:!0},defaultSeries:{type:String,default:"INV"}},setup(v){const o=v,{t:i}=P(),p=N(),g=Z(),u=z([]),a=z(!1),m=z([{label:i("settings.customization.series"),description:i("settings.customization.series_description"),name:"SERIES",paramLabel:i("settings.customization.series_param_label"),value:o.defaultSeries,inputDisabled:!1,inputType:"text",allowMultiple:!1},{label:i("settings.customization.sequence"),description:i("settings.customization.sequence_description"),name:"SEQUENCE",paramLabel:i("settings.customization.sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.delimiter"),description:i("settings.customization.delimiter_description"),name:"DELIMITER",paramLabel:i("settings.customization.delimiter_param_label"),value:"-",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.customer_series"),description:i("settings.customization.customer_series_description"),name:"CUSTOMER_SERIES",paramLabel:"",value:"",inputDisabled:!0,inputType:"text",allowMultiple:!1},{label:i("settings.customization.customer_sequence"),description:i("settings.customization.customer_sequence_description"),name:"CUSTOMER_SEQUENCE",paramLabel:i("settings.customization.customer_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1},{label:i("settings.customization.date_format"),description:i("settings.customization.date_format_description"),name:"DATE_FORMAT",paramLabel:i("settings.customization.date_format_param_label"),value:"Y",inputDisabled:!1,inputType:"text",allowMultiple:!0},{label:i("settings.customization.random_sequence"),description:i("settings.customization.random_sequence_description"),name:"RANDOM_SEQUENCE",paramLabel:i("settings.customization.random_sequence_param_label"),value:"6",inputDisabled:!1,inputType:"number",allowMultiple:!1}]),s=F(()=>m.value.filter(function(f){return!u.value.some(function(V){return f.allowMultiple?!1:f.name==V.name})})),_=z(""),n=z(!1),l=z(!1),y=F(()=>{let f="";return u.value.forEach(V=>{let q=`{{${V.name}`;V.value&&(q+=`:${V.value}`),f+=`${q}}}`}),f});St(u,f=>{U()}),B();async function B(){let f={format:p.selectedCompanySettings[`${o.type}_number_format`]};l.value=!0,(await g.fetchPlaceholders(f)).data.placeholders.forEach(q=>{var O;let X=m.value.find(K=>K.name===q.name);const Q=(O=q.value)!=null?O:"";u.value.push(W(x({},X),{value:Q,id:at.raw()}))}),l.value=!1,U()}function C(f){return u.value.find(V=>V.name===f.name)}function h(f){C(f)&&!f.allowMultiple||(u.value.push(W(x({},f),{id:at.raw()})),U())}function S(f){u.value=u.value.filter(function(V){return f.id!==V.id})}function w(f,V){switch(V.name){case"SERIES":f.length>=4&&(f=f.substring(0,4));break;case"DELIMITER":f.length>=1&&(f=f.substring(0,1));break}setTimeout(()=>{V.value=f,U()},100)}const U=$t(()=>{j()},500);async function j(){if(!y.value){_.value="";return}let f={key:o.type,format:y.value};n.value=!0;let V=await o.typeStore.getNextNumber(f);n.value=!1,V.data&&(_.value=V.data.nextNumber)}async function lt(){if(n.value||l.value)return;a.value=!0;let f={settings:{}};return f.settings[o.type+"_number_format"]=y.value,await p.updateCompanySettings({data:f,message:`settings.customization.${o.type}s.${o.type}_settings_updated`}),a.value=!1,!0}return(f,V)=>{const q=d("BaseInput"),X=d("BaseInputGroup"),Q=d("BaseIcon"),O=d("BaseButton"),K=d("BaseDropdownItem"),mt=d("BaseDropdown");return $(),D(A,null,[c("h6",It,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format`)),1),c("p",xt,b(f.$t(`settings.customization.${v.type}s.${v.type}_number_format_description`)),1),c("div",wt,[c("table",Ct,[Dt,Ut,t(e(zt),{modelValue:u.value,"onUpdate:modelValue":V[1]||(V[1]=I=>u.value=I),class:"divide-y divide-gray-200","item-key":"id",tag:"tbody",handle:".handle",filter:".ignore-element"},{item:r(({element:I})=>[c("tr",Ft,[c("td",Et,[t(ht)]),c("td",kt,[c("label",Nt,b(I.label),1),c("p",Mt,b(I.description),1)]),c("td",Tt,[t(X,{label:I.paramLabel,class:"lg:col-span-3",required:""},{default:r(()=>[t(q,{modelValue:I.value,"onUpdate:modelValue":[L=>I.value=L,L=>w(L,I)],disabled:I.inputDisabled,type:I.inputType},null,8,["modelValue","onUpdate:modelValue","disabled","type"])]),_:2},1032,["label"])]),c("td",Gt,[t(O,{variant:"white",onClick:Y(L=>S(I),["prevent"])},{left:r(L=>[t(Q,{name:"XIcon",class:G(["!sm:m-0",L.class])},null,8,["class"])]),default:r(()=>[qt]),_:2},1032,["onClick"])])])]),footer:r(()=>[c("tr",null,[c("td",At,[t(X,{label:f.$t(`settings.customization.${v.type}s.preview_${v.type}_number`)},{default:r(()=>[t(q,{modelValue:_.value,"onUpdate:modelValue":V[0]||(V[0]=I=>_.value=I),disabled:"",loading:n.value},null,8,["modelValue","loading"])]),_:1},8,["label"])]),c("td",Rt,[t(mt,{"wrapper-class":"flex items-center justify-end mt-5"},{activator:r(()=>[t(O,{variant:"primary-outline"},{left:r(I=>[t(Q,{class:G(I.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[E(" "+b(f.$t("settings.customization.add_new_component")),1)]),_:1})]),default:r(()=>[($(!0),D(A,null,Bt(e(s),I=>($(),k(K,{key:I.label,onClick:Y(L=>h(I),["prevent"])},{default:r(()=>[E(b(I.label),1)]),_:2},1032,["onClick"]))),128))]),_:1})])])]),_:1},8,["modelValue"])])]),t(O,{loading:a.value,disabled:a.value,variant:"primary",type:"submit",class:"mt-4",onClick:lt},{left:r(I=>[a.value?R("",!0):($(),k(Q,{key:0,class:G(I.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(f.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],64)}}},Lt={setup(v){const o=pt();return(i,p)=>($(),k(tt,{type:"invoice","type-store":e(o),"default-series":"INV"},null,8,["type-store"]))}},Yt={class:"text-gray-900 text-lg font-medium"},Ot={class:"mt-1 text-sm text-gray-500"},Pt={setup(v){const{t:o,tm:i}=P(),p=N(),g=Z(),u=M("utils"),a=T({retrospective_edits:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.retrospective_edits.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.invoices.invoice_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(A,null,[c("h6",Yt,b(s.$tc("settings.customization.invoices.retrospective_edits")),1),c("p",Ot,b(s.$t("settings.customization.invoices.retrospective_edits_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"allow",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.allow"),size:"sm",name:"filter",value:"allow",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_partial_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_partial_paid"),size:"sm",name:"filter",value:"disable_on_invoice_partial_paid",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_paid",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_paid"),size:"sm",name:"filter",value:"disable_on_invoice_paid",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"disable_on_invoice_sent",modelValue:e(a).retrospective_edits,"onUpdate:modelValue":[_[3]||(_[3]=y=>e(a).retrospective_edits=y),m],label:s.$t("settings.customization.invoices.disable_on_invoice_sent"),size:"sm",name:"filter",value:"disable_on_invoice_sent"},null,8,["modelValue","label"])]),_:1})],64)}}},jt=["onSubmit"],Qt={class:"text-gray-900 text-lg font-medium"},Ht={class:"mt-1 text-sm text-gray-500 mb-2"},Xt={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},Jt={setup(v){const{t:o}=P(),i=N(),p=M("utils");let g=z(!1);const u=T({invoice_set_due_date_automatically:null,invoice_due_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.invoice_set_due_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.invoice_set_due_date_automatically=l}}),m=F(()=>({dueDateSettings:{invoice_due_date_days:{required:J.withMessage(o("validation.required"),nt(a.value)),numeric:J.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{dueDateSettings:u});async function _(){if(s.value.dueDateSettings.$touch(),s.value.dueDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.invoice_due_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Qt,b(n.$t("settings.customization.invoices.due_date")),1),c("p",Ht,b(n.$t("settings.customization.invoices.due_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.invoices.set_due_date_automatically"),description:n.$t("settings.customization.invoices.set_due_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),k(C,{key:0,label:n.$t("settings.customization.invoices.due_date_days"),error:e(s).dueDateSettings.invoice_due_date_days.$error&&e(s).dueDateSettings.invoice_due_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",Xt,[t(B,{modelValue:e(u).invoice_due_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).invoice_due_date_days=w),invalid:e(s).dueDateSettings.invoice_due_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).dueDateSettings.invoice_due_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),k(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,jt)}}},Kt=["onSubmit"],Wt={class:"text-gray-900 text-lg font-medium"},Zt={class:"mt-1 text-sm text-gray-500 mb-2"},te={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","invoice","invoiceCustom","company"]),g=z(["billing","customer","customerCustom","invoiceCustom"]),u=z(["shipping","customer","customerCustom","invoiceCustom"]),a=z(["company","invoiceCustom"]);let m=z(!1);const s=T({invoice_mail_body:null,invoice_company_address_format:null,invoice_shipping_address_format:null,invoice_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.invoices.invoice_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",Wt,b(n.$t("settings.customization.invoices.default_formats")),1),c("p",Zt,b(n.$t("settings.customization.invoices.default_formats_description")),1),t(B,{label:n.$t("settings.customization.invoices.default_invoice_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).invoice_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).invoice_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).invoice_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.invoices.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).invoice_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).invoice_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),k(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,Kt)}}},ee={class:"divide-y divide-gray-200"},se={setup(v){const o=M("utils"),i=N(),p=T({invoice_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.invoice_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{invoice_email_attachment:a}};p.invoice_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(Lt),t(m,{class:"my-8"}),t(Jt),t(m,{class:"my-8"}),t(Pt),t(m,{class:"my-8"}),t(te),t(m,{class:"mt-6 mb-2"}),c("ul",ee,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.invoices.invoice_email_attachment"),description:u.$t("settings.customization.invoices.invoice_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ae={setup(v){const o=gt();return(i,p)=>($(),k(tt,{type:"estimate","type-store":e(o),"default-series":"EST"},null,8,["type-store"]))}},ne=["onSubmit"],ie={class:"text-gray-900 text-lg font-medium"},oe={class:"mt-1 text-sm text-gray-500 mb-2"},le={class:"w-full sm:w-1/2 md:w-1/4 lg:w-1/5"},me={setup(v){const{t:o}=P(),i=N(),p=M("utils");let g=z(!1);const u=T({estimate_set_expiry_date_automatically:null,estimate_expiry_date_days:null});p.mergeSettings(u,x({},i.selectedCompanySettings));const a=F({get:()=>u.estimate_set_expiry_date_automatically==="YES",set:async n=>{const l=n?"YES":"NO";u.estimate_set_expiry_date_automatically=l}}),m=F(()=>({expiryDateSettings:{estimate_expiry_date_days:{required:J.withMessage(o("validation.required"),nt(a.value)),numeric:J.withMessage(o("validation.numbers_only"),it)}}})),s=ot(m,{expiryDateSettings:u});async function _(){if(s.value.expiryDateSettings.$touch(),s.value.expiryDateSettings.$invalid)return!1;g.value=!0;let n={settings:x({},u)};return a.value||delete n.settings.estimate_expiry_date_days,await i.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),g.value=!1,!0}return(n,l)=>{const y=d("BaseSwitchSection"),B=d("BaseInput"),C=d("BaseInputGroup"),h=d("BaseIcon"),S=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",ie,b(n.$t("settings.customization.estimates.expiry_date")),1),c("p",oe,b(n.$t("settings.customization.estimates.expiry_date_description")),1),t(y,{modelValue:e(a),"onUpdate:modelValue":l[0]||(l[0]=w=>H(a)?a.value=w:null),title:n.$t("settings.customization.estimates.set_expiry_date_automatically"),description:n.$t("settings.customization.estimates.set_expiry_date_automatically_description")},null,8,["modelValue","title","description"]),e(a)?($(),k(C,{key:0,label:n.$t("settings.customization.estimates.expiry_date_days"),error:e(s).expiryDateSettings.estimate_expiry_date_days.$error&&e(s).expiryDateSettings.estimate_expiry_date_days.$errors[0].$message,class:"mt-2 mb-4"},{default:r(()=>[c("div",le,[t(B,{modelValue:e(u).estimate_expiry_date_days,"onUpdate:modelValue":l[1]||(l[1]=w=>e(u).estimate_expiry_date_days=w),invalid:e(s).expiryDateSettings.estimate_expiry_date_days.$error,type:"number",onInput:l[2]||(l[2]=w=>e(s).expiryDateSettings.estimate_expiry_date_days.$touch())},null,8,["modelValue","invalid"])])]),_:1},8,["label","error"])):R("",!0),t(S,{loading:e(g),disabled:e(g),variant:"primary",type:"submit",class:"mt-4"},{left:r(w=>[e(g)?R("",!0):($(),k(h,{key:0,class:G(w.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ne)}}},ue=["onSubmit"],re={class:"text-gray-900 text-lg font-medium"},de={class:"mt-1 text-sm text-gray-500 mb-2"},ce={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","estimate","estimateCustom","company"]),g=z(["billing","customer","customerCustom","estimateCustom"]),u=z(["shipping","customer","customerCustom","estimateCustom"]),a=z(["company","estimateCustom"]);let m=z(!1);const s=T({estimate_mail_body:null,estimate_company_address_format:null,estimate_shipping_address_format:null,estimate_billing_address_format:null});i.mergeSettings(s,x({},o.selectedCompanySettings));async function _(){m.value=!0;let n={settings:x({},s)};return await o.updateCompanySettings({data:n,message:"settings.customization.estimates.estimate_settings_updated"}),m.value=!1,!0}return(n,l)=>{const y=d("BaseCustomInput"),B=d("BaseInputGroup"),C=d("BaseIcon"),h=d("BaseButton");return $(),D("form",{onSubmit:Y(_,["prevent"])},[c("h6",re,b(n.$t("settings.customization.estimates.default_formats")),1),c("p",de,b(n.$t("settings.customization.estimates.default_formats_description")),1),t(B,{label:n.$t("settings.customization.estimates.default_estimate_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_mail_body,"onUpdate:modelValue":l[0]||(l[0]=S=>e(s).estimate_mail_body=S),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_company_address_format,"onUpdate:modelValue":l[1]||(l[1]=S=>e(s).estimate_company_address_format=S),fields:a.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.shipping_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_shipping_address_format,"onUpdate:modelValue":l[2]||(l[2]=S=>e(s).estimate_shipping_address_format=S),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(B,{label:n.$t("settings.customization.estimates.billing_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(y,{modelValue:e(s).estimate_billing_address_format,"onUpdate:modelValue":l[3]||(l[3]=S=>e(s).estimate_billing_address_format=S),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(h,{loading:e(m),disabled:e(m),variant:"primary",type:"submit",class:"mt-4"},{left:r(S=>[e(m)?R("",!0):($(),k(C,{key:0,class:G(S.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(n.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,ue)}}},_e={class:"text-gray-900 text-lg font-medium"},pe={class:"mt-1 text-sm text-gray-500"},ge={setup(v){const{t:o,tm:i}=P(),p=N(),g=Z(),u=M("utils"),a=T({estimate_convert_action:null});u.mergeSettings(a,x({},p.selectedCompanySettings)),F(()=>g.config.estimate_convert_action.map(s=>(s.title=o(s.key),s)));async function m(){let s={settings:x({},a)};return await p.updateCompanySettings({data:s,message:"settings.customization.estimates.estimate_settings_updated"}),!0}return(s,_)=>{const n=d("BaseRadio"),l=d("BaseInputGroup");return $(),D(A,null,[c("h6",_e,b(s.$tc("settings.customization.estimates.convert_estimate_options")),1),c("p",pe,b(s.$t("settings.customization.estimates.convert_estimate_description")),1),t(l,{required:""},{default:r(()=>[t(n,{id:"no_action",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[0]||(_[0]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.no_action"),size:"sm",name:"filter",value:"no_action",class:"mt-2"},null,8,["modelValue","label"]),t(n,{id:"delete_estimate",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[1]||(_[1]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.delete_estimate"),size:"sm",name:"filter",value:"delete_estimate",class:"my-2"},null,8,["modelValue","label"]),t(n,{id:"mark_estimate_as_accepted",modelValue:e(a).estimate_convert_action,"onUpdate:modelValue":[_[2]||(_[2]=y=>e(a).estimate_convert_action=y),m],label:s.$t("settings.customization.estimates.mark_estimate_as_accepted"),size:"sm",name:"filter",value:"mark_estimate_as_accepted"},null,8,["modelValue","label"])]),_:1})],64)}}},ye={class:"divide-y divide-gray-200"},fe={setup(v){const o=M("utils"),i=N(),p=T({estimate_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.estimate_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{estimate_email_attachment:a}};p.estimate_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(ae),t(m,{class:"my-8"}),t(me),t(m,{class:"my-8"}),t(ge),t(m,{class:"my-8"}),t(ce),t(m,{class:"mt-6 mb-2"}),c("ul",ye,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.estimates.estimate_email_attachment"),description:u.$t("settings.customization.estimates.estimate_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},ve={setup(v){const o=yt();return(i,p)=>($(),k(tt,{type:"payment","type-store":e(o),"default-series":"PAY"},null,8,["type-store"]))}},be=["onSubmit"],Se={class:"text-gray-900 text-lg font-medium"},$e={class:"mt-1 text-sm text-gray-500 mb-2"},Be={setup(v){const o=N(),i=M("utils"),p=z(["customer","customerCustom","company","payment","paymentCustom"]),g=z(["billing","customer","customerCustom","paymentCustom"]),u=z(["company","paymentCustom"]);let a=z(!1);const m=T({payment_mail_body:null,payment_company_address_format:null,payment_from_customer_address_format:null});i.mergeSettings(m,x({},o.selectedCompanySettings));async function s(){a.value=!0;let _={settings:x({},m)};return await o.updateCompanySettings({data:_,message:"settings.customization.payments.payment_settings_updated"}),a.value=!1,!0}return(_,n)=>{const l=d("BaseCustomInput"),y=d("BaseInputGroup"),B=d("BaseIcon"),C=d("BaseButton");return $(),D("form",{onSubmit:Y(s,["prevent"])},[c("h6",Se,b(_.$t("settings.customization.payments.default_formats")),1),c("p",$e,b(_.$t("settings.customization.payments.default_formats_description")),1),t(y,{label:_.$t("settings.customization.payments.default_payment_email_body"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_mail_body,"onUpdate:modelValue":n[0]||(n[0]=h=>e(m).payment_mail_body=h),fields:p.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.company_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_company_address_format,"onUpdate:modelValue":n[1]||(n[1]=h=>e(m).payment_company_address_format=h),fields:u.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(y,{label:_.$t("settings.customization.payments.from_customer_address_format"),class:"mt-6 mb-4"},{default:r(()=>[t(l,{modelValue:e(m).payment_from_customer_address_format,"onUpdate:modelValue":n[2]||(n[2]=h=>e(m).payment_from_customer_address_format=h),fields:g.value},null,8,["modelValue","fields"])]),_:1},8,["label"]),t(C,{loading:e(a),disabled:e(a),variant:"primary",type:"submit",class:"mt-4"},{left:r(h=>[e(a)?R("",!0):($(),k(B,{key:0,class:G(h.class),name:"SaveIcon"},null,8,["class"]))]),default:r(()=>[E(" "+b(_.$t("settings.customization.save")),1)]),_:1},8,["loading","disabled"])],40,be)}}},he={class:"divide-y divide-gray-200"},ze={setup(v){const o=M("utils"),i=N(),p=T({payment_email_attachment:null});o.mergeSettings(p,x({},i.selectedCompanySettings));const g=F({get:()=>p.payment_email_attachment==="YES",set:async u=>{const a=u?"YES":"NO";let m={settings:{payment_email_attachment:a}};p.payment_email_attachment=a,await i.updateCompanySettings({data:m,message:"general.setting_updated"})}});return(u,a)=>{const m=d("BaseDivider"),s=d("BaseSwitchSection");return $(),D(A,null,[t(ve),t(m,{class:"my-8"}),t(Be),t(m,{class:"mt-6 mb-2"}),c("ul",he,[t(s,{modelValue:e(g),"onUpdate:modelValue":a[0]||(a[0]=_=>H(g)?g.value=_:null),title:u.$t("settings.customization.payments.payment_email_attachment"),description:u.$t("settings.customization.payments.payment_email_attachment_setting_description")},null,8,["modelValue","title","description"])])],64)}}},Ve={class:"flex flex-wrap justify-end mt-2 lg:flex-nowrap"},Ie={class:"inline-block"},xe={setup(v){const{t:o}=P(),i=z(null),p=ft(),g=vt(),u=bt(),a=F(()=>[{key:"name",label:o("settings.customization.items.unit_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function m({page:l,filter:y,sort:B}){let C={orderByField:B.fieldName||"created_at",orderBy:B.order||"desc",page:l},h=await p.fetchItemUnits(C);return{data:h.data.data,pagination:{totalPages:h.data.meta.last_page,currentPage:l,totalCount:h.data.meta.total,limit:5}}}async function s(){g.openModal({title:o("settings.customization.items.add_item_unit"),componentName:"ItemUnitModal",refreshData:i.value.refresh,size:"sm"})}async function _(l){p.fetchItemUnit(l.data.id),g.openModal({title:o("settings.customization.items.edit_item_unit"),componentName:"ItemUnitModal",id:l.data.id,data:l.data,refreshData:i.value&&i.value.refresh})}function n(l){u.openDialog({title:o("general.are_you_sure"),message:o("settings.customization.items.item_unit_confirm_delete"),yesLabel:o("general.yes"),noLabel:o("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async y=>{y&&(await p.deleteItemUnit(l.data.id),i.value&&i.value.refresh())})}return(l,y)=>{const B=d("BaseIcon"),C=d("BaseButton"),h=d("BaseDropdownItem"),S=d("BaseDropdown"),w=d("BaseTable");return $(),D(A,null,[t(Vt),c("div",Ve,[t(C,{variant:"primary-outline",onClick:s},{left:r(U=>[t(B,{class:G(U.class),name:"PlusIcon"},null,8,["class"])]),default:r(()=>[E(" "+b(l.$t("settings.customization.items.add_item_unit")),1)]),_:1})]),t(w,{ref:(U,j)=>{j.table=U,i.value=U},class:"mt-10",data:m,columns:e(a)},{"cell-actions":r(({row:U})=>[t(S,null,{activator:r(()=>[c("div",Ie,[t(B,{name:"DotsHorizontalIcon",class:"text-gray-500"})])]),default:r(()=>[t(h,{onClick:j=>_(U)},{default:r(()=>[t(B,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),E(" "+b(l.$t("general.edit")),1)]),_:2},1032,["onClick"]),t(h,{onClick:j=>n(U)},{default:r(()=>[t(B,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),E(" "+b(l.$t("general.delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["columns"])],64)}}},we={class:"relative"},ke={setup(v){return(o,i)=>{const p=d("BaseTab"),g=d("BaseTabGroup"),u=d("BaseCard");return $(),D("div",we,[t(u,{"container-class":"px-4 py-5 sm:px-8 sm:py-2"},{default:r(()=>[t(g,null,{default:r(()=>[t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.invoices.title")},{default:r(()=>[t(se)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.estimates.title")},{default:r(()=>[t(fe)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.payments.title")},{default:r(()=>[t(ze)]),_:1},8,["title"]),t(p,{"tab-panel-container":"py-4 mt-px",title:o.$t("settings.customization.items.title")},{default:r(()=>[t(xe)]),_:1},8,["title"])]),_:1})]),_:1})])}}};export{ke as default};
diff --git a/public/build/assets/Dashboard.9741b290.js b/public/build/assets/Dashboard.8bd846e2.js
similarity index 98%
rename from public/build/assets/Dashboard.9741b290.js
rename to public/build/assets/Dashboard.8bd846e2.js
index 0697e5b3a..f962868bc 100644
--- a/public/build/assets/Dashboard.9741b290.js
+++ b/public/build/assets/Dashboard.8bd846e2.js
@@ -1 +1 @@
-import{_ as g,b as V,c as H,d as I,e as m}from"./main.109918ee.js";import{o as d,c as f,t as e,r as l,s as p,w as c,b as t,W as j,x as _,an as L,z as F,am as M,y as s,v as b,i as B,D as N,g as Z,k as P,a5 as A}from"./vendor.e9042f2c.js";import{_ as O}from"./LineChart.9a44ef81.js";import{_ as W}from"./InvoiceIndexDropdown.47602d2c.js";import{_ as z}from"./EstimateIndexDropdown.aab46b8d.js";const q={},R={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U=e("circle",{cx:"25",cy:"25",r:"25",fill:"#FDE4E5"},null,-1),Y=e("path",{d:"M27.2031 23.6016C28.349 23.9401 29.2083 24.6562 29.7812 25.75C30.3802 26.8438 30.4714 27.9766 30.0547 29.1484C29.7422 30.0078 29.2083 30.6979 28.4531 31.2188C27.6979 31.7135 26.8516 31.974 25.9141 32V33.875C25.9141 34.0573 25.849 34.2005 25.7188 34.3047C25.6146 34.4349 25.4714 34.5 25.2891 34.5H24.0391C23.8568 34.5 23.7005 34.4349 23.5703 34.3047C23.4661 34.2005 23.4141 34.0573 23.4141 33.875V32C22.1641 32 21.0443 31.6094 20.0547 30.8281C19.8984 30.6979 19.8073 30.5417 19.7812 30.3594C19.7552 30.1771 19.8203 30.0208 19.9766 29.8906L21.3047 28.5625C21.5651 28.3281 21.8255 28.3021 22.0859 28.4844C22.4766 28.7448 22.9193 28.875 23.4141 28.875H25.9922C26.3307 28.875 26.6042 28.7708 26.8125 28.5625C27.0469 28.3281 27.1641 28.0417 27.1641 27.7031C27.1641 27.1302 26.8906 26.7656 26.3438 26.6094L22.3203 25.4375C21.4349 25.1771 20.6927 24.7083 20.0938 24.0312C19.4948 23.3542 19.1432 22.5729 19.0391 21.6875C18.9349 20.4115 19.2995 19.3177 20.1328 18.4062C20.9922 17.4688 22.0599 17 23.3359 17H23.4141V15.125C23.4141 14.9427 23.4661 14.7995 23.5703 14.6953C23.7005 14.5651 23.8568 14.5 24.0391 14.5H25.2891C25.4714 14.5 25.6146 14.5651 25.7188 14.6953C25.849 14.7995 25.9141 14.9427 25.9141 15.125V17C27.1641 17 28.2839 17.3906 29.2734 18.1719C29.4297 18.3021 29.5208 18.4583 29.5469 18.6406C29.5729 18.8229 29.5078 18.9792 29.3516 19.1094L28.0234 20.4375C27.763 20.6719 27.5026 20.6979 27.2422 20.5156C26.8516 20.2552 26.4089 20.125 25.9141 20.125H23.3359C22.9974 20.125 22.7109 20.2422 22.4766 20.4766C22.2682 20.6849 22.1641 20.9583 22.1641 21.2969C22.1641 21.5312 22.2422 21.7526 22.3984 21.9609C22.5547 22.1693 22.75 22.3125 22.9844 22.3906L27.2031 23.6016Z",fill:"#FB7178"},null,-1),G=[U,Y];function J(r,o){return d(),f("svg",R,G)}var K=g(q,[["render",J]]);const Q={},X={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),te=e("path",{d:"M28.2656 23.0547C27.3021 24.0182 26.1302 24.5 24.75 24.5C23.3698 24.5 22.1849 24.0182 21.1953 23.0547C20.2318 22.0651 19.75 20.8802 19.75 19.5C19.75 18.1198 20.2318 16.9479 21.1953 15.9844C22.1849 14.9948 23.3698 14.5 24.75 14.5C26.1302 14.5 27.3021 14.9948 28.2656 15.9844C29.2552 16.9479 29.75 18.1198 29.75 19.5C29.75 20.8802 29.2552 22.0651 28.2656 23.0547ZM28.2656 25.75C29.6979 25.75 30.9219 26.2708 31.9375 27.3125C32.9792 28.3281 33.5 29.5521 33.5 30.9844V32.625C33.5 33.1458 33.3177 33.5885 32.9531 33.9531C32.5885 34.3177 32.1458 34.5 31.625 34.5H17.875C17.3542 34.5 16.9115 34.3177 16.5469 33.9531C16.1823 33.5885 16 33.1458 16 32.625V30.9844C16 29.5521 16.5078 28.3281 17.5234 27.3125C18.5651 26.2708 19.8021 25.75 21.2344 25.75H21.8984C22.8099 26.1667 23.7604 26.375 24.75 26.375C25.7396 26.375 26.6901 26.1667 27.6016 25.75H28.2656Z",fill:"#5851D8"},null,-1),se=[ee,te];function oe(r,o){return d(),f("svg",X,se)}var ae=g(Q,[["render",oe]]);const ne={},le={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ce=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),re=e("path",{d:"M28.25 24.5V27H20.75V24.5H28.25ZM31.7266 18.6016C31.9089 18.7839 32 19.0052 32 19.2656V19.5H27V14.5H27.2344C27.4948 14.5 27.7161 14.5911 27.8984 14.7734L31.7266 18.6016ZM25.75 19.8125C25.75 20.0729 25.8411 20.2943 26.0234 20.4766C26.2057 20.6589 26.4271 20.75 26.6875 20.75H32V33.5625C32 33.8229 31.9089 34.0443 31.7266 34.2266C31.5443 34.4089 31.3229 34.5 31.0625 34.5H17.9375C17.6771 34.5 17.4557 34.4089 17.2734 34.2266C17.0911 34.0443 17 33.8229 17 33.5625V15.4375C17 15.1771 17.0911 14.9557 17.2734 14.7734C17.4557 14.5911 17.6771 14.5 17.9375 14.5H25.75V19.8125ZM19.5 17.3125V17.9375C19.5 18.1458 19.6042 18.25 19.8125 18.25H22.9375C23.1458 18.25 23.25 18.1458 23.25 17.9375V17.3125C23.25 17.1042 23.1458 17 22.9375 17H19.8125C19.6042 17 19.5 17.1042 19.5 17.3125ZM19.5 19.8125V20.4375C19.5 20.6458 19.6042 20.75 19.8125 20.75H22.9375C23.1458 20.75 23.25 20.6458 23.25 20.4375V19.8125C23.25 19.6042 23.1458 19.5 22.9375 19.5H19.8125C19.6042 19.5 19.5 19.6042 19.5 19.8125ZM29.5 31.6875V31.0625C29.5 30.8542 29.3958 30.75 29.1875 30.75H26.0625C25.8542 30.75 25.75 30.8542 25.75 31.0625V31.6875C25.75 31.8958 25.8542 32 26.0625 32H29.1875C29.3958 32 29.5 31.8958 29.5 31.6875ZM29.5 23.875C29.5 23.6927 29.4349 23.5495 29.3047 23.4453C29.2005 23.3151 29.0573 23.25 28.875 23.25H20.125C19.9427 23.25 19.7865 23.3151 19.6562 23.4453C19.5521 23.5495 19.5 23.6927 19.5 23.875V27.625C19.5 27.8073 19.5521 27.9635 19.6562 28.0938C19.7865 28.1979 19.9427 28.25 20.125 28.25H28.875C29.0573 28.25 29.2005 28.1979 29.3047 28.0938C29.4349 27.9635 29.5 27.8073 29.5 27.625V23.875Z",fill:"#5851D8"},null,-1),ie=[ce,re];function de(r,o){return d(),f("svg",le,ie)}var _e=g(ne,[["render",de]]);const ue={},me={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),Ce=e("path",{d:"M26.75 19.8125C26.75 20.0729 26.8411 20.2943 27.0234 20.4766C27.2057 20.6589 27.4271 20.75 27.6875 20.75H33V33.5625C33 33.8229 32.9089 34.0443 32.7266 34.2266C32.5443 34.4089 32.3229 34.5 32.0625 34.5H18.9375C18.6771 34.5 18.4557 34.4089 18.2734 34.2266C18.0911 34.0443 18 33.8229 18 33.5625V15.4375C18 15.1771 18.0911 14.9557 18.2734 14.7734C18.4557 14.5911 18.6771 14.5 18.9375 14.5H26.75V19.8125ZM33 19.2656V19.5H28V14.5H28.2344C28.4948 14.5 28.7161 14.5911 28.8984 14.7734L32.7266 18.6016C32.9089 18.7839 33 19.0052 33 19.2656Z",fill:"#5851D8"},null,-1),pe=[he,Ce];function xe(r,o){return d(),f("svg",me,pe)}var fe=g(ue,[["render",xe]]);const be={},ge={class:"flex items-center"};function ye(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:c(()=>[e("div",null,[t(a,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),t(a,{class:"h-3 w-28 xl:h-4",lines:1})]),e("div",ge,[t(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var ve=g(be,[["render",ye]]);const we={},$e={class:"flex items-center"};function Be(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:c(()=>[e("div",null,[t(a,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),t(a,{class:"w-20 h-3 xl:h-4",lines:1})]),e("div",$e,[t(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var Ee=g(we,[["render",Be]]);const De={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},Ve={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},Ie={class:"flex items-center"},E={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:String,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(r){return(o,a)=>{const n=l("router-link");return r.loading?r.large?(d(),p(ve,{key:1})):(d(),p(Ee,{key:2})):(d(),p(n,{key:0,class:F(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":r.large}]),to:r.route},{default:c(()=>[e("div",null,[e("span",De,[j(o.$slots,"default")]),e("span",Ve,_(r.label),1)]),e("div",Ie,[(d(),p(L(r.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},Te={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},Se={setup(r){M("utils");const o=V(),a=H(),n=I();return(u,y)=>{const v=l("BaseFormatMoney");return d(),f("div",Te,[t(E,{"icon-component":K,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_INVOICE)?"/admin/invoices":"",large:!0,label:u.$t("dashboard.cards.due_amount")},{default:c(()=>[t(v,{amount:s(o).stats.totalAmountDue,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])]),_:1},8,["loading","route","label"]),t(E,{"icon-component":ae,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_CUSTOMER)?"/admin/customers":"",label:u.$t("dashboard.cards.customers")},{default:c(()=>[b(_(s(o).stats.totalCustomerCount),1)]),_:1},8,["loading","route","label"]),t(E,{"icon-component":_e,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_INVOICE)?"/admin/invoices":"",label:u.$t("dashboard.cards.invoices")},{default:c(()=>[b(_(s(o).stats.totalInvoiceCount),1)]),_:1},8,["loading","route","label"]),t(E,{"icon-component":fe,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_ESTIMATE)?"/admin/estimates":"",label:u.$t("dashboard.cards.estimates")},{default:c(()=>[b(_(s(o).stats.totalEstimateCount),1)]),_:1},8,["loading","route","label"])])}}},ke={},He={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-8"},Me={class:"flex items-center justify-between mb-2 xl:mb-4"},Pe={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Ae={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},je={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Le={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Fe={class:"flex flex-col items-center justify-center col-span-3 p-6 border-t border-gray-200 border-solid lg:justify-end lg:items-end lg:col-span-1"};function Ne(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},{default:c(()=>[e("div",He,[e("div",Me,[t(a,{class:"h-10 w-36",lines:1}),t(a,{class:"h-10 w-36 !mt-0",lines:1})]),t(n,{class:"h-80 xl:h-72 sm:w-full"})]),e("div",Pe,[e("div",Ae,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",je,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",Le,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",Fe,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})])])]),_:1})}var Ze=g(ke,[["render",Ne]]);const Oe={key:0,class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},We={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-6"},ze={class:"flex justify-between mt-1 mb-4 flex-col md:flex-row"},qe={class:"flex items-center sw-section-title h-10"},Re={class:"w-full my-2 md:m-0 md:w-40 h-10"},Ue={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Ye={class:"p-6"},Ge={class:"text-xs leading-5 lg:text-sm"},Je=e("br",null,null,-1),Ke={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl"},Qe={class:"p-6"},Xe={class:"text-xs leading-5 lg:text-sm"},et=e("br",null,null,-1),tt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-green-400"},st={class:"p-6"},ot={class:"text-xs leading-5 lg:text-sm"},at=e("br",null,null,-1),nt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-red-400"},lt={class:"col-span-3 p-6 border-t border-gray-200 border-solid lg:col-span-1"},ct={class:"text-xs leading-5 lg:text-sm"},rt=e("br",null,null,-1),it={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-primary-500"},dt={setup(r){const o=V(),a=H();M("utils");const n=I(),u=B(["This year","Previous year"]),y=B("This year");N(y,h=>{h==="Previous year"?v({previous_year:!0}):v()},{immediate:!0});async function v(h){n.hasAbilities(m.DASHBOARD)&&await o.loadData(h)}return(h,w)=>{const D=l("BaseIcon"),x=l("BaseMultiselect"),C=l("BaseFormatMoney");return d(),f("div",null,[s(o).isDashboardDataLoaded?(d(),f("div",Oe,[e("div",We,[e("div",ze,[e("h6",qe,[t(D,{name:"ChartSquareBarIcon",class:"text-primary-400 mr-1"}),b(" "+_(h.$t("dashboard.monthly_chart.title")),1)]),e("div",Re,[t(x,{modelValue:y.value,"onUpdate:modelValue":w[0]||(w[0]=$=>y.value=$),options:u.value,"allow-empty":!1,"show-labels":!1,placeholder:h.$t("dashboard.select_year"),"can-deselect":!1},null,8,["modelValue","options","placeholder"])])]),t(O,{invoices:s(o).chartData.invoiceTotals,expenses:s(o).chartData.expenseTotals,receipts:s(o).chartData.receiptTotals,income:s(o).chartData.netIncomeTotals,labels:s(o).chartData.months,class:"sm:w-full"},null,8,["invoices","expenses","receipts","income","labels"])]),e("div",Ue,[e("div",Ye,[e("span",Ge,_(h.$t("dashboard.chart_info.total_sales")),1),Je,e("span",Ke,[t(C,{amount:s(o).totalSales,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",Qe,[e("span",Xe,_(h.$t("dashboard.chart_info.total_receipts")),1),et,e("span",tt,[t(C,{amount:s(o).totalReceipts,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",st,[e("span",ot,_(h.$t("dashboard.chart_info.total_expense")),1),at,e("span",nt,[t(C,{amount:s(o).totalExpenses,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",lt,[e("span",ct,_(h.$t("dashboard.chart_info.net_income")),1),rt,e("span",it,[t(C,{amount:s(o).totalNetIncome,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])])])])):(d(),p(Ze,{key:1}))])}}},_t={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},ut={class:"due-invoices"},mt={class:"relative z-10 flex items-center justify-between mb-3"},ht={class:"mb-0 text-xl font-semibold leading-normal"},Ct={class:"recent-estimates"},pt={class:"relative z-10 flex items-center justify-between mb-3"},xt={class:"mb-0 text-xl font-semibold leading-normal"},ft={setup(r){const o=V(),{t:a}=Z(),n=I(),u=B(null),y=B(null),v=P(()=>[{key:"formattedDueDate",label:a("dashboard.recent_invoices_card.due_on")},{key:"user",label:a("dashboard.recent_invoices_card.customer")},{key:"due_amount",label:a("dashboard.recent_invoices_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]),h=P(()=>[{key:"formattedEstimateDate",label:a("dashboard.recent_estimate_card.date")},{key:"user",label:a("dashboard.recent_estimate_card.customer")},{key:"total",label:a("dashboard.recent_estimate_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]);function w(){return n.hasAbilities([m.DELETE_INVOICE,m.EDIT_INVOICE,m.VIEW_INVOICE,m.SEND_INVOICE])}function D(){return n.hasAbilities([m.CREATE_ESTIMATE,m.EDIT_ESTIMATE,m.VIEW_ESTIMATE,m.SEND_ESTIMATE])}return(x,C)=>{const $=l("BaseButton"),T=l("router-link"),S=l("BaseFormatMoney"),k=l("BaseTable");return d(),f("div",null,[e("div",_t,[e("div",ut,[e("div",mt,[e("h6",ht,_(x.$t("dashboard.recent_invoices_card.title")),1),t($,{size:"sm",variant:"primary-outline",onClick:C[0]||(C[0]=i=>x.$router.push("/admin/invoices"))},{default:c(()=>[b(_(x.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),t(k,{data:s(o).recentDueInvoices,columns:s(v),loading:!s(o).isDashboardDataLoaded},A({"cell-user":c(({row:i})=>[t(T,{to:{path:`invoices/${i.data.id}/view`},class:"font-medium text-primary-500"},{default:c(()=>[b(_(i.data.customer.name),1)]),_:2},1032,["to"])]),"cell-due_amount":c(({row:i})=>[t(S,{amount:i.data.due_amount,currency:i.data.customer.currency},null,8,["amount","currency"])]),_:2},[w()?{name:"cell-actions",fn:c(({row:i})=>[t(W,{row:i.data,table:u.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])]),e("div",Ct,[e("div",pt,[e("h6",xt,_(x.$t("dashboard.recent_estimate_card.title")),1),t($,{variant:"primary-outline",size:"sm",onClick:C[1]||(C[1]=i=>x.$router.push("/admin/estimates"))},{default:c(()=>[b(_(x.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),t(k,{data:s(o).recentEstimates,columns:s(h),loading:!s(o).isDashboardDataLoaded},A({"cell-user":c(({row:i})=>[t(T,{to:{path:`estimates/${i.data.id}/view`},class:"font-medium text-primary-500"},{default:c(()=>[b(_(i.data.customer.name),1)]),_:2},1032,["to"])]),"cell-total":c(({row:i})=>[t(S,{amount:i.data.total,currency:i.data.customer.currency},null,8,["amount","currency"])]),_:2},[D()?{name:"cell-actions",fn:c(({row:i})=>[t(z,{row:i,table:y.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])])])}}},$t={setup(r){return(o,a)=>{const n=l("BasePage");return d(),p(n,null,{default:c(()=>[t(Se),t(dt),t(ft)]),_:1})}}};export{$t as default};
+import{_ as g,b as V,c as H,d as I,e as m}from"./main.366b2ac6.js";import{o as d,c as f,t as e,r as l,s as p,w as c,b as t,W as j,x as _,an as L,z as F,am as M,y as s,v as b,i as B,D as N,g as Z,k as P,a5 as A}from"./vendor.e9042f2c.js";import{_ as O}from"./LineChart.31a5d7db.js";import{_ as W}from"./InvoiceIndexDropdown.15437462.js";import{_ as z}from"./EstimateIndexDropdown.9014e991.js";const q={},R={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U=e("circle",{cx:"25",cy:"25",r:"25",fill:"#FDE4E5"},null,-1),Y=e("path",{d:"M27.2031 23.6016C28.349 23.9401 29.2083 24.6562 29.7812 25.75C30.3802 26.8438 30.4714 27.9766 30.0547 29.1484C29.7422 30.0078 29.2083 30.6979 28.4531 31.2188C27.6979 31.7135 26.8516 31.974 25.9141 32V33.875C25.9141 34.0573 25.849 34.2005 25.7188 34.3047C25.6146 34.4349 25.4714 34.5 25.2891 34.5H24.0391C23.8568 34.5 23.7005 34.4349 23.5703 34.3047C23.4661 34.2005 23.4141 34.0573 23.4141 33.875V32C22.1641 32 21.0443 31.6094 20.0547 30.8281C19.8984 30.6979 19.8073 30.5417 19.7812 30.3594C19.7552 30.1771 19.8203 30.0208 19.9766 29.8906L21.3047 28.5625C21.5651 28.3281 21.8255 28.3021 22.0859 28.4844C22.4766 28.7448 22.9193 28.875 23.4141 28.875H25.9922C26.3307 28.875 26.6042 28.7708 26.8125 28.5625C27.0469 28.3281 27.1641 28.0417 27.1641 27.7031C27.1641 27.1302 26.8906 26.7656 26.3438 26.6094L22.3203 25.4375C21.4349 25.1771 20.6927 24.7083 20.0938 24.0312C19.4948 23.3542 19.1432 22.5729 19.0391 21.6875C18.9349 20.4115 19.2995 19.3177 20.1328 18.4062C20.9922 17.4688 22.0599 17 23.3359 17H23.4141V15.125C23.4141 14.9427 23.4661 14.7995 23.5703 14.6953C23.7005 14.5651 23.8568 14.5 24.0391 14.5H25.2891C25.4714 14.5 25.6146 14.5651 25.7188 14.6953C25.849 14.7995 25.9141 14.9427 25.9141 15.125V17C27.1641 17 28.2839 17.3906 29.2734 18.1719C29.4297 18.3021 29.5208 18.4583 29.5469 18.6406C29.5729 18.8229 29.5078 18.9792 29.3516 19.1094L28.0234 20.4375C27.763 20.6719 27.5026 20.6979 27.2422 20.5156C26.8516 20.2552 26.4089 20.125 25.9141 20.125H23.3359C22.9974 20.125 22.7109 20.2422 22.4766 20.4766C22.2682 20.6849 22.1641 20.9583 22.1641 21.2969C22.1641 21.5312 22.2422 21.7526 22.3984 21.9609C22.5547 22.1693 22.75 22.3125 22.9844 22.3906L27.2031 23.6016Z",fill:"#FB7178"},null,-1),G=[U,Y];function J(r,o){return d(),f("svg",R,G)}var K=g(q,[["render",J]]);const Q={},X={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),te=e("path",{d:"M28.2656 23.0547C27.3021 24.0182 26.1302 24.5 24.75 24.5C23.3698 24.5 22.1849 24.0182 21.1953 23.0547C20.2318 22.0651 19.75 20.8802 19.75 19.5C19.75 18.1198 20.2318 16.9479 21.1953 15.9844C22.1849 14.9948 23.3698 14.5 24.75 14.5C26.1302 14.5 27.3021 14.9948 28.2656 15.9844C29.2552 16.9479 29.75 18.1198 29.75 19.5C29.75 20.8802 29.2552 22.0651 28.2656 23.0547ZM28.2656 25.75C29.6979 25.75 30.9219 26.2708 31.9375 27.3125C32.9792 28.3281 33.5 29.5521 33.5 30.9844V32.625C33.5 33.1458 33.3177 33.5885 32.9531 33.9531C32.5885 34.3177 32.1458 34.5 31.625 34.5H17.875C17.3542 34.5 16.9115 34.3177 16.5469 33.9531C16.1823 33.5885 16 33.1458 16 32.625V30.9844C16 29.5521 16.5078 28.3281 17.5234 27.3125C18.5651 26.2708 19.8021 25.75 21.2344 25.75H21.8984C22.8099 26.1667 23.7604 26.375 24.75 26.375C25.7396 26.375 26.6901 26.1667 27.6016 25.75H28.2656Z",fill:"#5851D8"},null,-1),se=[ee,te];function oe(r,o){return d(),f("svg",X,se)}var ae=g(Q,[["render",oe]]);const ne={},le={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ce=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),re=e("path",{d:"M28.25 24.5V27H20.75V24.5H28.25ZM31.7266 18.6016C31.9089 18.7839 32 19.0052 32 19.2656V19.5H27V14.5H27.2344C27.4948 14.5 27.7161 14.5911 27.8984 14.7734L31.7266 18.6016ZM25.75 19.8125C25.75 20.0729 25.8411 20.2943 26.0234 20.4766C26.2057 20.6589 26.4271 20.75 26.6875 20.75H32V33.5625C32 33.8229 31.9089 34.0443 31.7266 34.2266C31.5443 34.4089 31.3229 34.5 31.0625 34.5H17.9375C17.6771 34.5 17.4557 34.4089 17.2734 34.2266C17.0911 34.0443 17 33.8229 17 33.5625V15.4375C17 15.1771 17.0911 14.9557 17.2734 14.7734C17.4557 14.5911 17.6771 14.5 17.9375 14.5H25.75V19.8125ZM19.5 17.3125V17.9375C19.5 18.1458 19.6042 18.25 19.8125 18.25H22.9375C23.1458 18.25 23.25 18.1458 23.25 17.9375V17.3125C23.25 17.1042 23.1458 17 22.9375 17H19.8125C19.6042 17 19.5 17.1042 19.5 17.3125ZM19.5 19.8125V20.4375C19.5 20.6458 19.6042 20.75 19.8125 20.75H22.9375C23.1458 20.75 23.25 20.6458 23.25 20.4375V19.8125C23.25 19.6042 23.1458 19.5 22.9375 19.5H19.8125C19.6042 19.5 19.5 19.6042 19.5 19.8125ZM29.5 31.6875V31.0625C29.5 30.8542 29.3958 30.75 29.1875 30.75H26.0625C25.8542 30.75 25.75 30.8542 25.75 31.0625V31.6875C25.75 31.8958 25.8542 32 26.0625 32H29.1875C29.3958 32 29.5 31.8958 29.5 31.6875ZM29.5 23.875C29.5 23.6927 29.4349 23.5495 29.3047 23.4453C29.2005 23.3151 29.0573 23.25 28.875 23.25H20.125C19.9427 23.25 19.7865 23.3151 19.6562 23.4453C19.5521 23.5495 19.5 23.6927 19.5 23.875V27.625C19.5 27.8073 19.5521 27.9635 19.6562 28.0938C19.7865 28.1979 19.9427 28.25 20.125 28.25H28.875C29.0573 28.25 29.2005 28.1979 29.3047 28.0938C29.4349 27.9635 29.5 27.8073 29.5 27.625V23.875Z",fill:"#5851D8"},null,-1),ie=[ce,re];function de(r,o){return d(),f("svg",le,ie)}var _e=g(ne,[["render",de]]);const ue={},me={width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he=e("circle",{cx:"25",cy:"25",r:"25",fill:"#EAF1FB"},null,-1),Ce=e("path",{d:"M26.75 19.8125C26.75 20.0729 26.8411 20.2943 27.0234 20.4766C27.2057 20.6589 27.4271 20.75 27.6875 20.75H33V33.5625C33 33.8229 32.9089 34.0443 32.7266 34.2266C32.5443 34.4089 32.3229 34.5 32.0625 34.5H18.9375C18.6771 34.5 18.4557 34.4089 18.2734 34.2266C18.0911 34.0443 18 33.8229 18 33.5625V15.4375C18 15.1771 18.0911 14.9557 18.2734 14.7734C18.4557 14.5911 18.6771 14.5 18.9375 14.5H26.75V19.8125ZM33 19.2656V19.5H28V14.5H28.2344C28.4948 14.5 28.7161 14.5911 28.8984 14.7734L32.7266 18.6016C32.9089 18.7839 33 19.0052 33 19.2656Z",fill:"#5851D8"},null,-1),pe=[he,Ce];function xe(r,o){return d(),f("svg",me,pe)}var fe=g(ue,[["render",xe]]);const be={},ge={class:"flex items-center"};function ye(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-3 xl:p-4"},{default:c(()=>[e("div",null,[t(a,{class:"h-5 -mb-1 w-14 xl:mb-6 xl:h-7",lines:1}),t(a,{class:"h-3 w-28 xl:h-4",lines:1})]),e("div",ge,[t(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var ve=g(be,[["render",ye]]);const we={},$e={class:"flex items-center"};function Be(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{rounded:!0,class:"relative flex justify-between w-full p-3 bg-white rounded shadow lg:col-span-2 xl:p-4"},{default:c(()=>[e("div",null,[t(a,{class:"w-12 h-5 -mb-1 xl:mb-6 xl:h-7",lines:1}),t(a,{class:"w-20 h-3 xl:h-4",lines:1})]),e("div",$e,[t(n,{circle:!0,class:"w-10 h-10 xl:w-12 xl:h-12"})])]),_:1})}var Ee=g(we,[["render",Be]]);const De={class:"text-xl font-semibold leading-tight text-black xl:text-3xl"},Ve={class:"block mt-1 text-sm leading-tight text-gray-500 xl:text-lg"},Ie={class:"flex items-center"},E={props:{iconComponent:{type:Object,required:!0},loading:{type:Boolean,default:!1},route:{type:String,required:!0},label:{type:String,required:!0},large:{type:Boolean,default:!1}},setup(r){return(o,a)=>{const n=l("router-link");return r.loading?r.large?(d(),p(ve,{key:1})):(d(),p(Ee,{key:2})):(d(),p(n,{key:0,class:F(["relative flex justify-between p-3 bg-white rounded shadow hover:bg-gray-50 xl:p-4 lg:col-span-2",{"lg:!col-span-3":r.large}]),to:r.route},{default:c(()=>[e("div",null,[e("span",De,[j(o.$slots,"default")]),e("span",Ve,_(r.label),1)]),e("div",Ie,[(d(),p(L(r.iconComponent),{class:"w-10 h-10 xl:w-12 xl:h-12"}))])]),_:3},8,["class","to"]))}}},Te={class:"grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8"},Se={setup(r){M("utils");const o=V(),a=H(),n=I();return(u,y)=>{const v=l("BaseFormatMoney");return d(),f("div",Te,[t(E,{"icon-component":K,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_INVOICE)?"/admin/invoices":"",large:!0,label:u.$t("dashboard.cards.due_amount")},{default:c(()=>[t(v,{amount:s(o).stats.totalAmountDue,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])]),_:1},8,["loading","route","label"]),t(E,{"icon-component":ae,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_CUSTOMER)?"/admin/customers":"",label:u.$t("dashboard.cards.customers")},{default:c(()=>[b(_(s(o).stats.totalCustomerCount),1)]),_:1},8,["loading","route","label"]),t(E,{"icon-component":_e,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_INVOICE)?"/admin/invoices":"",label:u.$t("dashboard.cards.invoices")},{default:c(()=>[b(_(s(o).stats.totalInvoiceCount),1)]),_:1},8,["loading","route","label"]),t(E,{"icon-component":fe,loading:!s(o).isDashboardDataLoaded,route:s(n).hasAbilities(s(m).VIEW_ESTIMATE)?"/admin/estimates":"",label:u.$t("dashboard.cards.estimates")},{default:c(()=>[b(_(s(o).stats.totalEstimateCount),1)]),_:1},8,["loading","route","label"])])}}},ke={},He={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-8"},Me={class:"flex items-center justify-between mb-2 xl:mb-4"},Pe={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Ae={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},je={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Le={class:"flex flex-col items-center justify-center p-6 lg:justify-end lg:items-end"},Fe={class:"flex flex-col items-center justify-center col-span-3 p-6 border-t border-gray-200 border-solid lg:justify-end lg:items-end lg:col-span-1"};function Ne(r,o){const a=l("BaseContentPlaceholdersText"),n=l("BaseContentPlaceholdersBox"),u=l("BaseContentPlaceholders");return d(),p(u,{class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},{default:c(()=>[e("div",He,[e("div",Me,[t(a,{class:"h-10 w-36",lines:1}),t(a,{class:"h-10 w-36 !mt-0",lines:1})]),t(n,{class:"h-80 xl:h-72 sm:w-full"})]),e("div",Pe,[e("div",Ae,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",je,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",Le,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})]),e("div",Fe,[t(a,{class:"h-3 w-14 xl:h-4",lines:1}),t(a,{class:"w-20 h-5 xl:h-6",lines:1})])])]),_:1})}var Ze=g(ke,[["render",Ne]]);const Oe={key:0,class:"grid grid-cols-10 mt-8 bg-white rounded shadow"},We={class:"grid grid-cols-1 col-span-10 px-4 py-5 lg:col-span-7 xl:col-span-8 sm:p-6"},ze={class:"flex justify-between mt-1 mb-4 flex-col md:flex-row"},qe={class:"flex items-center sw-section-title h-10"},Re={class:"w-full my-2 md:m-0 md:w-40 h-10"},Ue={class:"grid grid-cols-3 col-span-10 text-center border-t border-l border-gray-200 border-solid lg:border-t-0 lg:text-right lg:col-span-3 xl:col-span-2 lg:grid-cols-1"},Ye={class:"p-6"},Ge={class:"text-xs leading-5 lg:text-sm"},Je=e("br",null,null,-1),Ke={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl"},Qe={class:"p-6"},Xe={class:"text-xs leading-5 lg:text-sm"},et=e("br",null,null,-1),tt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-green-400"},st={class:"p-6"},ot={class:"text-xs leading-5 lg:text-sm"},at=e("br",null,null,-1),nt={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-red-400"},lt={class:"col-span-3 p-6 border-t border-gray-200 border-solid lg:col-span-1"},ct={class:"text-xs leading-5 lg:text-sm"},rt=e("br",null,null,-1),it={class:"block mt-1 text-xl font-semibold leading-8 lg:text-2xl text-primary-500"},dt={setup(r){const o=V(),a=H();M("utils");const n=I(),u=B(["This year","Previous year"]),y=B("This year");N(y,h=>{h==="Previous year"?v({previous_year:!0}):v()},{immediate:!0});async function v(h){n.hasAbilities(m.DASHBOARD)&&await o.loadData(h)}return(h,w)=>{const D=l("BaseIcon"),x=l("BaseMultiselect"),C=l("BaseFormatMoney");return d(),f("div",null,[s(o).isDashboardDataLoaded?(d(),f("div",Oe,[e("div",We,[e("div",ze,[e("h6",qe,[t(D,{name:"ChartSquareBarIcon",class:"text-primary-400 mr-1"}),b(" "+_(h.$t("dashboard.monthly_chart.title")),1)]),e("div",Re,[t(x,{modelValue:y.value,"onUpdate:modelValue":w[0]||(w[0]=$=>y.value=$),options:u.value,"allow-empty":!1,"show-labels":!1,placeholder:h.$t("dashboard.select_year"),"can-deselect":!1},null,8,["modelValue","options","placeholder"])])]),t(O,{invoices:s(o).chartData.invoiceTotals,expenses:s(o).chartData.expenseTotals,receipts:s(o).chartData.receiptTotals,income:s(o).chartData.netIncomeTotals,labels:s(o).chartData.months,class:"sm:w-full"},null,8,["invoices","expenses","receipts","income","labels"])]),e("div",Ue,[e("div",Ye,[e("span",Ge,_(h.$t("dashboard.chart_info.total_sales")),1),Je,e("span",Ke,[t(C,{amount:s(o).totalSales,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",Qe,[e("span",Xe,_(h.$t("dashboard.chart_info.total_receipts")),1),et,e("span",tt,[t(C,{amount:s(o).totalReceipts,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",st,[e("span",ot,_(h.$t("dashboard.chart_info.total_expense")),1),at,e("span",nt,[t(C,{amount:s(o).totalExpenses,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])]),e("div",lt,[e("span",ct,_(h.$t("dashboard.chart_info.net_income")),1),rt,e("span",it,[t(C,{amount:s(o).totalNetIncome,currency:s(a).selectedCompanyCurrency},null,8,["amount","currency"])])])])])):(d(),p(Ze,{key:1}))])}}},_t={class:"grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2"},ut={class:"due-invoices"},mt={class:"relative z-10 flex items-center justify-between mb-3"},ht={class:"mb-0 text-xl font-semibold leading-normal"},Ct={class:"recent-estimates"},pt={class:"relative z-10 flex items-center justify-between mb-3"},xt={class:"mb-0 text-xl font-semibold leading-normal"},ft={setup(r){const o=V(),{t:a}=Z(),n=I(),u=B(null),y=B(null),v=P(()=>[{key:"formattedDueDate",label:a("dashboard.recent_invoices_card.due_on")},{key:"user",label:a("dashboard.recent_invoices_card.customer")},{key:"due_amount",label:a("dashboard.recent_invoices_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]),h=P(()=>[{key:"formattedEstimateDate",label:a("dashboard.recent_estimate_card.date")},{key:"user",label:a("dashboard.recent_estimate_card.customer")},{key:"total",label:a("dashboard.recent_estimate_card.amount_due")},{key:"actions",tdClass:"text-right text-sm font-medium pl-0",thClass:"text-right pl-0",sortable:!1}]);function w(){return n.hasAbilities([m.DELETE_INVOICE,m.EDIT_INVOICE,m.VIEW_INVOICE,m.SEND_INVOICE])}function D(){return n.hasAbilities([m.CREATE_ESTIMATE,m.EDIT_ESTIMATE,m.VIEW_ESTIMATE,m.SEND_ESTIMATE])}return(x,C)=>{const $=l("BaseButton"),T=l("router-link"),S=l("BaseFormatMoney"),k=l("BaseTable");return d(),f("div",null,[e("div",_t,[e("div",ut,[e("div",mt,[e("h6",ht,_(x.$t("dashboard.recent_invoices_card.title")),1),t($,{size:"sm",variant:"primary-outline",onClick:C[0]||(C[0]=i=>x.$router.push("/admin/invoices"))},{default:c(()=>[b(_(x.$t("dashboard.recent_invoices_card.view_all")),1)]),_:1})]),t(k,{data:s(o).recentDueInvoices,columns:s(v),loading:!s(o).isDashboardDataLoaded},A({"cell-user":c(({row:i})=>[t(T,{to:{path:`invoices/${i.data.id}/view`},class:"font-medium text-primary-500"},{default:c(()=>[b(_(i.data.customer.name),1)]),_:2},1032,["to"])]),"cell-due_amount":c(({row:i})=>[t(S,{amount:i.data.due_amount,currency:i.data.customer.currency},null,8,["amount","currency"])]),_:2},[w()?{name:"cell-actions",fn:c(({row:i})=>[t(W,{row:i.data,table:u.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])]),e("div",Ct,[e("div",pt,[e("h6",xt,_(x.$t("dashboard.recent_estimate_card.title")),1),t($,{variant:"primary-outline",size:"sm",onClick:C[1]||(C[1]=i=>x.$router.push("/admin/estimates"))},{default:c(()=>[b(_(x.$t("dashboard.recent_estimate_card.view_all")),1)]),_:1})]),t(k,{data:s(o).recentEstimates,columns:s(h),loading:!s(o).isDashboardDataLoaded},A({"cell-user":c(({row:i})=>[t(T,{to:{path:`estimates/${i.data.id}/view`},class:"font-medium text-primary-500"},{default:c(()=>[b(_(i.data.customer.name),1)]),_:2},1032,["to"])]),"cell-total":c(({row:i})=>[t(S,{amount:i.data.total,currency:i.data.customer.currency},null,8,["amount","currency"])]),_:2},[D()?{name:"cell-actions",fn:c(({row:i})=>[t(z,{row:i,table:y.value},null,8,["row","table"])])}:void 0]),1032,["data","columns","loading"])])])])}}},$t={setup(r){return(o,a)=>{const n=l("BasePage");return d(),p(n,null,{default:c(()=>[t(Se),t(dt),t(ft)]),_:1})}}};export{$t as default};
diff --git a/public/build/assets/DragIcon.e15154fb.js b/public/build/assets/DragIcon.de94c9e3.js
similarity index 99%
rename from public/build/assets/DragIcon.e15154fb.js
rename to public/build/assets/DragIcon.de94c9e3.js
index f87e0bccd..3e201d76c 100644
--- a/public/build/assets/DragIcon.e15154fb.js
+++ b/public/build/assets/DragIcon.de94c9e3.js
@@ -1,4 +1,4 @@
-import{aW as $r,aX as Br,aR as Kr,aY as Hr,o as Wr,c as Xr,t as Yr}from"./vendor.e9042f2c.js";import{_ as Vr}from"./main.109918ee.js";var gr={exports:{}};/**!
+import{aW as $r,aX as Br,aR as Kr,aY as Hr,o as Wr,c as Xr,t as Yr}from"./vendor.e9042f2c.js";import{_ as Vr}from"./main.366b2ac6.js";var gr={exports:{}};/**!
* Sortable 1.14.0
* @author RubaXa