PageSourceSearch

https://idwell.ai/assets/index-Ca9ueq6E.js

js idwell.ai collected 2026-10-05 12:53:06 UTC 10,978 bytes, 2 lines download raw bytes

1import{_ as L,ab as _,bj as V,T as A,a7 as O}from"./index-ClxRxC2T.js";import{b as I,j as e,M as r,u as M,a1 as H,l as B,av as D,bJ as U,o as C,W as Q,F as t,a7 as q,T as z,k,he as Y,cc as $,m as x,J as G,cj as J,b9 as h,b8 as W}from"./index.css.ts.vanilla-DcQK6rwz.js";import{i as X}from"./companies-BH5bb0Ww.js";import{m as Z}from"./download-C8cQxDGK.js";import{f as ee}from"./export-BePr8TP6.js";import{d as ne}from"./debounce-CMcdZk5q.js";import{R as ae}from"./RestoreScroll-BzpcUQqj.js";import{m as le}from"./makeRow-B-kYgpCS.js";const te=(function(){var l=[{defaultValue:null,kind:"LocalArgument",name:"clientCompanyRowId"},{defaultValue:null,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"searchText"}],n={kind:"Variable",name:"clientCompanyRowId",variableName:"clientCompanyRowId"},i={kind:"Variable",name:"searchText",variableName:"searchText"},c={alias:null,args:null,kind:"ScalarField",name:"totalCount",storageKey:null},u=[c],o=[{kind:"Variable",name:"after",variableName:"cursor"},n,{kind:"Variable",name:"first",variableName:"count"},i];return{fragment:{argumentDefinitions:l,kind:"Fragment",metadata:null,name:"SettingsClientCompanyCostCentersPagePaginationQuery",selections:[{args:[n,{kind:"V
1ariable",name:"count",variableName:"count"},{kind:"Variable",name:"cursor",variableName:"cursor"},i],kind:"FragmentSpread",name:"SettingsClientCompanyCostCentersPage_query"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:l,kind:"Operation",name:"SettingsClientCompanyCostCentersPagePaginationQuery",selections:[{alias:null,args:[{fields:[n],kind:"ObjectValue",name:"condition"}],concreteType:"ClientCompanyCostCentersConnection",kind:"LinkedField",name:"allClientCompanyCostCenters",plural:!1,selections:u,storageKey:null},{alias:null,args:o,concreteType:"ClientCompanyCostCentersConnection",kind:"LinkedField",name:"filterClientCompanyCostCenters",plural:!1,selections:[c,{alias:null,args:null,concreteType:"ClientCompanyCostCentersEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ClientCompanyCostCenter",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"rowId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"number",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},{alias:"invoices",args:null,concreteType:"InvoiceCostCentersConnection",kind:"LinkedField",name:"invoiceCostCentersByClientCompanyCostCenterRowId",plural:!1,selections:u,storageKey:null},{alias:"invoiceItems",args:null,concreteType:"InvoiceAccountingItemCostCentersConnection",kind:"LinkedField",name:"invoiceAccountingItemCostCentersByClientCompanyCostCenterRowId",plural:!1,selections:u,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:o,filters:["clientCompanyRowId","searchText"],handle:"connection",key:"SettingsClientCompanyCostCentersPage_filterClientCompanyCostCenters",kind:"LinkedHandle",name:"filterClientCompanyCostCenters"}]},params:{id:"e41696984c073707787c1d1c22a1e911",metadata:{},name:"SettingsClientCompanyCostCentersPagePaginationQuery",operationKind:"query",text:null}}})(),se=(function(){var l=["filterClientCompanyCostCenters"],n={kind:"Variable",name:"clientCompanyRowId",variableName:"clientCompanyRowId"},i={alias:null,args:null,kind:"ScalarField",name:"totalCount",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"clientCompanyRowId"},{defaultValue:null,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"searchText"}],kind:"Fragment",metadata:{connection:[{count:"count",cursor:"cursor",direction:"forward",path:l}],refetch:{connection:{forward:{count:"count",cursor:"cursor"},backward:null,path:l},fragmentPathInResult:[],operation:te}},name:"SettingsClientCompanyCostCentersPage_query",selections:[{alias:null,args:[{fields:[n],kind:"ObjectValue",name:"condition"}],concreteType:"ClientCompanyCostCentersConnection",kind:"LinkedField",name:"allClientCompanyCostCenters",plural:!1,selections:[i],storageKey:null}
1,{alias:"filterClientCompanyCostCenters",args:[n,{kind:"Variable",name:"searchText",variableName:"searchText"}],concreteType:"ClientCompanyCostCentersConnection",kind:"LinkedField",name:"__SettingsClientCompanyCostCentersPage_filterClientCompanyCostCenters_connection",plural:!1,selections:[i,{alias:null,args:null,concreteType:"ClientCompanyCostCentersEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ClientCompanyCostCenter",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"rowId",storageKey:null},{args:null,kind:"FragmentSpread",name:"SettingsClientCompanyCostCentersPageItem_item"},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null}})(),re=(function(){var l=[{alias:null,args:null,kind:"ScalarField",name:"totalCount",storageKey:null}];return{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SettingsClientCompanyCostCentersPageItem_item",selections:[{alias:null,args:null,kind:"ScalarField",name:"number",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},{alias:"invoices",args:null,concreteType:"InvoiceCostCentersConnection",kind:"LinkedField",name:"invoiceCostCentersByClientCompanyCostCenterRowId",plural:!1,selections:l,storageKey:null},{alias:"invoiceItems",args:null,concreteType:"InvoiceAccountingItemCostCentersConnection",kind:"LinkedField",name:"invoiceAccountingItemCostCentersByClientCompanyCostCenterRowId",plural:!1,selections:l,storageKey:null}],type:"ClientCompanyCostCenter",abstractKey:null}})(),{RowHeader:ie,RowItem:oe}=le({columns:[{width:196,HeaderCell:e.jsxs(e.Fragment,{children:[e.jsx(r,{id:"NUMBER"}),"/",e.jsx(r,{id:"NAME"})]}),ItemCell:function({item:n}){return e.jsx(e.Fragment,{children:n.number})}},{width:128,flexGrow:1,HeaderCell:e.jsx(r,{id:"DESCRIPTION"}),ItemCell:function({item:n}){return e.jsx(e.Fragment,{children:n.description})}},{width:128,HeaderCell:e.jsx(r,{id:"CURRENCY"}),ItemCell:function({item:n}){return e.jsx(e.Fragment,{children:n.currency})}},{width:256,textAlign:"right",HeaderCell:e.jsx(r,{id:"NUMBER_OF_INVOICES"}),ItemCell:function({item:n}){return e.jsx(e.Fragment,{children:n.invoices.totalCount})}},{width:256,textAlign:"right",HeaderCell:e.jsx(r,{id:"NUMBER_OF_ACCOUNTING_ITEMS"}),ItemCell:function({item:n}){return e.jsx(e.Fragment,{children:n.invoiceItems.totalCount})}}]}),ce=l=>{const{item:n,...i}=l,c=I.useFragment(re,n);return e.jsx(oe,{item:c,...i})};var ue="eol6qw0";const de={current:!1},he=()=>{const{data:{settingsClientCompanyCostCentersPageQuery:l},params:{clientCompanyRowId:n}}=M(),{searchText:i,count:c}=L(H()),u=B(),o=_(),[d]=D(),j=I.usePreloadedQuery(V,l),{data:{allClientCompanyCostCenters:S,filterClientCompanyCostCenters:{edges:m,totalCount:F}},hasNext:v,isLoadingNext:y,loadNext:T,isRefetching:w,refetch:p}=U(se,j),R=S?.totalCount??0;C.useEffect(()=>{p({clientCompanyRowId:n,searchText:i})},[n,i]);const{register:b,handleSubmit:K,watch:P}=A({defaultValues:{searchText:i||null}}),f=K(({searchText:a})=>{u({search:s=>({...s,searchText:a||void 0})})});C.useEffect(()=>{const a=ne(f),{unsubscribe:s}=P(()=>a());return s},[]);const E=C.useCallback(()=>{let a=window.document.createElement("INPUT");a.type="file",a.accept="text/csv",a.addEventListener("change",()=>{const s=a.files?.[0];s?o(async()=>{try{await X({clientCompanyRowId:n,file:s}),p({},{fetchPolicy:"network-only"})}catch(g){d(g)}}):d(new Error("Selected file not found")),a.remove(),a=void 0}),a.click()},[n,m,o,d]),N=C.useCallback(()=>{let a=window.document.createElement("A");a.download="cost-centers.xlsx",o(async()=>{try{const s=await ee({clientCompanyRowId:n,costCenterRowIds:m.map(({node:{rowId:g}})=>g)});a.href=Z(s),a.click()}catch(s){d(s)}finally{a.remove(),a=void 0}})},[n,m,o,d]);return e.jsxs(e.Fragment,{children:[e.jsx(r,{id:"COST_CENTERS",children:([a])=>e.jsx(Q,{title:a})}),e.jsxs(t,{container:!0,direction:"column",fill:!0,sizing:"regular",children:[e.jsx(t,{item:!0,children:e.jsxs(t,{container:!0,align:"center",sizing:"regular",children:[e.jsx(t,{item:!0,flex:1,children:e.jsx(q,{children:e.jsx(r,{id:"COST_CENTERS_COUNT",values:{count:F}})})}),e.jsx(t,{item:!0,children:e.jsx(z,{content:e.jsx(r,{id:"IMPORT_COST_CENTERS_DESCRIPTION"}),children:e.jsxs(k,{variant:"primary",onClick:E,children:[e.jsx(Y,{}),e.jsx(r,{id:"IMPORT",tagName:"span"})]})})}),R>0&&e.jsx(t,{item:!0,children:e.jsxs(k,{variant:"primary",onClick:N,children:[e.jsx($,{}),e.jsx(r,{id:"EXPORT",tagName:"span"})]})}),e.jsx(t,{item:!0,children:e.jsx(O,{component:x({to:"create"})})})]})}),e.jsx(t,{item:!0,children:e.jsx("form",{onSubmit:f,children:e.jsx(t,{container:!0,align:"center",sizing:"tiny",children:e.jsx(t,{item:!0,flex:1,children:e.jsx(r,{id:"TYPE_HERE_TO_SEARCH",children:([a])=>e.jsx(G,{...b("searchText"),type:"search",placeholder:a,startAdornment:e.jsx(J,{})})})})})})}),e.jsx(t,{item:!0,overflowing:!0,children:e.jsxs(t,{container:!0,direction:"column",fill:!0,children:[e.jsx(t,{item:!0,children:e.jsx(ie,{className:ue,naked:!0})}),e.jsx(t,{item:!0,children:w&&e.jsx(h,{})}),e.jsx(ae,{id:"SettingsClientCompanyCostCentersPage",forceRestoreRef:de,children:a=>e.jsxs(t,{ref:a,item:!0,overflowing:!0,style:{overflowY:"scroll"},children:[m.map(({node:s})=>
1e.jsx(ce,{item:s,component:x({to:s.rowId,omit:["item"]})},s.id)),v&&!y&&e.jsx(W,{onReached:()=>T(parseInt(c))}),y&&e.jsx(h,{})]})})]})})]})]})};export{he as SettingsClientCompanyCostCentersPage,de as forceSettingsClientCompanyCostCentersPageScrollRestore};
2//# sourceMappingURL=index-Ca9ueq6E.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.