whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/Settings-5d6Om5mh.js
import{bs as E,Z as I,p as _,u as w,j as n,ad as V,cx as $,ae as D,bf as M,d as h,c5 as g,e as p,cq as R,a as T,_ as A,bj as O,C as P,by as m,cv as z,E as H,aA as k,gp as J,bp as U,bC as Q,H as X}from"./bundle.OlIVtvc7.js";import{D as Z}from"./DesignSelector-CCHne1Q2.js";import{u as G}from"./hooks-C7TEhFVH.js";import{templateEntites as K}from"./Create-CV9qh_Sx.js";import{I as W}from"./Import-Dp8FQZJ0.js";import"./designs-5HfLWi9D.js";const S=E(!1);function Y({onImport:t}){const[c,o]=I(S),[e,a]=_.useState(""),{t:d}=w(),i=()=>{try{const l=JSON.parse(e);Object.hasOwn(l,"product")||(l.product=""),Object.hasOwn(l,"task")||(l.task=""),t(l),o(!1),a("")}catch(l){console.error(l),M.error()}};return n.jsxs(V,{title:d("import_design"),visible:c,onClose:o,children:[n.jsx($,{element:"textarea",onValueChange:l=>a(l)}),n.jsx(D,{onClick:i,children:d("import")})]})}function q(t){const c=h(),o=e=>{var a,d;return`#${e.number} (${c(e.amount,(a=e==null?void 0:e.client)==null?void 0:a.country_id,(d=e==null?void 0:e.client)==null?void 0:d.settings.currency_id)})`};return n.jsx(g,{inputOptions:{value:t.value??null},endpoint:p("/api/v1/invoices?include=client&filter_deleted_clients=true&status=active"),onChange:e=>e.resource&&t.onChange(e.resource),entryOptions:{id:"id",value:"id",label:"number",dropdownLabelFn:e=>o(e),inputLabelFn:e=>e?o(e):""},onDismiss:t.onClearButtonClick,errorMessage:t.errorMessage})}function ee(t){const c=h(),o=e=>{var a,d;return`#${e.number} (${c(e.amount,(a=e==null?void 0:e.client)==null?void 0:a.country_id,(d=e==null?void 0:e.client)==null?void 0:d.settings.currency_id)})`};return n.jsx(g,{inputOptions:{value:t.value??null},endpoint:p("/api/v1/quotes?include=client&filter_deleted_clients=true&status=active"),onChange:e=>e.resource&&t.onChange(e.resource),entryOptions:{id:"id",value:"id",label:"number",dropdownLabelFn:e=>o(e),inputLabelFn:e=>e?o(e):""},onDismiss:t.onClearButtonClick,errorMessage:t.errorMessage})}function ne(t){const c=h(),o=e=>{var a,d;return`#${e.number} (${c(e.amount,(a=e==null?void 0:e.client)==null?void 0:a.country_id,(d=e==null?void 0:e.client)==null?void 0:d.settings.currency_id)})`};return n.jsx(g,{inputOptions:{value:t.value??null},endpoint:p("/api/v1/credits?include=client&filter_deleted_clients=true&status=active"),onChange:e=>e.resource&&t.onChange(e.resource),entryOptions:{id:"id",value:"id",label:"number",dropdownLabelFn:e=>o(e),inputLabelFn:e=>e?o(e):""},onDismiss:t.onClearButtonClick,errorMessage:t.errorMessage})}function te(t){const c=h(),o=e=>{var a,d;return`#${e.number} (${c(e.amount,(a=e==null?void 0:e.vendor)==null?void 0:a.country_id,(d=e==null?void 0:e.vendor)==null?void 0:d.currency_id)})`};return n.jsx(g,{inputOptions:{value:t.value??null},endpoint:p("/api/v1/purchase_orders?include=vendor&status=active"),onChange:e=>e.resource&&t.onChange(e.resource),entryOptions:{id:"id",value:"id",label:"number",dropdownLabelFn:e=>o(e),inputLabelFn:e=>e?o(e):""},onDismiss:t.onClearButtonClick,errorMessage:t.errorMessage})}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function oe({size:t="1.2rem",color:c="#000",strokeWidth:o="1.5"}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",style:{width:t,height:t},viewBox:"0 0 12 12",children:[n.jsx("line",{x1:"6",y1:"1",x2:"6",y2:"8.75",fill:"none",stroke:c,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":o,"data-color":"color-2"}),n.jsx("polyline",{points:"8.25 3 6 .75 3.75 3",fill:"none",stroke:c,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":o,"data-color":"color-2"}),n.jsx("path",{d:"m3.5,5.25h-.25c-1.105,0-2,.895-2,2v2c0,1.105.895,2,2,2h5.5c1.105,0,2-.895,2-2v-2c0-1.105-.895-2-2-2h-.25",fill:"none",stroke:c,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":o})]})}const y=X.div` background-color: ${({theme:t})=>t.backgroundColor}; &:hover { background-color: ${({theme:t})=>t.hoverBackgroundColor}; } `;function ce(){var j,f,v;const{t}=w(),c=R(),{errors:o,isFormBusy:e,shouldRenderHTML:a,setShouldRenderHTML:d,payload:i,setPayload:l}=c,r=T(),B=A(S),C=()=>{if(i.design){const s=new Blob([JSON.stringify(i.design.design)],{type:"text/plain"}),u=URL.createObjectURL(s),x=document.createElement("a");x.download=`${i.design.name}_${t("export").toLowerCase()}`,x.href=u,x.target="_blank",document.body.appendChild(x),x.click(),document.body.removeChild(x)}},L=_.useCallback(()=>{if(!navigator.clipboard)return C();i.design&&navigator.clipboard.writeText(JSON.stringify(i.design.design)).then(()=>M.success(O("copied_to_clipboard",{value:t("design").toLowerCase()}))).catch(()=>C())},[i.design]),{handlePropertyChange:b,handleResourceChange:N}=G({payload:i,setPayload:l});return n.jsxs(n.Fragment,{children:[n.jsx(Y,{onImport:s=>b("design",s)}),n.jsxs(P,{title:t("settings"),padding:"small",className:"shadow-sm pb-4",style:{borderColor:r.$24},headerStyle:{borderColor:r.$20},children:[n.jsx(m,{leftSide:t("name"),children:n.jsx($,{value:(j=i.design)==null?void 0:j.name,onValueChange:s=>b("name",s),errorMessage:o==null?void 0:o.errors.name})}),(f=i.design)!=null&&f.is_template?n.jsx(m,{leftSide:t("resource"),children:n.jsx("div",{className:"flex flex-col space-y-2",children:K.map(s=>{var u;return n.jsx(z,{label:t(s),value:s,onValueChange:(x,F)=>N(x,!!F),checked:(u=i.design)==null?void 0:u.entities.includes(s)},s)})})}):null,n.jsx(m,{leftSide:t("design"),children:n.jsx(Z,{onChange:s=>b("design",s.design),actionVisibility:!1,errorMessage:(o==null?void 0:o.errors["design.header"])||(o==null?void 0:o.errors["design.body"])||(o==null?void 0:o.errors["design.footer"])||(o==null?void 0:o.errors["design.includes"])})}),!((v=i.design)!=null&&v.is_template)&&n.jsxs(n.Fragment,{children:[n.jsx(m,{leftSide:t("entity"),children:n.jsxs(H,{value:i.entity||"invoice",onValueChange:s=>l(u=>({...u,entity:s,entity_id:"-1"})),customSelector:!0,dismissable:!1,errorMessage:o==null?void 0:o.errors.entity,children:[n.jsx("option",{value:"invoice",children:t("invoice")}),n.jsx("option",{value:"quote",children:t("quote")}),n.jsx("option",{value:"credit",children:t("credit")}),n.jsx("option",{value:"purchase_order",children:t("purchase_order")})]})}),i.entity==="invoice"&&n.jsx(m,{leftSide:t("invoice"),children:n.jsx(q,{value:i.entity_id,onChange:s=>l(u=>({...u,entity_id:s.id||"-1"})),onClearButtonClick:()=>l(s=>({...s,entity_id:"-1"})),errorMessage:o==null?void 0:o.errors.entity_id})}),i.entity==="quote"&&n.jsx(m,{leftSide:t("quote"),children:n.jsx(ee,{value:i.entity_id,onChange:s=>l(u=>({...u,entity_id:s.id||"-1"})),onClearButtonClick:()=>l(s=>({...s,entity_id:"-1"})),errorMessage:o==null?void 0:o.errors.entity_id})}),i.entity==="credit"&&n.jsx(m,{leftSide:t("credit"),children:n.jsx(ne,{value:i.entity_id,onChange:s=>l(u=>({...u,entity_id:s.id||"-1"})),onClearButtonClick:()=>l(s=>({...s,entity_id:"-1"})),errorMessage:o==null?void 0:o.errors.entity_id})}),i.entity==="purchase_order"&&n.jsx(m,{leftSide:t("purchase_order"),children:n.jsx(te,{value:i.entity_id,onChange:s=>l(u=>({...u,entity_id:s.id||"-1"})),onClearButtonClick:()=>l(s=>({...s,entity_id:"-1"})),errorMessage:o==null?void 0:o.errors.entity_id})})]}),n.jsx("div",{className:"px-4 sm:px-6 pb-6 pt-3",children:n.jsx(k,{className:"border-dashed",borderColor:r.$20,withoutPadding:!0})}),n.jsxs("div",{className:"flex flex-col space-y-4 px-4 sm:px-6",children:[n.jsxs(y,{className:"flex justify-between items-center p-4 border shadow-sm w-full rounded-md cursor-pointer",theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},onClick:()=>window.open("https://invoiceninja.github.io/en/custom-fields/","_blank"),style:{borderColor:r.$24},children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx(J,{color:r.$3,size:"1.4rem"}),n.jsx("span",{className:"text-sm",style:{color:r.$3},children:t("api_docs")})]}),n.jsx("div",{children:n.jsx(U,{color:r.$3,size:"1.4rem",strokeWidth:"1.5"})})]}),n.jsxs(y,{className:"flex items-center p-4 border shadow-sm w-full rounded-md cursor-pointer space-x-2",theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},onClick:()=>B(!0),style:{borderColor:r.$24},children:[n.jsx("div",{children:n.jsx(W,{color:r.$3,size:"1.4rem"})}),n.jsx("span",{className:"text-sm",style:{color:r.$3},children:t("import")})]}),n.jsxs(y,{className:"flex items-center p-4 border shadow-sm w-full rounded-md cursor-pointer space-x-2",theme:{backgroundColor:r.$1,hoverBackgroundColor:r.$4},onClick:L,style:{borderColor:r.$24},children:[n.jsx("div",{children:n.jsx(oe,{color:r.$3,size:"1.4rem",strokeWidth:"1"})}),n.jsx("span",{className:"text-sm",style:{color:r.$3},children:t("export")})]})]}),n.jsx("div",{className:"px-4 sm:px-6 pb-2 pt-6",children:n.jsx(k,{className:"border-dashed",borderColor:r.$20,withoutPadding:!0})}),n.jsx(m,{leftSide:t("html_mode"),children:n.jsx(Q,{checked:a,onChange:s=>d(s),disabled:e})})]})]})}export{ce as default};
Copyright ©2021 || Defacer Indonesia