1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/InvoiceForm-DJaLxVUU.js","assets/Button-CUpKEAfP.js","assets/_sentry-release-injection-file-_oeELMPa.js","assets/_commonjsHelpers-BtOaTdWb.js","assets/index-yq28UAnt.js","assets/cs-BHj9zxo3.js","assets/preload-helper-BvzuPTLt.js","assets/uk-DukXYPB_.js","assets/posthog-DkyEiADo.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/actioncable.esm-BMIXSJNp.js","assets/js.cookie-mw8lZ_8_.js","assets/Button-wAj6gJzx.css","assets/BlockWrapper-BpoNZzsv.js","assets/BlockWrapper-C4ZUSTET.css","assets/ksefDismissMixin-Ci9e1OqW.js","assets/scrollToErrorField-DWhRs9P8.js","assets/affix-DXvz5TRQ.js","assets/jquery-meok4uYo.js","assets/aresMerkTrackingMixin-DQ0HYQ1S.js","assets/aresMerkTracking-CuvCc7xV.js","assets/index-cleQ8XVO.js","assets/ico-payment-DvpfP7dv.js","assets/SequencePopover-0iOU3aWg.js","assets/index-DMM1olFT.js","assets/SequencePopover-CWFgf044.css","assets/startOfMonth-CEc3B0bj.js","assets/isSameMonth-HNytUn61.js","assets/fetchContactsForForm-Buw7iP0h.js","assets/fetchMerkSuggestions-B2hhf029.js","assets/check-Bt2saKS2.js","assets/vuedraggable.umd-Bzz3DzN3.js","assets/isEmpty-2y00mEwr.js","assets/ico-supply-tWjgienQ.js","assets/calculations-DdNDLYK-.js","assets/big-zf_EpVz6.js","assets/formatCurrency-2WZB9o16.js","assets/invoices-2CInZaA9.js","assets/invoiceFormSections-DlbAxmz-.js","assets/SubmitInvoiceDialog-3mPYg15Q.js","assets/debounce-DyWn_f75.js","assets/debounce-C9APE6Dr.js","assets/SubmitInvoiceDialog-DGEVWil1.css","assets/InvoiceForm-CQ1SnsqW.css","assets/InvoiceForm-DnhjlERz.js","assets/InvoiceFormSkeleton-B2WcUzt-.js","assets/InvoiceFormSkeleton-B_SmQQh_.css"])))=>i.map(i=>d[i]); 2import{_ as c}from"./preload-helper-BvzuPTLt.js";import{ap as _,b4 as l,ar as p,b5 as I,bD as u,cw as h,cx as d,cy as y,cz as F,cA as $,cm as g}from"./Button-CUpKEAfP.js";import{G as T,e as b}from"./index-DMM1olFT.js";import"./_sentry-release-injection-file-_oeELMPa.js";import{s as E}from"./aresMerkTracking-CuvCc7xV.js";import{_ as S}from"./type-icon-CfBl7UTx.js";import"./_commonjsHelpers-BtOaTdWb.js";import"./index-yq28UAnt.js";import"./cs-BHj9zxo3.js";import"./uk-DukXYPB_.js";import"./posthog-DkyEiADo.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./actioncable.esm-BMIXSJNp.js";import"./js.cookie-mw8lZ_8_.js";import"./index-cleQ8XVO.js";const v="invoice_template_data";function k(){try{const e=sessionStorage.getItem(v);if(!e)return null;const t=JSON.parse(e);return sessionStorage.removeItem(v),t}catch(e){return console.error("Failed to retrieve invoice data:",e),null}}function f(e,t){const i=k();if(!i)return!1;try{return i.vatCalculation&&t.dispatch("invoiceForm/updateStoreValue",{name:"vat_calculation",value:i.vatCalculation}),i.items&&Array.isArray(i.items)&&(t.state.invoiceForm.lines.forEach((s,r)=>{!s.description&&s.price===0&&t.commit("invoiceForm/removeInvoiceItem",r)}),i.items.forEach(s=>{t.dispatch("invoiceForm/addInvoiceItemWithData",s)})),i.showInvoiceFormGuide&&e.currentRoute&&(e.currentRoute.params.showInvoiceFormGuide=!0),!0}catch(o){return console.error("Failed to apply invoice data:",o),!1}}const V=1e3,w=1e4,D={name:"InvoicePage",components:{InvoiceFormV2:()=>c(()=>import("./InvoiceForm-DJaLxVUU.js").then(e=>e.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])),InvoiceFormV3:()=>c(()=>import("./InvoiceForm-DnhjlERz.js"),__vite__mapDeps([44,6,2,0,1,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])),InvoiceFormSkeleton:()=>c(()=>import("./InvoiceFormSkeleton-B2WcUzt-.js"),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,46]))},props:{invoiceType:String},provide(){return{invoiceType:this.invoiceType,isNewInvoice:this.invoiceType===h}},data:()=>({skipIpInfoQuery:!0,formVersion:"v2",PATH_INVOICES_OVERVIEW:I,passwordDialogOpened:!1}),apollo:{ipInfo:{query:T,skip(){return this.skipIpInfoQuery},update({ipInfo:e}){var s;const{countryCode:t,currencyCode:i,language:o}=e;if(i&&this.$store.dispatch("invoiceForm/updateStoreValue",{name:"currency",value:i}),o){const r=(s=this.languageOptions.find(n=>n.key===o))==null?void 0:s.key;r&&this.$store.dispatch("invoiceForm/updateStoreValue",{name:"language",value:r})}t&&(this.$store.dispatch("invoiceForm/updateStoreValue",{name:"seller_address_country_code",value:t}),this.$store.dispatch("invoiceForm/updateStoreValue",{name:"buyer_address_country_code",value:t}))}}},computed:{invoiceKindFromRoute(){var o,s,r;const e=this.$route.params.invoiceKind||this.$route.params.kind;if(!e)return null;const i=(((r=(s=(o=this.$store.state)==null?void 0:o.config)==null?void 0:s.invoice)==null?void 0:r.kinds)||[]).find(n=>n.route===e||n.key===e);return(i==null?void 0:i.key)||e},invoiceId(){return this.$route.params.invoiceId},...p("auth",["isAuthorized"]),...p("invoiceForm",["shouldBeRegistered","isLocked","invoiceKind","buildComplete"]),...l("invoiceForm",["eet_invoice","number","ksef_state","advance_noted_invoice_number"]),...l("config",{languageOptions:e=>e.invoice.languages}),correctionInvoiceRedirect(){return()=>this.$router.push({name:g,params:{invoiceId:this.invoiceId}})},editModeEetInvoice(){if(this.invoiceType===d&&this.isLocked){const t=this.ksef_state==="ksef_confirmed"?y:F;return this.$store.dispatch("flashMessages/addMessage",{...t,button:{...t.button,action:this.correctionInvoiceRedirect}},{root:!0}),!0}return this.invoiceType===d&&this.shouldBeRegistered&&this.$store.dispatch("flashMessages/addMessage",$,{root:!0}),!1},isNewInvoice(){return this.invoiceType===h},editDisabled(){return this.editModeEetInvoice===!0},pageTitle(){if(this.invoiceKindFromRoute&&this.isInvoiceKindRoute){const e=`form.invoiceForm.headers.${this.invoiceType}_${this.invoiceKindFromRoute}_title`;if(this.$i18n.te(e))return this.$i18n.t(e)}if(this.invoiceType===d){const e=this.invoiceKind==="vat_credit_note"?"edit_credit_note_title_with_number":"edit_title_with_number";return this.$i18n.t(`form.invoiceForm.headers.${e}`,{number:this.number})}return this.invoiceType==="invoice_from_advance"&&this.advance_noted_invoice_number?this.$i18n.t("form.invoiceForm.headers.invoice_from_advance_title_with_number",{number:this.advance_noted_invoice_number}):this.$i18n.t(`form.invoiceForm.headers.${this.invoiceType}_title`)}
2,dynamicInvoiceFormComponent(){switch(this.formVersion){case"v3":return"InvoiceFormV3";default:return"InvoiceFormV2"}},isInvoiceKindRoute(){return this.$route.name==="invoiceKind"},correctionTypeFromQuery(){const e=this.$route.query.correction_type;return["value","formal"].includes(e)?e:null}},methods:{publishFormVersion(){document.documentElement.dataset.formVersion=this.formVersion},setFormVersion(){var t;this.publishFormVersion();const e=this.$route.query.form_version;if(["v1","v2","v3"].includes(e)){this.formVersion=e,this.publishFormVersion();return}this.unsubscribeFeatureFlags=(t=this.$featureFlags)==null?void 0:t.onFeatureFlags(()=>{var o;const i=(o=this.$featureFlags)==null?void 0:o.getFeatureFlag("invoice-form-version");this.formVersion=i==="minified"?"v3":"v2",this.publishFormVersion()})},checkInvoiceTypeFromParams(){setTimeout(()=>{this.isInvoiceKindRoute&&this.invoiceKindFromRoute!=null&&this.$store.dispatch("invoiceForm/updateStoreValue",{name:"kind",value:this.invoiceKindFromRoute})},500)},refreshData(){var e;if(E(),this.invoiceType!==h){const t={invoiceId:this.invoiceId,type:this.invoiceType,kind:this.$route.query.kind,correctionType:this.correctionTypeFromQuery};this.$store.dispatch("invoiceForm/buildInvoice",t)}else(e=window.gbTrack)==null||e.call(window,"invoice_started"),this.$store.dispatch("invoices/getNewInvoice"),this.checkInvoiceTypeFromParams(),this.fetchGeoInfo()},checkLinesDialgFromParams(){typeof this.$route.query.showLines<"u"&&(this.$store.dispatch("savedLines/openDialog"),this.$store.dispatch("savedLines/getCollection",{page:1}))},scrollToHashedSection(){var m;const{hash:e}=this.$route;if(!e)return;(m=this.stopHashScroll)==null||m.call(this);const t=()=>{const a=document.querySelector(e);return a==null||a.scrollIntoView({block:"start"}),!!a};if(typeof ResizeObserver>"u"){this.$nextTick(t);return}const i=["wheel","touchstart","keydown","mousedown"];let o,s,r;const n=()=>{o.disconnect(),clearTimeout(s),clearTimeout(r),i.forEach(a=>window.removeEventListener(a,n)),this.stopHashScroll=null};o=new ResizeObserver(()=>{t()&&(clearTimeout(s),s=setTimeout(n,V))}
2),r=setTimeout(n,w),i.forEach(a=>window.addEventListener(a,n,{passive:!0})),o.observe(this.$el),this.stopHashScroll=n},checkPasswordDialogFromParams(){if(this.passwordDialogOpened||!this.isAuthorized||!this.$route.query.change_password)return;this.passwordDialogOpened=!0,this.$store.dispatch("settingsForm/openSettingsDialog",{type:"passwordForm"});const e={...this.$route.query};delete e.change_password,this.$router.replace({query:e})},fetchGeoInfo(){const e=u[this.$i18n.locale.toUpperCase()],t=e===u.EN||e===u.RS;!this.isAuthorized&&t&&(this.skipIpInfoQuery=!1,this.$apollo.queries.ipInfo.refetch())},async fetchContactData(e){if(!this.isAuthorized)return;const{data:t}=await this.$apollo.query({query:b,variables:{id:e},fetchPolicy:"network-only"});this.$store.dispatch("invoiceForm/setContactData",{payload:{data:t.contact}})},updateFromParams(){this.checkInvoiceTypeFromParams(),this.$route.params.lines&&this.$route.params.lines.forEach(e=>{this.$store.dispatch("invoiceForm/addInvoiceItemWithData",e)}),typeof this.$route.query.contactId<"u"&&(this.$store.dispatch("invoiceForm/updateStoreValue",{name:"buyer_company_name",value:parseInt(this.$route.query.contactId,10)}),this.fetchContactData(this.$route.query.contactId))},updateBodyClass(){document.body.classList.add("new-form-enabled")}},watch:{$route(){this.$store.dispatch("invoiceForm/resetState"),this.$store.dispatch("invoiceForm/setDefaultKind"),this.refreshData()},buildComplete(){this.checkLinesDialgFromParams(),this.scrollToHashedSection()},invoiceType(){this.$store.dispatch("flashMessages/clearMessage")},isAuthorized:{immediate:!0,handler(){this.checkPasswordDialogFromParams()}}},mounted(){var e,t;this.refreshData(),this.setFormVersion(),this.updateBodyClass(),this.unsubscribeInvoiceData=this.$store.subscribe(i=>{i.type==="invoiceForm/setInvoiceData"&&(this.updateFromParams(),this.isNewInvoice&&sessionStorage.getItem("invoice_template_data")&&this.$nextTick(()=>{f(this.$router,this.$store)}),this.unsubscribeInvoiceData())}),this.isNewInvoice&&this.$route.params.lines&&this.$nextTick(()=>{this.updateFromParams()}),this.isNewInvoice&&((t=(e=this.$route)==null?void 0:e.params)!=null&&t.kind)&&this.checkInvoiceTypeFromParams(),this.isNewInvoice&&sessionStorage.getItem("invoice_template_data")&&this.$nextTick(()=>{f(this.$router,this.$store)})},beforeDestroy(){var e,t,i;delete document.documentElement.dataset.formVersion,(e=this.unsubscribeInvoiceData)==null||e.call(this),(t=this.unsubscribeFeatureFlags)==null||t.call(this),(i=this.stopHashScroll)==null||i.call(this),this.$store.dispatch("invoiceForm/resetState")}};var C=function(){var t=this,i=t._self._c;return i("ContainerWrapper",{attrs:{"back-to":t.isAuthorized?t.PATH_INVOICES_OVERVIEW:null,"has-white-background":!t.isAuthorized,title:t.pageTitle,"title-image":S,"no-white-container":!0,subheader:""}},[t.isNewInvoice||t.buildComplete?i(t.dynamicInvoiceFormComponent,{ref:"invoiceForm",tag:"component",attrs:{"is-editable":!t.editDisabled,"is-edit-eet-invoice-disabled":t.editModeEetInvoice,"correction-invoice-redirect":t.correctionInvoiceRedirect}}):i("InvoiceFormSkeleton")],1)},O=[],R=_(D,C,O,!1,null,null);const Y=R.exports;export{Y as default};
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.