1"use strict";(self.webpackChunklappa_app=self.webpackChunklappa_app||[]).push([[8196],{11180:(e,t,o)=>{o.d(t,{O:()=>r,P:()=>n});const r=Object.freeze({SALES_LIST:"sales_list",SALES_TAX:"sales_tax",PST_RETURN:"pst_return",DAC7:"dac7",EPR_PACKAGING:"epr_packaging",EPR_NON_PACKAGING:"epr_non_packaging"});function n(e){let{reportId:t,creditType:o,useCredits:r,quickPay:n}=e;const a={report_id:Number(t),credit_type:o,use_credits:Boolean(r)};return n&&(a.quick_pay=!0),a}},13963:(e,t,o)=>{o.d(t,{A:()=>d});var r=o(37898),n=o(1614),a=o(65043),i=o(83003),l=o(74553),s=o(70579);const d=e=>{let{title:t,placeholder:o,onChange:d,changeCountry:c="",dataCountriesList:u,error:p,disabled:m,requiredIndicator:h=!1,showFlags:v=!0,prefix:b,filterMode:y="startsWith"}=e;const{countries:g,countriesAll:_}=(0,i.d4)((e=>e.other)),[x,f]=(0,a.useState)(""),[w,j]=(0,a.useState)([]),D=(0,a.useRef)(null),C=(0,a.useRef)(null),[A,k]=(0,a.useState)({});(0,a.useEffect)((()=>{if(""===c||null==c)return void f("");if("object"===typeof c){const e=c.name||c.label||c.value||c.code||"";return void(e&&f(String(e)))}const e=null===u||void 0===u?void 0:u.filter((e=>
1void 0!==e.key||void 0!==e.label&&void 0!==e.value)),t=(null===e||void 0===e?void 0:e.length)>0?e:(null===_||void 0===_?void 0:_.length)>0?_:g,o=(0,l.WW)(c,null,t);f(o||String(c))}),[c,u,g,_]);const S=null===u||void 0===u?void 0:u.filter((e=>void 0!==e.key||void 0!==e.label&&void 0!==e.value));return(0,a.useLayoutEffect)((()=>{w.length>0&&D.current?requestAnimationFrame((()=>{if(!D.current)return;const e=D.current.querySelector('input[type="search"], input[type="text"]');if(!e)return;const t=e.getBoundingClientRect(),o=250,r=window.innerHeight-t.bottom,n=t.top,a=D.current.getBoundingClientRect(),i=t.top-a.top,l=t.height,s=Math.min(40*w.length,o);let d,c=i+l,u=o;const p=r<o&&n>r;p?(d=i+l,c=void 0,u=Math.min(o,n-10),u=Math.min(u,s+10)):u=Math.min(o,r-10),u<100&&(u=Math.min(o,Math.max(r,n)-10));const m={position:"absolute",left:"0",right:"0",width:"100%",maxHeight:`${u}px`,overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch",zIndex:9999,backgroundColor:"white",border:"1px solid #dfe3e8",borderRadius:"6px",boxShadow:"0px 4px 14px rgba(0,0,0,0.12)",marginTop:p?"0":"4px",marginBottom:p?"4px":"0",opacity:0,transform:p?"translateY(4px)":"translateY(-4px)",transition:"opacity 0.15s ease-out, transform 0.15s ease-out"};void 0!==c&&(m.top=`${c}px`),void 0!==d&&(m.bottom=`${d}px`),k(m),requestAnimationFrame((()=>{k((e=>({...e,opacity:1,transform:"translateY(0)"})))}))})):k({})}),[w]),(0,a.useEffect)((()=>{if(w.length>0){const e=()=>{if(D.current&&C.current){const e=D.current.querySelector('input[type="search"], input[type="text"]');if(!e)return;const t=e.getBoundingClientRect(),o=250,r=window.innerHeight-t.bottom,n=t.top,a=D.current.getBoundingClientRect(),i=t.top-a.top;let l=i+t.height,s=o;r<o&&n>r?(l=i-o,s=Math.min(o,n-10)):s=Math.min(o,r-10),s<100&&(s=Math.min(o,Math.max(r,n)-10)),k((e=>({...e,top:`${l}px`,maxHeight:`${s}px`,overflowY:"auto",overflowX:"hidden"})))}};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}}),[w]),(0,s.jsxs)("div",{ref:D,className:"searching-country-root",style:{position:"relative"},children:[(0,s.jsx)(r.A,{id:"country_id",type:"search",inputMode:"text",placeholder:o,label:t,value:x,autoComplete:"off",onChange:e=>{if(f(e),!e)return j([]),void d("");const t=e.toLowerCase(),o=(null===S||void 0===S?void 0:S.length)>0,r=(o?S:(null===_||void 0===_?void 0:_.length)>0?_:g).filter((e=>{var r;if(o){var n,a;const o=String(null!==(n=e.label)&&void 0!==n?n:"").toLowerCase(),r=String(null!==(a=e.value)&&void 0!==a?a:"").toLowerCase();return"includes"===y?`${o} ${r}`.includes(t):o.startsWith(t)}const i=String(null!==(r=e.name)&&void 0!==r?r:"").toLowerCase();return"includes"===y?i.includes(t):i.startsWith(t)}));j(r)},error:p,disabled:m,requiredIndicator:h,prefix:b}),w.length>0&&(0,s.jsx)("div",{ref:C,className:"custom-listbox",style:{...A,position:A.position||"absolute",maxHeight:A.maxHeight||"250px",overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch",zIndex:A.zIndex||9999,backgroundColor:A.backgroundColor||"white",border:A.border||"1px solid #dfe3e8",borderRadius:A.borderRadius||"6px",boxShadow:A.boxShadow||"0px 4px 14px rgba(0,0,0,0.12)"},children:(0,s.jsx)(n.W,{onSelect:e=>{const t=((null===S||void 0===S?void 0:S.length)>0?S:(null===_||void 0===_?void 0:_.length)>0?_:g).find((t=>((null===S||void 0===S?void 0:S.length)>0?t.value:t.code)===e));if(t){const e=(null===S||void 0===S?void 0:S.length)>0?t.label:t.name;f(e),d((null===S||void 0===S?void 0:S.length)>0?t.value:{id:"country_id",newValue:t.value||t.code}),j([])}},children:w.map((e=>(0,s.jsx)(n.W.Option,{value:(null===S||void 0===S?void 0:S.length)>0?e.value:e.code,children:(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0",cursor:"pointer"},children:(0,s.jsx)("span",{style:{fontSize:14,fontWeight:500,marginLeft:4},children:(null===S||void 0===S?void 0:S.length)>0?e.label:e.name})})},(null===S||void 0===S?void 0:S.length)>0?e.value:e.code)))})})]})}},38230:(e,t,o)=>{o.d(t,{A:()=>s});var r=o(65043),n=o(97950),a=o(35047),i=o(13397),l=(o(87909),o(56011),o(70579));const s=e=>{let{actions:t=[],rowId:o,openRowId:s,setOpenRowId:d,containerSelector:c,className:u="",menuClassName:p="",iconFill:m="rgba(112, 112, 112, 1)",showTriggerWhenEmpty:h=!1}=e;const v=(0,r.useRef)(null),b=(0,r.useRef)(null),[y,g]=(0,r.useState)({top:0,right:0}),[_,x]=(0,r.useState)(!1),[f,w]=(0,r.useState)(!1),[j,D]=(0,r.useState)("bottom"),C=(null!=s&&null!=o&&(String(s),String(o)),t.filter((e=>!1!==e.visible)));(0,r.useEffect)((()=>{null!=s&&String(s)!==String(o)&&f&&(w(!1),x(!1))}),[s,o,f]);const A=()=>{x(!1),w(!1),d&&d(null)},k=()=>"function"===typeof c?c():"string"===typeof c&&document.querySelector(c)||document.body;(0,r.useEffect)((()=>{let e;if(f&&v.current){if(!k())return;const t=(v.current.querySelector(".Polaris-Icon")||v.current).getBoundingClientRect(),o=window.innerWidth,r=36,n=260,a=Math.min(C.length*r,n),i=window.innerHeight-t.bottom-8,l=t.top-8;let s="bottom";i<a&&l>i&&(s="top"),D(s);let d,c=o-(t.right-t.width/2);o-c<188&&(c=o-180-8),"bottom"===s?d=t.bottom+6:(d=t.top-a-6,d<8&&(d=8)),g({to
1p:d,right:Math.max(8,c)}),e=setTimeout((()=>{x(!0)}),10)}else x(!1);return()=>{e&&clearTimeout(e)}}),[f,c,C.length]),(0,r.useEffect)((()=>{if(!_)return;const e=e=>{!b.current||b.current.contains(e.target)||v.current.contains(e.target)||A()},t=()=>{A()},o=()=>{A()};return document.addEventListener("mousedown",e),window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}),[_]);return C&&0!==C.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:v,className:`dots-button dropdown-actions-dots ${u}`,onClick:e=>{e.stopPropagation();const t=!f;w(t),d&&d(t?o:null)},style:{display:"inline-block"},children:(0,l.jsx)(i.$,{variant:"tertiary",icon:(0,l.jsx)(a.Mg,{fill:m}),accessibilityLabel:"More actions"})}),_&&f&&(()=>{const e=k();return e?(0,n.createPortal)((0,l.jsx)("div",{ref:b,style:{position:"fixed",top:y.top,right:y.right,background:"white",border:"1px solid #e1e3e5",borderRadius:"8px",boxShadow:"0 6px 16px rgba(0,0,0,0.12)",zIndex:1e5,minWidth:180,maxWidth:"calc(100vw - 16px)",maxHeight:260,overflowY:"auto",overflowX:"hidden"},className:`row-actions-portal-dropdown row-actions-portal-dropdown--${j}${p?` ${p}`:""}`,children:C.map(((e,t)=>{const o="BankActions__item "+("delete"===e.variant?"BankActions__delete":"");return(0,l.jsx)("button",{onClick:(r=e.onClick,e=>{null===e||void 0===e||e.stopPropagation(),null===r||void 0===r||r(e),A()}),disabled:e.disabled,className:o,style:{opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},children:e.label},t);var r}))}),e):null})()]}):h?(0,l.jsx)("div",{className:`dots-button dropdown-actions-dots ${u}`,style:{display:"inline-block"},children:(0,l.jsx)(i.$,{variant:"tertiary",icon:(0,l.jsx)(a.Mg,{fill:m}),accessibilityLabel:"More actions",disabled:!0})}):null}},46793:(e,t,o)=>{o.r(t),o.d(t,{default:()=>fe});var r=o(65043),n=o(76930),a=o(45847),i=o(44154),l=o(13397),s=o(91232),d=o(26699),c=o(25686),u=o(79416),p=o(73703),m=o(83003),h=o(52399),v=o(11568),b=o(93888),y=o(26229),g=o(93529),_=o(94291),x=o(37898),f=o(53536),w=o.n(f),j=o(71087),D=o(33587),C=o(34888),A=o(59955),k=o(33852),S=o(13963),R=o(62902),F=o(70579);const I=e=>{let{onDownload:t,onDelete:o,rowId:r,openRowId:n,setOpenRowId:a,hasFile:i,showDelete:l,t:s}=e;const d=[];return i&&d.push({label:s("reports.save")||"Download",onClick:t,visible:!0}),l&&d.push({label:s("reports.delete")||"Delete",onClick:o,variant:"delete",visible:!0}),(0,F.jsx)(R.A,{actions:d,rowId:r,openRowId:n,setOpenRowId:a,className:"tax-audit-row-actions-dots"})};var M=o(83622),E=o(15462),T=o(86178),$=o.n(T);const P={from:$()().startOf("month").toDate(),to:$()().toDate()},q=e=>{let{onActionDialogsOpen:t,onDownloadFile:o}=e;const{t:a}=(0,n.Bd)(),i=(0,h.Ay)(),{listReports:s,taxAuditMessages:u,reportTypes:p,currentPlan:f,user:R,countries:T,creatingAuditRep:$}=(0,m.d4)((e=>({listReports:e.transactions.listReports,taxAuditMessages:e.messenger.taxAuditMessages,reportTypes:e.transactions.reportTypes,currentPlan:e.subscription.currentPlan,user:e.user.user,countries:e.other.countries,creatingAuditRep:e.transactions.creatingAuditRep}))),[q,O]=(0,r.useState)({month:(new Date).getMonth(),year:(new Date).getFullYear(),selected:{start:P.from,end:P.to},visibilityDatePickerFrom:!1,visibilityDatePickerTo:!1,consumer_country:"all",from_date:(0,j.y5)(P.from),to_date:(0,j.y5)(P.to),vat_number:""}),[Y,N]=(0,r.useState)(!1),[B,L]=(0,r.useState)(null),W=(0,r.useCallback)((()=>{const e=[];return null===T||void 0===T||T.map((t=>{e.push({label:t.name_no_article,value:t.code})})),e}),[T]),z=(0,r.useCallback)((e=>{let t="",o="",r="";switch(e.status){case"ready":t="Success",o="success",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} was successfully generated`;break;case"done_no_data":t="Warning",o="warning",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} does not contain data`;break;case"not_paid_period":t="Error",o="critical",r=`The period from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} is not included in the subscription`;break;default:t="Error",o="critical",r="Something went wrong..."}return{title:t,status:o,text:r}}),[]),H=(0,r.useCallback)(((e,t)=>{O((t=>{const o={...t};return e.start&&(o.from_date=(0,j.y5)(e.start)),e.end&&(o.to_date=(0,j.y5)(e.end),o.year=new Date(e.end).getFullYear()),o}))}),[]),U=(0,r.useCallback)((()=>{const e={report_type:q.type,from_date:(0,j.y5)(q.from_date),to_date:(0,j.y5)(q.to_date)};q.vat_number&&(e.vat_number=q.vat_number),"all"!==q.consumer_country&&(e.country_code=q.consumer_country),"_GET_MTR_"===q.type&&q.merch&&(e.supplier_id=q.merch),i((0,M.kU)(e)).then((e=>{e?(i((0,M.uq)()),i((0,E.Me)()),i((0,E.hT)()),N(!1)):N(a("reports.noTrans"))})).catch((e=>{e&&"object"===typeof e&&"id"in e?(i((0,M.uq)()),i((0,E.Me)()),i((0,E.hT)()),N(!1)):N((0,D.NX)(e))}))}),[q,i,a]),G=(0,r.useCallback)((e=>{O((t=>({...t,type:e,merch:"_GET_MTR_"===e?t.merch:""})))}),[]),K=(0,r.useCallback)((e=>{O((t=>({...t,vat_number:e})))}),[]),V=(0,r.useCallback)((e=>{O((t=>({...t,consumer_country:e})))}),[]),Z=(0,r.useCallback)((e=>{O((t=>({...t,merch:e})))}),[]),J=(0,r.useCallback)((e=>{i((0,E.wt)({modelsName:"tax_audit",id:e})).then((()=>i((0,E.hT)()))).then((()=>i((0,E.Me)()))).catch(w().noop)}),[i]),X=[{property:"country",header:{label:"Country",transforms:[]},cell:{formatters:[e=>e||a("reports.allCountries")]}},{property:"date_from",header:{label:"Date range",transforms:[]},cell:{formatters:[(e,t)=>{let{rowData:o}=t;return`${(0,j.Yq)(o.period_from)} - ${(0,j.Yq)(o.period_till)}`}]}},{property:"ordered",header:{label:"Date request",transforms:[]},cell:{formatters:[e=>`${(0,j.Yq)(e)} ${(0,j.fU)(e)}`]}},{property:"status",header:{label:"Status",transforms:[]},cell:{formatters:[e=>(0,F.jsx)(v.E,{tone:"ready"===e?"success":"attention",children:e})]}},{property:"report_type",header:{label:"Type",transforms:[]}},{property:"id",header:{label:"",transforms:[]},cell:{formatters:[(e,r)=>{let{rowData:n,index:i}=r;return(0,F.jsx)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center"},children:(0,F.jsx)(I,{rowId:`tax-audit-actions-${n.id||i}`,openRowId:B,setOpenRowId:L,hasFile:"ready"===n.status&&!!n.file,showDelete:!0,onDownload:()=>o(n.file),onDelete:()=>t("deleteReport",n),t:a})})}]}}],Q=(0,A.A)(s||[],X),ee=!f&&!R.is_manager&&!R.is_omp||f&&!f.is_active&&!f.is_active_sales_tax&&!R.is_manager&&!R.is_omp;return(0,F.jsxs)(c.P.AnnotatedSection,{title:(0,F.jsx)(d.E,{variant:"headingLg",as:"p",children:a("reports.titles.taxAudit")}),children:[(!w().isEmpty(s)||!w().isEmpty(u))&&(0,F.jsxs)(b.Z,{children:[!w().isEmpty(u)&&(0,F.jsx)("div",{style:{padding:"1rem"},children:u.map((e=>{const t=z(e),o=`${t.title}: ${t.text}`;return(0,F.jsx)("div",{children:(0,F.jsx)(k.A,{status:t.status,message:o,onDismiss:()=>J(e.id)})},e.id)}))}),!w().isEmpty(s)&&(0,F.jsx)(y.b,{columnContentTypes:["text","text","text","text","text"],headings:X.map((e=>{let{header:t}=e;return(0,F.jsx)(d.E,{fontWeight:"semibold",children:t.label},t.label)})),rows:Q})]}),(0,F.jsxs)(b.Z,{sectioned:!0,children:[!w().isEmpty(s)&&(0,F.jsx)("br",{}),(0,F.jsxs)(g.H,{children:[(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(_.l,{label:"Report Type:",options:[{label:"",value:""},...(p||[]).map((e=>({label:e.name,value:e.type})))],onChange:G,value:q.type||""}),(0,F.jsx)("br",{})]}),(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(x.A,{type:"text",disabled:"all"===q.consumer_country,label:`${a("reports.vatNumber")}:`,value:q.vat_number||"",onChange:K}),(0,F.jsx)(S.A,{title:`${a("reports.country")}
1:`,placeholder:"All",onChange:V,dataCountriesList:[{label:"All",value:"all"},...W()],changeCountry:q.consumer_country}),"_GET_MTR_"===q.type?(0,F.jsx)(x.A,{type:"text",disabled:!q.type,label:"Merchant id:",value:q.merch||"",onChange:Z}):null]}),(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(C.A,{label:a("reports.from"),onChange:e=>H({start:e},"data"),value:q.from_date,allowRange:!1}),(0,F.jsx)(C.A,{label:a("reports.till"),onChange:e=>H({end:e},"data"),value:q.to_date,allowRange:!1})]})]}),(0,F.jsx)("br",{}),(0,F.jsx)("div",{children:(0,F.jsx)(l.$,{variant:"primary",disabled:!q.type,size:"micro",loading:$,onClick:()=>ee?t("subs"):U(),children:a("reports.buttons.taxAudit")})}),Y&&(0,F.jsxs)("div",{children:[(0,F.jsx)("br",{}),(0,F.jsx)(k.A,{status:"critical",message:Y,onDismiss:()=>N(!1)}),(0,F.jsx)("br",{})]})]})]})};var O=o(54332),Y=o(92134);const N={from:$()().startOf("month").toDate(),to:$()().toDate()},B=e=>{let{onActionDialogsOpen:t}=e;const{t:o}=(0,n.Bd)(),a=(0,h.Ay)(),{currentPlan:i,user:s,countries:u,ordering:p}=(0,m.d4)((e=>({currentPlan:e.subscription.currentPlan,user:e.user.user,countries:e.other.countries,ordering:e.declarations.ordering}))),[v,y]=(0,r.useState)({month:(new Date).getMonth(),year:(new Date).getFullYear(),selected:{start:N.from,end:N.to},visibilityDatePickerFrom:!1,visibilityDatePickerTo:!1,consumer_country:"GBR",from_date:(0,j.y5)(N.from),to_date:(0,j.y5)(N.to)}),x=(0,r.useCallback)((()=>{const e=[];return null===u||void 0===u||u.map((t=>{e.push({label:t.name_no_article,value:t.code})})),e}),[u]),f=(0,r.useCallback)(((e,t)=>{y((t=>{const o={...t};return e.start&&(o.from_date=(0,j.y5)(e.start)),e.end&&(o.to_date=(0,j.y5)(e.end),o.year=new Date(e.end).getFullYear()),o}))}),[]),w=(0,r.useCallback)((e=>{y((t=>({...t,consumer_country:e})))}),[]),D=(0,r.useCallback)((()=>{const e={from_date:(0,j.y5)(v.from_date),to_date:(0,j.y5)(v.to_date),country_id:v.consumer_country,headers:(0,O.$)()};a((0,Y.mz)(e)).then((e=>{e&&t("liabilitiesReport",{liabilities:e,liabData:v,hmrcIntegration:e.hasOwnProperty("hmrc_integration")&&!e.hmrc_integration})})).catch((()=>{}))}),[v,a,t]),A=!i&&!s.is_manager&&!s.is_omp||i&&!i.sum&&!i.sum_sales_tax&&!s.is_manager&&!s.is_omp;return(0,F.jsx)(c.P.AnnotatedSection,{title:(0,F.jsx)(d.E,{variant:"headingLg",as:"p",children:o("reports.titles.vatLiab")}),children:(0,F.jsxs)(b.Z,{sectioned:!0,children:[(0,F.jsxs)(g.H,{children:[(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(_.l,{label:`${o("reports.country")}:`,disabled:!0,options:x(),onChange:w,value:v.consumer_country}),(0,F.jsx)("br",{})]}),(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(C.A,{allowRange:!1,label:o("reports.from"),onChange:e=>f({start:e},"liabData"),value:v.from_date}),(0,F.jsx)(C.A,{label:o("reports.till"),allowRange:!1,onChange:e=>f({end:e},"liabData"),value:v.to_date})]})]}),(0,F.jsx)("br",{}),(0,F.jsx)("div",{children:(0,F.jsx)(l.$,{variant:"primary",size:"micro",disabled:!v.consumer_country,loading:p,onClick:()=>A?t("subs"):D(),children:o("reports.buttons.vatStatus")})})]})})};var L=o(17848),W=o(64913);const z=e=>{let{liabilities:t,liabData:o,onBack:a}=e;const{t:i}=(0,n.Bd)(),{countries:l}=(0,m.d4)((e=>({countries:e.other.countries}))),p={page:1,perPage:25},h=(0,r.useMemo)((()=>{const e=null===l||void 0===l?void 0:l.find((e=>e.code===o.consumer_country));return(null===e||void 0===e?void 0:e.name)||""}),[l,o.consumer_country]),v=(null===t||void 0===t?void 0:t.items)||[],b=[{property:"vat_number",header:{label:i("reports.vatNumber"),transforms:[]}},{property:"type",header:{label:i("reports.vatType"),transforms:[]}},{property:"taxPeriod",header:{label:i("reports.taxPeriod"),transforms:[]},cell:{formatters:[(e,t)=>{let{rowData:o}=t;return(0,F.jsxs)("span",{children:[(0,j.Yq)(o.taxPeriod.from)," -"," ",(0,j.Yq)(o.taxPeriod.to)]})}]}},{property:"due",header:{label:i("reports.dueDate"),transforms:[]}},{property:"originalAmount",header:{label:i("reports.origAmount"),transforms:[]}},{property:"outstandingAmount",header:{label:i("reports.outAmount"),transforms:[]}}],g=(0,A.A)(v,b),_=(0,W.A)(p)(g),x=(e=>{let t="",o="",r="";switch(e.status){case"ready":t="Success",o="success",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} was successfully generated`;break;case"done_no_data":t="Warning",o="warning",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} does not contain data`;break;case"not_paid_period":t="Error",o="critical",r=`The period from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} is not included in the subscription`;break;default:t="Error",o="critical",r="Something went wrong..."}return{title:t,status:o,text:r}})({status:(null===t||void 0===t?void 0:t.status)||"done_no_data",country:h,from_date:o.from_date,to_date:o.to_date});return(0,F.jsxs)(s.Y,{fullWidth:!0,subtitle:(0,F.jsxs)(d.E,{variant:"bodyMd",color:"critical",as:"span",children:[h," ",i("reports.forThePeriod")," ",(0,j.Yq)(o.from_date)," ",i("reports.tillLC")," ",(0,j.Yq)(o.to_date)]}),title:(0,F.jsx)(L.A,{content:(0,F.jsx)(d.E,{variant:"heading3xl",as:"span",children:i("reports.vlReport")}),onBack:a}),children:[(0,F.jsx)(u.A,{title:"VAT Liabilities Report"}),(0,F.jsx)(c.P,{children:(0,F.jsxs)(c.P.Section,{children:[(0,F.jsx)("br",{}),(!t||"ready"!==t.status)&&(0,F.jsxs)("div",{children:[(0,F.jsx)(k.A,{status:x.status,message:`${x.title}, ${x.text}`,onDismiss:()=>{}}),(0,F.jsx)("br",{})]}),!w().isEmpty(_.rows)&&(0,F.jsx)(y.b,{columnContentTypes:["text","text","text","text","text","text"],headings:b.map((e=>{let{header:t}=e;return(0,F.jsx)(d.E,{fontWeight:"semibold",children:t.label},t.label)})),rows:_.rows,hideScrollIndicator:!0})]})})]})},H={from:$()().startOf("month").toDate(),to:$()().toDate()},U=e=>{let{onActionDialogsOpen:t}=e;const{t:o}=(0,n.Bd)(),a=(0,h.Ay)(),{currentPlan:i,user:s,countries:u,ordering:p}=(0,m.d4)((e=>({currentPlan:e.subscription.currentPlan,user:e.user.user,countries:e.other.countries,ordering:e.declarations.ordering}))),[v,y]=(0,r.useState)({month:(new Date).getMonth(),year:(new Date).getFullYear(),selected:{start:H.from,end:H.to},visibilityDatePickerFrom:!1,visibilityDatePickerTo:!1,consumer_country:"GBR",from_date:(0,j.y5)(H.from),to_date:(0,j.y5)(H.to)}),x=(0,r.useCallback)((()=>{const e=[];return null===u||void 0===u||u.map((t=>{e.push({label:t.name_no_article,value:t.code})})),e}),[u]),f=(0,r.useCallback)(((e,t)=>{y((t=>{const o={...t};return e.start&&(o.from_date=(0,j.y5)(e.start)),e.end&&(o.to_date=(0,j.y5)(e.end),o.year=new Date(e.end).getFullYear()),o}))}),[]),w=(0,r.useCallback)((e=>{y((t=>({...t,consumer_country:e})))}),[]),D=(0,r.useCallback)((()=>{const e={from_date:(0,j.y5)(v.from_date),to_date:(0,j.y5)(v.to_date),country_id:v.consumer_country,headers:(0,O.$)()};a((0,Y.SG)(e)).then((e=>{e&&t("obligationsReport",{obligations:e,obligData:v,hmrcIntegration:e.hasOwnProperty("hmrc_integration")&&!e.hmrc_integration})})).catch((()=>{}))}),[v,a,t]),A=!i&&!s.is_manager&&!s.is_omp||i&&!i.sum&&!i.sum_sales_tax&&!s.is_manager&&!s.is_omp;return(0,F.jsxs)(c.P.AnnotatedSection,{title:(0,F.jsx)(d.E,{variant:"headingLg",as:"p",children:o("reports.titles.vatObl")}),children:[(0,F.jsxs)(b.Z,{sectioned:!0,children:[(0,F.jsxs)(g.H,{children:[(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(_.l,{label:`${o("reports.country")}:`,disabled:!0,options:x(),onChange:w,value:v.consumer_country}),(0,F.jsx)("br",{})]}),(0,F.jsxs)(g.H.Group,{children:[(0,F.jsx)(C.A,{allowRange:!1,label:o("reports.from"),onChange:e=>f({start:e},"obligData"),value:v.from_date}),(0,F.jsx)(C.A,{label:o("reports.till"),allowRange:!1,onChange:e=>f({end:e},"obligData"),value:v.to_date})]})]}),(0,F.jsx)("br",{}),(0,F.jsx)("div",{children:(0,F.jsx)(l.$,{variant:"primary",size:"micro",disabled:!v.consumer_country,loading:p,onClick:()=>A?t("subs"):D(),children:o("reports.buttons.vatObl")})})]}),(0,F.jsx)("br",{}),(0,F.jsx)("br",{})]})},G=e=>{let{obligations:t,obligData:o,onBack:a}=e;const{t:i}=(0,n.Bd)(),{countries:l}=(0,m.d4)((e=>({countries:e.other.countries}))),p={page:1,perPage:25},h=(0,r.useMemo)((()=>{const e=null===l||void 0===l?void 0:l.find((e=>e.code===o.consumer_country));return(null===e||void 0===e?void 0:e.name)||""}),[l,o.consumer_country]),v=(null===t||void 0===t?void 0:t.items)||[],b=[{property:"vat_number",header:{label:i("reports.vatNumber"),transforms:[]}},{property:"status",header:{label:i("reports.status"),transforms:[]}},{property:"periodKey",header:{label:i("reports.periodKey"),transforms:[]}},{property:"period",header:{label:i("reports.period"),transforms:[]},cell:{formatters:[(e,t)=>{let{rowData:o}=t;
1return(0,F.jsxs)("span",{children:[o.period," ",o.period_type," ",o.year]})}]}},{property:"due",header:{label:i("reports.dueDate"),transforms:[]}}],g=(0,A.A)(v,b),_=(0,W.A)(p)(g),x=(e=>{let t="",o="",r="";switch(e.status){case"ready":t="Success",o="success",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} was successfully generated`;break;case"done_no_data":t="Warning",o="warning",r=`Tax audit report for ${e.country} from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} does not contain data`;break;case"not_paid_period":t="Error",o="critical",r=`The period from ${(0,j.Yq)(e.from_date)} to ${(0,j.Yq)(e.to_date)} is not included in the subscription`;break;default:t="Error",o="critical",r="Something went wrong..."}return{title:t,status:o,text:r}})({status:(null===t||void 0===t?void 0:t.status)||"done_no_data",country:h,from_date:o.from_date,to_date:o.to_date});return(0,F.jsxs)(s.Y,{fullWidth:!0,subtitle:(0,F.jsxs)(d.E,{variant:"bodyMd",color:"critical",as:"span",children:[h," ",i("reports.forThePeriod")," ",(0,j.Yq)(o.from_date)," ",i("reports.tillLC")," ",(0,j.Yq)(o.to_date)]}),title:(0,F.jsx)(L.A,{content:(0,F.jsx)(d.E,{variant:"heading3xl",as:"span",children:i("reports.futureVatObl")}),onBack:a}),children:[(0,F.jsx)(u.A,{title:"VAT Obligations Report"}),(0,F.jsx)(c.P,{children:(0,F.jsxs)(c.P.Section,{children:[(0,F.jsx)("br",{}),(!t||"ready"!==t.status)&&(0,F.jsxs)("div",{children:[(0,F.jsx)(k.A,{status:x.status,message:`${x.title}, ${x.text}`,onDismiss:()=>{}}),(0,F.jsx)("br",{})]}),!w().isEmpty(_.rows)&&(0,F.jsx)(y.b,{columnContentTypes:["text","text","text","text","text"],headings:b.map((e=>{let{header:t}=e;return(0,F.jsx)(d.E,{fontWeight:"semibold",children:t.label},t.label)})),rows:_.rows,hideScrollIndicator:!0})]})})]})};var K=o(44978),V=o(66629),Z=o(47386),J=o(95240),X=o(98303);const Q=(0,J.b)({yearsBefore:2,yearsAfter:0}),ee=[{value:"",label:""},{value:"DAC7_reporting",label:"DAC7 reporting"},{value:"DAC7_immovable",label:"DAC7 immovable property reporting"},...(0,X.yz)()?[{value:"1099K_reporting",label:"1099-\u041a reporting"}]:[]],te=[{value:"",label:""},{value:"year",label:"Year"},{value:"bi-annual-1",label:"bi-annual (Jan-Jun)"},{value:"bi-annual-2",label:"bi-annual (Jul-Dec)"}],oe=e=>{let{renderDac7ReportsTable:t,handleActionDialogsOpen:o}=e;const{countriesDac7:n}=(0,m.d4)((e=>e.other)),{creatingDac7Report:i=!1,creating1099Report:s=!1}=(0,m.d4)((e=>e.declarations)),u=(()=>{const e=localStorage.getItem("dac7_form_data")||localStorage.getItem("1099k_form_data");if(e)try{return JSON.parse(e)}catch(t){return console.error("Error parsing saved form data:",t),null}return null})(),[p,v]=(0,r.useState)((null===u||void 0===u?void 0:u.reportType)||""),[y,f]=(0,r.useState)((null===u||void 0===u?void 0:u.businessName)||""),[w,j]=(0,r.useState)((null===u||void 0===u?void 0:u.period)||""),[D,C]=(0,r.useState)((null===u||void 0===u?void 0:u.periodType)||""),[A,k]=(0,r.useState)((null===u||void 0===u?void 0:u.changeCountry)||""),R=(0,h.Ay)(),I=(0,a.Zp)(),M="1099K_reporting"===p,E="DAC7_reporting"===p,T="DAC7_immovable"===p,$=p&&""!==p;(0,r.useEffect)((()=>{if($&&!M){(async()=>await R((0,Z.yW)()))()}}),[$,M]);const P=(0,r.useCallback)((()=>{const e={reportType:p,businessName:y,period:w,periodType:D,changeCountry:A};localStorage.setItem("dac7_form_data",JSON.stringify(e)),localStorage.removeItem("1099k_form_data")}),[p,y,w,D,A]),q=(0,r.useCallback)((()=>{localStorage.removeItem("dac7_form_data"),localStorage.removeItem("1099k_form_data")}),[]),O=(0,r.useCallback)((async()=>{if(P(),M){const t={business_name:y,period:Number(w),country:"USA"};try{const e=await R((0,Y.Qn)(t));if(e.type&&e.type.includes("rejected")){const t=e.payload||e.error;return void o("subs",{e:t})}const r=e.payload;r&&r.to_buy?o("subs",{subscriptionData:r}):(q(),I("/return-1099"))}catch(e){o("subs",{e:e})}}else{const t={business_name:y,period:+w,year:+w,period_type:D,country:A,is_immovable:"DAC7_reporting"!==p};try{const e=await R((0,Y.K3)(t));if(e.type&&e.type.includes("rejected")){const t=e.payload||e.error;return void o("subs",{e:t})}const r=(0,V.O1)(e.payload);await R((0,Y.Z0)(null!=r?{...t,id:r}:t)),null!=r&&R((0,Y.ZO)(r)),q(),I("DAC7_reporting"===p?"/dac7-reporting":"/dac7-immovable-property")}catch(e){o("subs",{e:e})}}}),[y,w,D,A,p,M,R,I,o,P,q]),N=!$||(M?[y,w].some((e=>!Boolean(e))):[y,w,D,A].some((e=>!Boolean(e))));return(0,F.jsxs)(c.P.AnnotatedSection,{title:(0,F.jsx)(d.E,{variant:"headingLg",as:"p",children:"Marketplace reports"}),children:[t&&t(),(0,F.jsxs)(b.Z,{sectioned:!0,children:[(0,F.jsx)(g.H,{children:(0,F.jsxs)("div",{style:{display:"flex",gap:"16px"},children:[(0,F.jsxs)("div",{style:{width:"50%",display:"flex",flexDirection:"column",gap:"16px"},children:[(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(_.l,{label:"Type Marketplace reports",o
1ptions:ee,onChange:e=>{v(e),"1099K_reporting"===e?(C("year"),k("")):""===e&&(C(""),k(""))},value:p})}),$&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(x.A,{label:(0,K.t)("dac7.businessName"),value:y,onChange:e=>f(e),autoComplete:"off"})}),!M&&(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(S.A,{title:`${(0,K.t)("reports.country")}:`,placeholder:"All",onChange:e=>k(e),dataCountriesList:[{label:"All",value:"all"},...(()=>{const e=[{key:"",label:"",value:""}];return n.map((t=>{e.push({key:t.code,label:t.name,value:t.code})})),e})()],changeCountry:A})}),M&&(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(_.l,{label:"Country",options:[{value:"USA",label:"USA"}],disabled:!0,value:"USA"})})]})]}),$&&(0,F.jsxs)("div",{style:{width:"50%",display:"flex",flexDirection:"column",gap:"16px"},children:[(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(_.l,{label:(0,K.t)("dac7.reportingPeriod"),options:Q,onChange:e=>{j(e)},value:w})}),(0,F.jsx)(g.H.Group,{children:(0,F.jsx)(_.l,{label:"Period",options:M?[{value:"year",label:"Year"}]:te,onChange:e=>{M||C(e)},value:M?"year":D,disabled:M})})]})]})}),$&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("br",{}),(0,F.jsx)("div",{children:(0,F.jsx)(l.$,{variant:"primary",size:"micro",onClick:O,disabled:N,loading:M?s:i,children:M?"Fill 1099-\u041a reporting":E?(0,K.t)("dac7.fillDac7Report"):T?"Fill DAC7 immovable property reporting":"Fill report"})})]})]})]})};var re=o(21494),ne=o(18258);const ae=e=>{let{onDownload:t,onSubmit:o,onPreview:r,onEditStatus:n,onDelete:a,rowId:i,openRowId:l,setOpenRowId:s,hasFile:d,showSubmit:c,showPreview:u,showEditStatus:p,showDelete:m,t:h}=e;const v=[];return p&&v.push({label:h("vatReturns.statuses.changeStatus")||"Change status",onClick:n,visible:!0}),c&&v.push({label:h("vatReturns.submit")||"Submit",onClick:o,visible:!0}),u&&v.push({label:h("vatReturns.view")||"View",onClick:r,visible:!0}),d&&v.push({label:h("vatReturns.downloadFile")||"Download file",onClick:t,visible:!0}),m&&v.push({label:h("vatReturns.delete")||"Delete",onClick:a,variant:"delete",visible:!0}),(0,F.jsx)(R.A,{actions:v,rowId:i,openRowId:l,setOpenRowId:s,className:"dac7-row-actions-dots"})};var ie=o(73054),le=o(74553);const se=e=>{let{onActionDialogsOpen:t,onDownloadFile:o,user:a,loading:i=!1}=e;const{t:l}=(0,n.Bd)(),s=(0,h.Ay)(),[d,c]=(0,r.useState)(null),{dac7Reports:u,dac7ReportsImmovable:p,reports1099K:v,countriesAll:b,countriesDac7:y}=(0,m.d4)((e=>({dac7Reports:e.declarations.dac7Reports||[],dac7ReportsImmovable:e.declarations.dac7ReportsImmovable||[],reports1099K:e.declarations.reports1099K||[],countriesAll:e.other.countriesAll||[],countriesDac7:e.other.countriesDac7||[]}))),g=(0,r.useMemo)((()=>[...y,...b]),[y,b]),_=e=>"USA"===e.country||"USA"===e.country_code||e.country&&"string"===typeof e.country&&e.country.includes("USA")?"1099-\u041a reporting":!0===e.is_immovable?"DAC7 immovable property reporting":"DAC7 reporting",x=(0,r.useMemo)((()=>[{property:"report_type",header:{label:"Type"},cell:{formatters:[(e,t)=>{let{rowData:o}=t;const r=_(o);return o.report_type||r||"-"}]}},{property:"business_name",header:{label:l("dac7.businessName")}},{property:"period_year",header:{label:"Year"}},{property:"update_at",header:{label:"Filling date"},cell:{formatters:[(e,t)=>{let{rowData:o}=t;return(0,j.Yq)(null===o||void 0===o?void 0:o.updated_at)||"No date"}]}},{property:"country",header:{label:l("vatReturns.country")},cell:{formatters:[(e,t)=>{let{rowData:o}=t;if("1099-\u041a reporting"===_(o))return"USA";return(0,le.WW)(null===o||void 0===o?void 0:o.country,null===o||void 0===o?void 0:o.country_code,g)||"No country"}]}},{property:"status",header:{label:l("dac7.status")},cell:{formatters:[e=>{const t=String(e||"").toLowerCase().trim();switch(t){case"submitted":return(0,F.jsx)(ie.A,{content:"submitted",children:e});case"new":return(0,F.jsx)(ie.A,{content:"new",children:e});case"pending":return(0,F.jsx)(ie.A,{content:"pending",children:e});case"declined":return(0,F.jsx)(ie.A,{content:"declined",children:e});default:return(0,F.jsx)(ie.A,{content:t||"unknown",children:e||"-"})}}]}},{property:"",header:{label:""},cell:{formatters:[(e,r)=>{let{rowData:n,index:i}=r;const u=_(n),p="DAC7 immovable property reporting"===u;return"1099-\u041a reporting"===u?null:(0,F.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:(0,F.jsx)(ae,{rowId:String(n.id||`dac7-row-${i}
1`),openRowId:d?String(d):null,setOpenRowId:c,hasFile:!!n.xml_file,showSubmit:"new"===n.status,showPreview:"submitted"===n.status||"pending"===n.status,showEditStatus:null===a||void 0===a?void 0:a.is_manager,showDelete:"new"===n.status,onDownload:()=>{return e=n.xml_file,void o(e);var e},onSubmit:()=>((e,o)=>{s((0,Y.MM)(e)).then((()=>{t("dac7Submit",{id:e,is_immovable:o})}))})(n.id,p),onPreview:()=>((e,o)=>{s((0,Y.MM)(e)).then((()=>{t("dac7Preview",{id:e,is_immovable:o})}))})(n.id,p),onEditStatus:()=>((e,o)=>{t("changeDac7Status",{...e,is_immovable:o})})(n,p),onDelete:()=>((e,o)=>{t("deleteDac7Report",{...e,is_immovable:o})})(n,p),t:l})})}]}}]),[l,d,null===a||void 0===a?void 0:a.is_manager,g]),f=(0,r.useMemo)((()=>{const e=[];return u&&u.length>0&&e.push(...u.map((e=>({...e,is_immovable:!1})))),p&&p.length>0&&e.push(...p.map((e=>({...e,is_immovable:!0})))),v&&v.length>0&&e.push(...v.map((e=>({...e,country:"USA",country_code:"USA"})))),e}),[u,p,v]),w=(0,r.useMemo)((()=>(0,A.A)(f,x)),[f,x]),D={position:"relative",...i?{minHeight:"200px"}:{}};return(0,F.jsxs)("div",{className:"LappaTablePage__tableArea",style:D,children:[i&&(0,F.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.9)",zIndex:10},children:(0,F.jsx)(re.y,{accessibilityLabel:"Loading reports",size:"large"})}),(0,F.jsx)(ne.A,{columnContentTypes:["text","text","text","text","text","text","text"],headings:x.map((e=>{let{header:t}=e;return t.label})),rows:w,hideScrollIndicator:!0})]})},de=e=>{let{onActionDialogsOpen:t,onDownloadFile:o}=e;const n=(0,h.Ay)(),{user:a,fetchingDac7Reports:i}=(0,m.d4)((e=>({user:e.user.user,fetchingDac7Reports:e.declarations.fetchingDac7Reports})));(0,r.useEffect)((()=>{n((0,Y.Bs)()),n((0,Y.Bs)({is_immovable:!0})),n((0,Z.yW)())}),[]);const l=(0,r.useCallback)((()=>(0,F.jsx)(se,{onActionDialogsOpen:t,onDownloadFile:o,user:a,loading:i})),[t,o,a,i]);return(0,F.jsx)(oe,{renderDac7ReportsTable:l,handleActionDialogsOpen:t})};var ce=o(90135);const ue=e=>{let{open:t,onClose:o,reportId:a,is_immovable:i}=e;const{t:l}=(0,n.Bd)(),s=(0,h.Ay)(),{dac7Preview:d}=(0,m.d4)((e=>({dac7Preview:e.declarations.dac7Preview})));(0,r.useEffect)((()=>{t&&a&&s((0,Y.MM)(a))}),[t,a]);const c=(0,ce.x)({t:l}),u=(0,A.A)(d||[],c.tableSchema);return t?(0,F.jsx)(p.A,{title:l(i?"dac7.dac7PreviewImmovable":"dac7.dac7Preview"),infoIconVisible:!1,onClose:o,visible:t,content:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("br",{}),(0,F.jsx)(ne.A,{columnContentTypes:["text","text","text","text","numeric"],headings:c.tableSchema.map((e=>{let{header:t}=e;return t.label})),rows:u,hideScrollIndicator:!0,increasedTableDensity:!0})]})}):null};var pe=o(66823),me=o(79032);const he=e=>{let{open:t,onClose:o,reportId:a,is_immovable:s,onReportsUpdated:d}=e;const{t:c}=(0,n.Bd)(),u=(0,h.Ay)(),[v,b]=(0,r.useState)(!1),{dac7Preview:y,submittingDac7Report:g}=(0,m.d4)((e=>({dac7Preview:e.declarations.dac7Preview,submittingDac7Report:e.declarations.submittingDac7Report})));(0,r.useEffect)((()=>{t&&a&&(u((0,Y.MM)(a)),b(!1))}),[t,a]);const _=(0,ce.x)({t:c}),x=(0,A.A)(y||[],_.tableSchema),f=(0,r.useCallback)((()=>{b(!1),o()}),[o]),w=(0,r.useCallback)((()=>{u((0,Y.qH)(a)).then((()=>{d&&d(),f()})).catch((()=>{}))}),[u,a,d,f]);return t?(0,F.jsx)(p.A,{title:c(s?"dac7.dac7SubmitImmovable":"dac7.dac7Submit"),infoIconVisible:!1,onClose:f,visible:t,content:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("br",{}),(0,F.jsx)(ne.A,{columnContentTypes:["text","text","text","text","numeric"],headings:_.tableSchema.map((e=>{let{header:t}=e;return t.label})),rows:x,hideScrollIndicator:!0,increasedTableDensity:!0})]}),footer:(0,F.jsxs)(pe.a,{display:"flex",flexDirection:"column",gap:"4",width:"100%",children:[(0,F.jsx)("div",{className:"modal-disclaimer-checkbox",children:(0,F.jsx)(me.S,{label:(0,F.jsx)("span",{className:"modal-disclaimer-checkbox__text",children:c("dac7.clickObSubmit")}),checked:v,onChange:e=>b(e)})}),(0,F.jsxs)(i.e,{fullWidth:!0,children:[(0,F.jsx)(l.$,{onClick:f,children:c("reports.cancel")}),(0,F.jsx)(l.$,{variant:"primary",onClick:w,disabled:!v,loading:g,children:c("vatReturns.submit")})]})]})}):null},ve=e=>{let{open:t,onClose:o,reportId:a,businessName:s,periodYear:d,is_immovable:c,onReportsUpdated:u}=e;const{t:v}=(0,n.Bd)(),b=(0,h.Ay)(),{deletingDac7Report:y,deletingDac7ReportError:g}=(0,m.d4)((e=>({deletingDac7Report:e.declarations.deletingDac7Report,deletingDac7ReportError:e.declarations.deletingDac7ReportError}))),_=(0,r.useCallback)((()=>{b((0,Y.HP)(a)).then((e=>{200===e.status&&(u&&u(),o())})).catch((()=>{}))}),[b,a,u,o]);return t?(0,F.jsx)(p.A,{title:"Delete report",iconType:"danger",onClose:o,description:`Do you want delete report for ${s} for ${d}
1?`,visible:t,footer:(0,F.jsxs)(F.Fragment,{children:[g&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(k.A,{status:"critical",message:g,onDismiss:()=>{}}),(0,F.jsx)("br",{})]}),(0,F.jsxs)(i.e,{fullWidth:!0,children:[(0,F.jsx)(l.$,{onClick:o,size:"large",children:v("reports.cancel")}),(0,F.jsx)(l.$,{variant:"plain",onClick:_,tone:"critical",size:"large",loading:y,children:v("reports.delete")})]})]})}):null},be=[{value:"new",label:"New"},{value:"pending",label:"Pending"},{value:"submitted",label:"Submitted"},{value:"declined",label:"Declined"}],ye=e=>{let{open:t,onClose:o,reportId:a,currentStatus:s,is_immovable:d,onReportsUpdated:c}=e;const{t:u}=(0,n.Bd)(),v=(0,h.Ay)(),[b,y]=(0,r.useState)(null),{editingDac7Status:g,editingDac7StatusError:x}=(0,m.d4)((e=>({editingDac7Status:e.declarations.editingDac7Status,editingDac7StatusError:e.declarations.editingDac7StatusError})));(0,r.useEffect)((()=>{t||y(null)}),[t]);const f=(0,r.useCallback)((()=>{y(null),o()}),[o]),w=(0,r.useCallback)((()=>{v((0,Y.I_)({id:a,status:b})).then((e=>{e&&(c&&c(),f())})).catch((()=>{}))}),[v,a,b,c,f]);return t?(0,F.jsx)(p.A,{title:"Change status",visible:t,infoIconVisible:!1,onClose:f,content:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("br",{}),(0,F.jsx)(_.l,{id:"status",label:u("vatReturns.selectStatus"),options:be,onChange:e=>{y(e)},value:null!==b&&void 0!==b?b:s})]}),footer:(0,F.jsxs)(F.Fragment,{children:[x&&(0,F.jsxs)("div",{children:[(0,F.jsx)(k.A,{status:"critical",message:x,onDismiss:()=>{}}),(0,F.jsx)("br",{})]}),(0,F.jsx)(i.e,{children:(0,F.jsx)(l.$,{variant:"primary",loading:g,disabled:!b||b===s,size:"large",onClick:w,children:u("vatReturns.edit")})})]})}):null};var ge=o(94350),_e=o(45178),xe=o(31287);const fe=()=>{var e,t,o,v,b,y,g,_,x,f,w;const{t:j}=(0,n.Bd)(),D=(0,h.Ay)(),{user:C}=(0,m.d4)((e=>({user:e.user.user}))),[A,S]=(0,r.useState)({hmrcIntegration:{open:!1},deleteReport:{open:!1},subs:{open:!1},deleteDac7Report:{open:!1},changeDac7Status:{open:!1},dac7Preview:{open:!1},dac7Submit:{open:!1},liabilitiesReport:{open:!1},obligationsReport:{open:!1}}),[R,I]=(0,r.useState)(null),[T,$]=(0,r.useState)(null),[P,O]=(0,r.useState)(null),[N,L]=(0,r.useState)(null);(0,r.useEffect)((()=>{D((0,E.Me)()),D((0,E.hT)()),D((0,Z.Zv)()),D((0,ge.nv)()),D((0,M.uq)()),D((0,M.oe)())}),[]);const W=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("liabilitiesReport"===e)I(t),S((o=>({...o,[e]:{open:!0},cellData:t})));else if("obligationsReport"===e)$(t),S((o=>({...o,[e]:{open:!0},cellData:t})));else if("subs"===e){const o=t.subscriptionData||t.e;o&&o.to_buy&&L(o),S((o=>({...o,[e]:{open:!0},cellData:t})))}else S((o=>({...o,[e]:{open:!0},cellData:t})))}),[]),H=(0,r.useCallback)((e=>{"liabilitiesReport"===e?I(null):"subs"===e&&L(null),"obligationsReport"===e&&$(null),"hmrcIntegration"===e&&O(null),S((t=>({...t,[e]:{open:!1},cellData:{}})))}),[]),K=(0,r.useCallback)((()=>{I(null),S((e=>({...e,liabilitiesReport:{open:!1},cellData:{}})))}),[]),V=(0,r.useCallback)((()=>{$(null),S((e=>({...e,obligationsReport:{open:!1},cellData:{}})))}),[]),J=(0,r.useCallback)((()=>{D((0,Y.Bs)()),D((0,Y.Bs)({is_immovable:!0}))}),[D]),X=(0,r.useCallback)((e=>{if(!e)return;const t=window.location.origin,o=e.startsWith("http")?e:`${t}/${e.replace(/^(\.\.\/)+/,"")}`,r=o.split("/").pop(),n=document.createElement("a");n.setAttribute("href",o),n.setAttribute("download",r),n.style.display="none",document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(o),document.body.removeChild(n)}),5e3)}),[]),Q=(0,r.useCallback)((e=>{const t={id:`${e}`};D((0,M.MR)(t)).then((()=>{D((0,M.uq)()).then((()=>{D((0,E.hT)()),D((0,E.Me)()),H("deleteReport")}))})).catch((()=>{}))}),[D,H]),ee=()=>{if(!A.hmrcIntegration.open)return null;const e=()=>{H("hmrcIntegration")};return(0,F.jsx)(p.A,{title:j("reports.hmrcInt"),description:(0,F.jsx)("p",{children:j("reports.connectHMRC")}),onClose:e,visible:A.hmrcIntegration.open,footer:(0,F.jsxs)(F.Fragment,{children:[P&&(0,F.jsx)("div",{style:{marginBottom:"1rem"},children:(0,F.jsx)(k.A,{status:"critical",message:P,onDismiss:()=>O(null)})}),(0,F.jsxs)(i.e,{fullWidth:!0,children:[(0,F.jsx)(l.$,{onClick:e,size:"large",children:j("reports.close")}),(0,F.jsx)(l.$,{variant:"primary",onClick:()=>
1{if(O(null),!(0,_e.Ri)("api_key")){const e=localStorage.getItem("api_key"),t=new Date,o=new Date(t.getTime()+6048e5);(0,_e.TV)("api_key",e,{expires:o,path:"/"})}window.location="https://login.lappa.org/api/1/integrations/hmrc?production=true"},size:"large",children:j("reports.connect")})]})]})})};return(0,r.useEffect)((()=>{null!==R&&void 0!==R&&R.hmrcIntegration&&!A.hmrcIntegration.open&&W("hmrcIntegration")}),[null===R||void 0===R?void 0:R.hmrcIntegration]),(0,r.useEffect)((()=>{null!==T&&void 0!==T&&T.hmrcIntegration&&!A.hmrcIntegration.open&&W("hmrcIntegration")}),[null===T||void 0===T?void 0:T.hmrcIntegration]),R?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(z,{liabilities:R.liabilities||null,liabData:R.liabData,onBack:K}),ee()]}):T?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{obligations:T.obligations||null,obligData:T.obligData,onBack:V}),ee()]}):(0,F.jsxs)(s.Y,{title:(0,F.jsx)(d.E,{variant:"heading3xl",as:"span",children:j("reports.reports")}),subtitle:(0,F.jsx)(d.E,{variant:"bodyLg",as:"span",color:"subdued",children:j("reports.subtitle")}),fullWidth:!0,children:[(0,F.jsx)(u.A,{title:"Reports"}),(0,F.jsxs)(c.P,{children:[(0,F.jsx)(q,{onActionDialogsOpen:W,onDownloadFile:X}),(0,F.jsx)(B,{onActionDialogsOpen:W}),(0,F.jsx)(U,{onActionDialogsOpen:W}),(null===C||void 0===C?void 0:C.is_omp)&&(null===C||void 0===C?void 0:C.dac7)&&(0,F.jsx)(de,{onActionDialogsOpen:W,onDownloadFile:X})]}),(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),A.deleteReport.open?(0,F.jsx)(p.A,{title:"Delete report",iconType:"danger",onClose:()=>H("deleteReport"),description:(0,F.jsx)("p",{children:"Do you want delete the report?"}),visible:A.deleteReport.open,footer:(0,F.jsxs)(i.e,{fullWidth:!0,children:[(0,F.jsx)(l.$,{onClick:()=>H("deleteReport"),size:"large",children:j("reports.cancel")}),(0,F.jsx)(l.$,{variant:"plain",onClick:()=>{var e;return Q(null===(e=A.cellData)||void 0===e?void 0:e.id)},tone:"critical",size:"large",children:j("reports.delete")})]})}):null,(()=>{var e,t,o,r,n;if(!A.subs.open)return null;const i=N||(null===(e=A.cellData)||void 0===e?void 0:e.subscriptionData)||(null===(t=A.cellData)||void 0===t?void 0:t.e);if(i&&i.to_buy){var l,s,d,c,u,m;const e={...i,subscription:i.subscription||(null===(l=i.to_buy)||void 0===l?void 0:l.subscription)||[],additional:i.additional||(null===(s=i.to_buy)||void 0===s?void 0:s.additional)||[],currency:i.currency||(null===(d=i.to_buy)||void 0===d?void 0:d.currency),amount:i.amount||(null===(c=i.to_buy)||void 0===c?void 0:c.amount),sbs_type:i.sbs_type||(null===(u=i.to_buy)||void 0===u?void 0:u.sbs_type)||localStorage.getItem("sbs_type")||"omp_subs",line_items:i.line_items||(null===(m=i.to_buy)||void 0===m?void 0:m.line_items)||[],to_buy:i.to_buy};return(0,F.jsx)(xe.A,{subscriptionData:e,onClose:()=>H("subs")})}return(0,F.jsx)(p.A,{title:"Warning",iconType:"warning",description:(0,F.jsx)("div",{children:null!==(o=A.cellData)&&void 0!==o&&o.error?"This functionality is not available because a paid subscription is required.":(null===(r=A.cellData)||void 0===r||null===(n=r.e)||void 0===n?void 0:n.error)&&(0,F.jsx)("h3",{style:{marginBottom:10,marginTop:10},children:A.cellData.e.error})}),onClose:()=>H("subs"),visible:A.subs.open,content:(0,F.jsx)(a.N_,{className:"Polaris-Link",to:"/subscription",children:j("reports.selectPlan")})})})(),ee(),(0,F.jsx)(ue,{open:A.dac7Preview.open,onClose:()=>H("dac7Preview"),reportId:null===(e=A.cellData)||void 0===e?void 0:e.id,is_immovable:null===(t=A.cellData)||void 0===t?void 0:t.is_immovable}),(0,F.jsx)(he,{open:A.dac7Submit.open,onClose:()=>H("dac7Submit"),reportId:null===(o=A.cellData)||void 0===o?void 0:o.id,is_immovable:null===(v=A.cellData)||void 0===v?void 0:v.is_immovable,onReportsUpdated:J}),(0,F.jsx)(ve,{open:A.deleteDac7Report.open,onClose:()=>H("deleteDac7Report"),reportId:null===(b=A.cellData)||void 0===b?void 0:b.id,businessName:null===(y=A.cellData)||void 0===y?void 0:y.business_name,periodYear:null===(g=A.cellData)||void 0===g?void 0:g.period_year,is_immovable:null===(_=A.cellData)||void 0===_?void 0:_.is_immovable,onReportsUpdated:J}),(0,F.jsx)(ye,{open:A.changeDac7Status.open,onClose:()=>H("changeDac7Status"),reportId:null===(x=A.cellData)||void 0===x?void 0:x.id,currentStatus:null===(f=A.cellData)||void 0===f?void 0:f.status,is_immovable:null===(w=A.cellData)||void 0===w?void 0:w.is_immovable,onReportsUpdated:J})]})}},54332:(e,t,o)=>{o.d(t,{$:()=>a});var r=o(86178),n=o.n(r);o(34348);function a(){return{timezone:n().tz.guess(),device:{width:screen.width,height:screen.height,color_quality:screen.colorDepth,bit_depth:screen.pixelDepth,scale:window.devicePixelRatio},browser:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},plugins:Object.entries(navigator.plugins).map((e=>e[1].name))}}},56011:()=>{},62902:(e,t,o)=>{o.d(t,{A:()=>r.A});var r=o(38230)},64913:(e,t,o)=>{function r(e){let{page:t,perPage:o}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const r=t-1||0,n=Math.ceil(e.length/o),a=r<n?r:0;return{amount:n,rows:e.slice(a*o,a*o+o),page:a}}}o.d(t,{A:()=>r})},66629:(e,t,o)=>{o.d(t,{$Y:()=>d,DB:()=>g,F:()=>h,O1:()=>l,Rr:()=>y,Sm:()=>c,WM:()=>x,cY:()=>p,dB:()=>b,fJ:()=>v,pc:()=>m,uA:()=>_});var r=o(57506),n=o(11180),a=o(33587);function i(e){if(null==e||""===e)return!1;const t=Number(e);return!Number.isNaN(t)&&t>0}function l(e){var t,o,r,n;if(!e||"object"!==typeof e)return null;const a=[null===(t=e.data)||void 0===t?void 0:t.id,null===(o=e.data)||void 0===o?void 0:o.report_id,e.
1id,e.report_id,e.dac7_id,e.dac7_report_id,null===(r=e.report)||void 0===r?void 0:r.id,null===(n=e.report)||void 0===n?void 0:n.report_id];for(const c of a)if(i(c))return c;const l=e.merchants;if(Array.isArray(l)&&l.length>0){var s,d;const e=null!==(s=null!==(d=l[0].report_id)&&void 0!==d?d:l[0].dac7_report_id)&&void 0!==s?s:l[0].dac7_id;if(i(e))return e}return null}function s(e){return"string"===typeof e&&e.trim().length>0}function d(e){var t,o,r,n;if(s(e))return e.trim();if(!e||"object"!==typeof e)return null;const a=[e.file,e.xml_file,e.download_link,e.download_url,e.link,e.url,null===(t=e.data)||void 0===t?void 0:t.file,null===(o=e.data)||void 0===o?void 0:o.xml_file,null===(r=e.data)||void 0===r?void 0:r.link,null===(n=e.data)||void 0===n?void 0:n.url];for(const i of a)if(s(i))return i.trim();return null}function c(e){let{reportId:t,business_name:o,period:r,dataForDac7ReportInfo:n}=e;const a=o||(null===n||void 0===n?void 0:n.business_name)||"DAC7 report",i=null!==r&&void 0!==r?r:null===n||void 0===n?void 0:n.period;return{id:t,name:null!=i?`${a} (${i})`:a}}function u(e){var t,o,r,n,a,i;if(!e||"object"!==typeof e||Array.isArray(e))return e;const l=e.data&&"object"===typeof e.data&&!Array.isArray(e.data)?e.data:null,s=l?{...e,...l}:{...e},d=function(e){if(!0===e||1===e)return!0;if(!1===e||0===e||null==e)return!1;if("string"===typeof e){const t=e.trim().toLowerCase();if("true"===t||"1"===t||"yes"===t)return!0;if("false"===t||"0"===t||"no"===t||""===t)return!1}return Boolean(e)}(null!==(t=null!==(o=s.has_credits)&&void 0!==o?o:s.hasCredits)&&void 0!==t?t:s.has_credit),c=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];for(const r of t)if("string"===typeof r&&r.trim())return r.trim();return""}(s.message,s.credit_message,s.creditMessage,e.message,e.credit_message,null===l||void 0===l?void 0:l.message,null===l||void 0===l?void 0:l.credit_message);return{...s,has_credits:d,message:c,credit_data:null!==(r=null!==(n=s.credit_data)&&void 0!==n?n:s.creditData)&&void 0!==r?r:null,session_id:null!==(a=null!==(i=s.session_id)&&void 0!==i?i:s.sessionId)&&void 0!==a?a:null}}function p(e){var t,o;return null!==(t=null===(o=u(e))||void 0===o?void 0:o.message)&&void 0!==t?t:""}async function m(e){const t=await(0,r.A)("/payment/write_off_or_pay_credit","POST",e);let o;try{o=await t.json()}catch{o={message:t.statusText||`HTTP ${t.status}`}}if(!t.ok){const e=new Error(t.errorMessage||"Error");throw e.responseData=o,e.status=t.status,e}return u(o)}async function h(e){const t=await(0,r.A)("/reports/dac_7","POST",e);let o;try{o=await t.json()}catch{o={message:t.statusText||`HTTP ${t.status}`}}if(!t.ok){const e=new Error(t.errorMessage||"Error");throw e.responseData=o,e.status=t.status,e}return o}function v(e){let{payload:t,rawResp:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=l(o);return console.group(`[DAC7] create report (dac_7) \u2014 ${e}`),console.log("request payload:",t),console.log("raw server response:",o),console.log("extracted report_id:",r),console.groupEnd(),r}function b(e){var t,o;let{payload:r,rawResp:n,normalized:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=null!==a&&void 0!==a?a:u(n),l=p(null!==i&&void 0!==i?i:n);console.group(`[DAC7] write_off_or_pay_credit \u2014 ${e}`),console.log("request payload:",r),console.log("raw server response:",n),console.log("normalized response:",i),console.log("has_credits (raw):",null===n||void 0===n?void 0:n.has_credits,null===n||void 0===n||null===(t=n.data)||void 0===t?void 0:t.has_credits),console.log("has_credits (normalized):",null===i||void 0===i?void 0:i.has_credits),console.log("hasWriteOffCredits:",y(null!==i&&void 0!==i?i:n)),console.log("message:",l),console.log("message length:",null!==(o=null===l||void 0===l?void 0:l.length)&&void 0!==o?o:0),console.groupEnd()}function y(e){var t;return Boolean(null===(t=u(e))||void 0===t?void 0:t.has_credits)}function g(e,t){const o=u(e);return o&&y(o)?null:null!==o&&void 0!==o&&o.error?(0,a.SU)(o,"")||null:t&&(0,a.SU)(t,"")||null}function _(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i(e))return(0,n.P)({reportId:e,creditType:n.O.DAC7,useCredits:t,quickPay:o.quickPay});const r={report_id:null,credit_type:n.O.DAC7,use_credits:Boolean(t)};return o.quickPay&&(r.quick_pay=!0),r}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=function(e){var t;const o=u(e);if(!o||"object"!==typeof o)return null;const r=[o.report_id,o.id,o.dac7_report_id,null===(t=o.credit_data)||void 0===t?void 0:t.report_id];for(const n of r)if(i(n))return n;return l(o)}(e);return o||function(e){let{dac7ReportId:t,dataForDac7ReportInfo:o}=e;const r=[t,null===o||void 0===o?void 0:o.id,null===o||void 0===o?void 0:o.report_id];for(const n of r)if(i(n))return n;return null}(t)}},73054:(e,t,o)=>{o.d(t,{A:()=>u});o(65043);var r=o(70579);const n=new Set(["awaiting_documents","awaiting_payment_from_client","correction_required","office_action_issued","awaiting_third_party_consent","awaiting_original_documents"]),a=new Set(["documentation_received","under_internal_review","ready_for_filing","in_government_review","response_filed","opposition_period"]),i=new Set(["filed"]),l=new Set(["approved","registration_issued","completed"]),s=new Set(["rejected","registration_canceled","withdrawn","abandoned","expired"]),d="#FFFAF5",c="#FD853A",u=e=>{let{content:t,label:o,backgroundColor:u,textColor:p}=e,m={display:"inline-block",padding:"0px 6px",borderRadius:"16px",fontWeight:"400",fontSize:"12px"},h="#707070";const v=o||t;if(null!=u&&""!==u&&null!=p&&""!==p)m={...m,backgroundColor:u},h=p;else switch(t){case"new":m={...m,backgroundColor:"#E4F3FE"},h="#4CADF9";break;case"sent":case"accepted":m={...m,backgroundColor:"#F5FAFF"},h="#2E90FA";break;
1case"received":m={...m,backgroundColor:"#F5FCFF"},h="#26A2D7";break;case"updated":case"on_hold":m={...m,backgroundColor:"#F9F5FF"},h="#6726D7";break;case"submitted":case"auto-submitted":case"paid":case"active":case"success":m={...m,backgroundColor:"#F6FEF9"},h="#489F56";break;case"verified":m={...m,backgroundColor:"#E4F3FE"},h="#267FD7";break;case"warning":case"attention":case"suspended":case"pending":case"not-configured":case"partial":m={...m,backgroundColor:"#FFFAF5"},h="#FD853A";break;case"inactive":case"not-active":case"skipped":case"refund":case"balance_refund":case"draft":case"discontinued":case"voided":m={...m,backgroundColor:"#F9F9F9"},h="#707070";break;case"declined":case"error":case"critical":case"alert":m={...m,backgroundColor:"#FFFBFA"},h="#D92D20";break;default:{const e=null==(b=t)||"string"!==typeof b?"":b.trim().toLowerCase().replace(/-/g,"_").replace(/\s+/g,"_").replace(/_+/g,"_");n.has(e)||a.has(e)?(m={...m,backgroundColor:d},h=c):i.has(e)?(m={...m,backgroundColor:"#F5FAFF"},h="#2E90FA"):l.has(e)?(m={...m,backgroundColor:"#F6FEF9"},h="#489F56"):s.has(e)?(m={...m,backgroundColor:"#FFFBFA"},h="#D92D20"):(m={...m,backgroundColor:"#F9F9F9"},h="#707070");break}}var b;return(0,r.jsx)("div",{style:m,children:(0,r.jsx)("span",{style:{color:h},children:v})})}},74553:(e,t,o)=>{o.d(t,{WW:()=>a,t_:()=>r,zs:()=>n});const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||!Array.isArray(t)||0===t.length)return null;const o=t.find((t=>t.code===e||t.iso_code_2===e||t.iso_code_3===e||t.country_code===e));return(null===o||void 0===o?void 0:o.iso_code_2)||null},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null!==e&&void 0!==e&&e.country_iso_code?e.country_iso_code:null!==e&&void 0!==e&&e.country_code?r(e.country_code,t):null!==e&&void 0!==e&&e.country_id?r(e.country_id,t):null};function a(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e&&"object"===typeof e&&e.name)return String(e.name);const r=[t,"string"===typeof e?e.trim():null,null===e||void 0===e?void 0:e.code].filter(Boolean);if(Array.isArray(o)&&o.length>0)for(const n of r){const e=o.find((e=>e.code===n||e.value===n||e.iso_code_2===n||e.iso_code_3===n||e.country_code===n));if(null!==e&&void 0!==e&&e.name)return e.name;if(null!==e&&void 0!==e&&e.label)return e.label}return"string"===typeof e&&e.trim()?e.trim():null}},87909:()=>{},90135:(e,t,o)=>{o.d(t,{x:()=>d});var r=o(53536),n=o.n(r),a=o(39335),i=o(86178),l=o.n(i);const s=n().noop,d=e=>{let{t:t}=e;const o=t("dac7.pleaseFillThisField"),r=e=>!e&&o,n=e=>e?(0,a.Rp)(e):o,i=[{type:"input",props:{id:"merchant_name",type:"text",inputMode:"text",placeholder:t("dac7.merchantName"),validate:r}},{type:"select",props:{id:"user_status",placeholder:t("dac7.userStatus"),validate:s}},{type:"input",props:{id:"tin",type:"text",infoTooltipText:"Tax identification number",inputMode:"text",placeholder:t("dac7.tin"),validate:r}},{type:"select",props:{id:"tin_issued_by",placeholder:t("dac7.tinIssuedByOptional"),validate:s}},{type:"input",props:{id:"email",type:"text",inputMode:"text",placeholder:t("dac7.email"),validate:n}},{type:"input",props:{id:"phone_number",type:"text",inputMode:"text",placeholder:t("dac7.telephoneNumber"),validate:s}},{type:"input",props:{id:"iban",type:"text",inputMode:"text",placeholder:t("dac7.merchantsIbanOptional"),validate:s}},{type:"input",props:{id:"bic",type:"text",inputMode:"text",placeholder:t("dac7.bicOptional"),validate:s}},{type:"select",props:{id:"country",placeholder:t("dac7.country"),validate:s}},{type:"input",props:{id:"city",type:"text",inputMode:"text",placeholder:t("dac7.city"),validate:r}},{type:"input",props:{id:"address_line",type:"text",inputMode:"text",placeholder:t("dac7.addressLine"),validate:r}},{type:"input",props:{id:"zip",type:"text",inputMode:"text",placeholder:t("dac7.zip"),validate:r}},{type:"select",props:{id:"currency",placeholder:"Currency",validate:s}},{type:"datepicker",props:{id:"date_birth",type:"text",placeholder:t("dac7.birthDate"),customFormat:e=>l()(e).format("yyyy-MM-DD"),validate:s,datepickerProps:{showYearDropdown:!0,yearDropdownItemNumber:80,scrollableYearDropdown:!0,maxDate:Date.now()}}},{type:"input",props:{id:"tax_number",type:"text",inputMode:"text",placeholder:t("dac7.taxNumber"),validate:s}}],d={type:"input",props:{id:"merchant_id",type:"text",inputMode:"text",placeholder:t("dac7.merchantId"),validate:r}}
1,c=[{type:"input",props:{id:"merchant_name",type:"text",inputMode:"text",placeholder:t("dac7.merchantBusinessName"),validate:r}},{type:"input",props:{id:"commercial_name",type:"text",inputMode:"text",placeholder:t("dac7.commercialNameOrUsernameOnThePlatform"),validate:r}},{type:"input",props:{id:"tin",type:"text",infoTooltipText:"Tax identification number",inputMode:"text",placeholder:t("dac7.tin"),validate:r}},{type:"select",props:{id:"tin_issued_by",placeholder:t("dac7.tinIssuedByOptional"),validate:s}},{type:"input",props:{id:"email",type:"text",inputMode:"text",placeholder:t("dac7.email"),validate:n}},{type:"input",props:{id:"phone_number",type:"text",inputMode:"text",placeholder:t("dac7.telephoneNumber"),validate:s}},{type:"input",props:{id:"tax_number",type:"text",inputMode:"numeric",placeholder:t("dac7.taxNumber"),validate:s}},{type:"input",props:{id:"iban",type:"text",inputMode:"text",placeholder:t("dac7.merchantsIbanOptional"),validate:s}},{type:"input",props:{id:"bic",type:"text",inputMode:"numeric",placeholder:t("dac7.bicOptional"),validate:s}},{type:"select",props:{id:"country",placeholder:t("dac7.country"),validate:s}},{type:"input",props:{id:"city",type:"text",inputMode:"text",placeholder:t("dac7.city"),validate:r}},{type:"input",props:{id:"address_line",type:"text",inputMode:"text",placeholder:t("dac7.addressLine"),validate:r}},{type:"input",props:{id:"zip",type:"text",inputMode:"text",placeholder:t("dac7.zip"),validate:r}},{type:"input",props:{id:"url",type:"text",inputMode:"text",placeholder:"URL",validate:r}},{type:"select",props:{id:"currency",placeholder:"Currency",validate:s}}],u=[{type:"input",props:{id:"total_gross_amount_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"gross_amount_of_transactions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"total_number_of_transactions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"related_number_of_transactions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"total_amount_of_commissions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"vat_withheld_q",type:"number",inputMode:"numeric",validate:s}}],p=[{type:"input",props:{id:"total_gross_amount_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"total_number_of_transactions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"total_amount_of_commissions_q",type:"number",inputMode:"numeric",validate:s}},{type:"input",props:{id:"vat_withheld_q",type:"number",inputMode:"numeric",validate:s}}],m=[{property:"merchant_name",header:{label:t("dac7.name")}},{property:"legal_status",header:{label:t("dac7.legalStatus")}},{property:"total_gross_amount",header:{label:t("dac7.totalGrossAmountOfTransactions")}},{property:"total_number_of_transactions",header:{label:t("dac7.numberOfTransactions")}}];return{legalEntitySchema:c,naturalPersonSchema:i,relevantActivitySchema:u,relevantActivityImmovableSchema:p,immovablePropertyAdditionalInfoSchema:[{type:"select",props:{id:"property_country",placeholder:t("dac7.country"),validate:s}},{type:"input",props:{id:"property_address",type:"text",inputMode:"text",placeholder:t("dac7.propertyAddress"),validate:r}},{type:"input",props:{id:"land_registration_number",type:"text",inputMode:"text",placeholder:t("dac7.landRegistrationNumber"),validate:r}},{type:"select",props:{id:"property_type",placeholder:t("dac7.propertyType"),validate:s}},{type:"input",props:{id:"number_of_rented_days",type:"number",inputMode:"text",placeholder:t("dac7.numberOfRentedDays"),validate:r}}],merchantIdInput:d,tableSchema:m}}}}]); 2//# sourceMappingURL=route-reports.bdfb35f7.chunk.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.