1import{jsxRuntimeExports as e,reactExports as t}from"./react-core-chunk-B2r03cU8.js";import{fetchJSON as T,putJSON as P}from"./app-bundle-B0YfsjKz.js";import{Box as i,Link_default as $,Text_default as y,flashNotice as C,LoadingIndicator as E,Button_default as _,Mobile as B,SelectInput as M,cxHelpers as O}from"./app-init-chunk-kk_CZVyp.js";import{LeftNavLayout as R,NAV_ITEM_PROPS as V}from"./constants-chunk-ChS9omFj.js";import{toI18n as g}from"./tracking-chunk-Cdw_Cfie.js";import{PropTypes as j}from"./redux-core-chunk-DgWMjMkF.js";import{PAPERLESS as b,TaxFormDeliverySection as A}from"./TaxFormDeliverySection-chunk-Bc4Xwl77.js";try{(function(){var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new s.Error().stack;n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="10d7a0fa-b9f1-4140-8b3d-16e41a103d8e",s._sentryDebugIdIdentifier="sentry-dbid-10d7a0fa-b9f1-4140-8b3d-16e41a103d8e")})()}catch{}const w=({documents:s})=>s.map(({id:n,category:c,label:o},r)=>e.jsx(i,{mt8:!0,children:e.jsx($,{target:"_blank",href:`/payroll/user_settings/download_tax_document/?document_id=${n}&category=${c}&filename=${o}`,children:o})},`document-${r}`));w.propTypes={documents:j.array};const k=({companyDocuments:s,cxEl:n})=>s.map(([c,o],r)=>e.jsxs(i,{mt32:!0,className:n("company-documents"),children:[e.jsx(y,{children:c}),e.jsx(w,{documents:o})]},`company-documents-${r}`));k.propTypes={companyDocuments:j.array,cxEl:j.func.isRequired};const I=()=>e.jsx(i,{bg:"grayLight",mt32:!0,pa16:!0,children:e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"bodySmBold",children:g("settings.pages.tax_documents.note.title")}),e.jsx("br",{}),e.jsx(y,{variant:"bodySm",children:g("settings.pages.tax_documents.note.message")})]})});I.propTypes={selectedYear:j.string};const J=({mobile:s})=>{const[n,c]=t.useState(!0),[o,r]=t.useState(!0),[l,u]=t.useState(!1),[a,d]=t.useState(!1),[f,x]=t.useState(!1);t.useEffect(()=>{c(!0),T("/payroll/user_settings.json").then(m=>{const p=m?.user_settings?.electronic_tax_distribution;r(p),d(p),c(!1)}).catch(m=>{m.response.json().then(p=>C.error(p.error)),c(!1)})},[r,c]);const L=t.useCallback((m,p)=>{x(!(m===b&&!p)),r(m===b)},[x,r]),h=t.useCallback(()=>{x(!1),r(a),u(!l)},[x,r,a,u,l]),F=t.useCallback(()=>{h()},[h]),N=t.useCallback(()=>{P("/payroll/user_settings.json",{user_settings:{electronic_tax_distribution:o}}).then(m=>{d(m.user_settings.electronic_tax_distribution),x(!1),u(!l)})},[o,d,u,l]),Y=t.useCallback(()=>{h()},[h]);return e.jsxs(i,{mb32:!0,children:[n&&e.jsx(E,{ml:64,mt:32,mb:32}),!n&&e.jsx(A,{electronicTaxDistribution:o,isTaxFormDeliveryEditing:l,onClickEdit:F,mobile:s,onChange:L}),!n&&l&&e.jsxs(i,{mt16:!0,spacebetween:!0,pr:!s&&100,children:[e.jsx(_,{onClick:Y,variant:"secondary",children:g("settings.pages.tax_documents.buttons.cancel")}),e.jsx(_,{onClick:N,variant:"primary",disabled:!f,children:g("settings.pages.tax_documents.buttons.save_changes")})]})]})},{cx:D,cxEl:v}=O("TaxDocumentsView"),S=new Date().getFullYear()-1,W=()=>{const s=t.useMemo(()=>{const d=[];for(let f=2020;f<=S;f++)d.push(f.toString());return d},[]),[n,c]=t.useState(S.toString()),[o,r]=t.useState(null),[l,u]=t.useState(!0);return t.useEffect(()=>{r(null),u(!0),T(`/payroll/user_settings/tax_documents?year=${n}`).then(a=>{r(a?.tax_documents),u(!1)}).catch(a=>{a.response.json().then(d=>C.error(d.error)),u(!1)})},[n]),e.jsx(B,{children:a=>e.jsx("div",{className:D(null,"bootstrap"),children:e.jsx(R,{className:v("new-settings","settings-refresh"),navItemsPro
1ps:V,title:g("documents.navigation.tax_documents"),children:e.jsxs(i,{className:D(),h:"100%",children:[e.jsx(i,{w:a?"auto":700,children:e.jsx(J,{mobile:a})}),e.jsxs(i,{w:a?"auto":582,children:[e.jsx(i,{row:!0,mb32:!0,children:e.jsx(y,{variant:a?"heading2":"heading4",color:"primary",children:g("settings.pages.tax_documents.title")})}),e.jsx(i,{w:a?"auto":335,children:e.jsx(M,{theme:"bordered",size:"medium",hideClear:!0,options:s,value:n,onChange:c})}),e.jsxs(i,{children:[l&&e.jsx(E,{m:64}),!l&&o&&e.jsx(k,{companyDocuments:o,cxEl:v})]}),e.jsx(I,{selectedYear:n})]})]})})})})};export{W as default}; 2//# sourceMappingURL=index-chunk-I55h71Qd.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.